This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 25763 - Do not sync system actions (Cut, Copy, Paste, Delete) from editor (its job of openide.text package)
Summary: Do not sync system actions (Cut, Copy, Paste, Delete) from editor (its job of...
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks: 25737
  Show dependency tree
 
Reported: 2002-07-18 09:55 UTC by Peter Zavadsky
Modified: 2007-11-05 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Zavadsky 2002-07-18 09:55:41 UTC
Do not reset those enumerated actions from editor.
Those actions are synch via openide.text package.
(At least for the Delete action the editor still
does the unneeded job).
Comment 1 Peter Zavadsky 2002-07-18 10:14:25 UTC
Editor wrongly enables system delete action when selected text and the
source is read-only, which is editor not aware of. (Remove the
updating ASAP).
Comment 2 Miloslav Metelka 2002-07-18 12:23:35 UTC
The current handling of the DeleteAction in the CloneableEditor
delegates the enabled flag status to the editor action corresponding
to DefaultEditorKit.deleteNextCharAction. AFAIK the current semantics
is that the DeleteAction should only be enabled if there is a valid
selection in the editor. However the deleteNextCharAction should
always be enabled (it either removes the selection if present or a
next char). So please in CloneableEditor make sure that the enabled
flag of the DeleteAction is set irrespective of the enabled flag of
the deleteNextCharAction. It's e.g. possible to do
pane.getCaret().addChangeListener() and check caret.isSelectionVisible().
Comment 3 Peter Zavadsky 2002-07-18 13:04:16 UTC
In case the source is read-only ssytem Delete doesn't respect the
enabled flag (set via CloneableEditor now).
But editor doesn't know about the read-only state, and mistakenly
resets it (system Delete) back to enabled.
Comment 4 Miloslav Metelka 2002-07-18 19:27:59 UTC
Yes, I know, but what I'm asking for is that once the editor part of
fix is done you will need to completely disconnect the DeleteAction's
enabled flag from the editor's deleteNextCharAction (the current code
in CloneableEditor) because that action will never be disabled in the
editor. It depends on the semantics - whether the DeleteAction should
be enabled only when there is a valid selection (and the file is not
readonly) or whether it should be always enabled (if the file is not
readonly).
Comment 5 Miloslav Metelka 2002-07-18 19:29:43 UTC
Fixed in trunk.

Checking in src/org/netbeans/modules/editor/NbEditorUI.java;
/cvs/editor/src/org/netbeans/modules/editor/NbEditorUI.java,v  <-- 
NbEditorUI.java
new revision: 1.18; previous revision: 1.17
done
Comment 6 Peter Zavadsky 2002-07-19 07:26:45 UTC
Aha, do you mean the listening on the action is unnecessary, don't
you? And how it is if the cursor appears in guarded blocks?
Comment 7 Miloslav Metelka 2002-07-19 09:04:09 UTC
After personal meeting we've agreed that the change in semantics of
the DeleteAction (will remove single char if there is no selection) is
OK so the binding to deleteNextCharAction can be retained.
We will update the handling of the deleteNextCharAction so that it's
not enabled in guarded blocks.
Comment 8 Jiri Prox 2006-04-07 09:06:41 UTC
Verified