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 47294

Summary: Make the keybindings specification truly declarative
Product: editor Reporter: Miloslav Metelka <mmetelka>
Component: Key bindingsAssignee: issues@editor <issues>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P2    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:

Description Miloslav Metelka 2004-08-17 10:05:57 UTC
Currently the keybindings are read from
SettingsDefaults. The xml files (such as
editor/src/org/netbeans/modules/editor/resources/XMLs/DefaultGlobalKeyBindings.xml)
are only used when producing a diff of the
currently present keybindings against that default
xml file to find a set of keystrokes diff
specifications (extra additions or removals). Only
those (usually few) will be written into
$userdir/Editors/text/base/keybindings.xml for the
future IDE execution (as the default ones are
assumed to be loaded by default from
SettingsDefaults).

The weakness of this mechanism is that for proper
functioning the shortcuts must be written at two
places - once programatically into
SettingsDefaults and once into the
editor/src/org/netbeans/modules/editor/resources/XMLs/DefaultGlobalKeyBindings.xml
file.
 Failing to write a keybinding to the xml file
(while having it in SettingsDefaults) can result
into a deleted shortcut being magically restored
after IDE restart.
 Failing to write a keybinding addition into
SettingsDefaults while having it in xml file can
result into the explicitely added keybinding not
being written to
$userdir/Editors/text/base/keybindings.xml because
it would be assumed that it's a default although
it isn't.

The easiest solution seems to be to abandon
keybindings specifications in the SettingsDefaults
and only use declarative xml specifications. There
is an issue for standalone editor which must be
able to read the keybindings without the IDE
support but it's solvable.
Comment 1 Roman Strobl 2004-12-07 13:54:30 UTC
Changing subcompoment to key bindings.
Comment 2 Vitezslav Stejskal 2008-04-09 10:19:28 UTC
Keybindings are specified through XML files now.