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.
Summary: | Incorrect handling of 'DEL' key | ||
---|---|---|---|
Product: | db | Reporter: | Lukas Jungmann <jungi> |
Component: | Code | Assignee: | Andrei Badea <abadea> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | abadea, mroskanin, pjiricka |
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Lukas Jungmann
2005-11-30 16:46:25 UTC
I can't think of anything in the SQL editor causing this. The SQL editor wraps the editor component in a more complicated UI like this: - JPanel - JSplitter - editor component (toolbar + JEditorPane) - JTable with results But this shouldn't IMHO cause the key presses in the result table to be processed by the editor. It happens in the Java editor too. Focus the toolbar (so that you can navigate between the buttons with the arrow keys) and press Delete. Characters in the editor are deleted. Reassigning to editor. reproduced, I will look at this If the component doesn't provide the action in its ActionMap, then event is fall to parent's ActionMap. Here: if toolbar button has the focus, button's ActionMap (and InputMap) is asked for the "del" keystroke. JButton doesn't provide it, thus the event fall into TopComponent where system action DelateAction is found. We decided to fix it by not allowing the focus to remain in editor toolbar. The same approach is used in the main toolbar. Table in Sql editor should solve the problem itself. Reassigning back. /cvs/editor/src/org/netbeans/modules/editor/NbEditorToolBar.java,v <-- NbEditorToolBar.java new revision: 1.21; previous revision: 1.20 I think the fix in the toolbar doesn't solve the problem. If an action implementing Presenter.Toolbar is added to the toolbar, that action must know about the Del key. Try focusing the Connection combo box in the toolbar of the SQL editor and pressing Del. Can't the toolbar just add Del to its input map and wire it to a dummy empty action? If not, then it should be documented that the action's Presenter.Toolbar must handle the Del key itself. Reassigning back to the editor for evaluation. Re. the fix in the SQL editor result area, I will fix that, reassign back to me. BTW are there any other keys that behave the same way as Del? Cut, copy, paste as well (CloneableEditor: 204-208). Setting 5.0 TM. fixed in [maintrunk] as for editor del, cut, copy and paste action are replaced by NoOpAction in the toolbar's IM and AM. Reassinging back for solving the table problem /cvs/editor/src/org/netbeans/modules/editor/NbEditorToolBar.java,v <-- NbEditorToolBar.java new revision: 1.23; previous revision: 1.22 This is caused by the parent of the CloneableEditor's ActionMap being the editor pane's ActionMap, as described in issue 41223. The delete-next action is then always returned when searching the CloneableEditor's Action map for delete, even when the editor doesn't have the focus. The same applies to the cut, copy and paste actions. Since in the future we'll want to provide our own cut, copy, paste and delete actions in the SQL editor result table, I think the fix of issue 41223 will have to be reconsidered. I filed issue 70096 in this sense. Until then I implemented a workaround which overrides the parent of the CloneableEditor's ActionMap and delegates to it only when the editor pane has the focus. Checking in src/org/netbeans/modules/db/sql/loader/SQLEditorSupport.java; /cvs/db/core/src/org/netbeans/modules/db/sql/loader/SQLEditorSupport.java,v <-- SQLEditorSupport.java new revision: 1.12; previous revision: 1.11 done Checking in CloneableEditorTest.java; /cvs/openide/text/test/unit/src/org/openide/text/CloneableEditorTest.java,v <-- CloneableEditorTest.java new revision: 1.3; previous revision: 1.2 done v. |