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 115129 - Allow pluggable filters for loading/saving settings
Summary: Allow pluggable filters for loading/saving settings
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Settings (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milutin Kristofic
URL:
Keywords: API
Depends on:
Blocks: 179047 90403
  Show dependency tree
 
Reported: 2007-09-10 10:12 UTC by Vitezslav Stejskal
Modified: 2016-07-07 07:27 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitezslav Stejskal 2007-09-10 10:12:15 UTC
The old editor settings API allowed adding Settings.Filter implementations that modules could use for tweaking setting
values supplied by modules through settings initializers. While this is usually not needed there is the jVi plugin that
relies on this functionality for installing special keybindings.

We should find a suitable way for supporting this in Editor Settings and Editor Settings Storage APIs.
Comment 1 err 2007-09-10 20:34:47 UTC
Some things to consider
- The set of keys that jVi binds is dynamic. Tools>Options>... is used to specify which keys jVi should catch.
- Only CTRL keys and single modifier keys typically on keypad are available for selecting.
- Keys not caught by jVi "pass through" to the option selected keypad profile.
- There is a jVi checkbox in Tools, so the jVi keybindings are inserted when needed.
- NB's default key typed action has magic and must be used. jVi goes through gyrations to get hold of it, then relay
events to it as needed.

Some design/implementation details are in the email thread
http://www.nabble.com/jVi-as-KeyBindings-instead-of-extending-EditorKits-tf3281472.html#a9127667 . This thread gives
some insight into how things developed the way they are.

Catching the key events elsewhere in the delivery pipeline migh be tricky to avoid interfering with NB.

Other approaches to catching the events and/or to adding jVi's keybindings is certainly possible. It does seem that it
needs to be a "NB" supported API since there are a variety of NB specific requirements. I don't have much GUI, Swing or
NB deep experience, but I will contribute as I can in examining/considering alternatives.
Comment 2 err 2008-06-08 00:31:03 UTC
This will undoubtedly be the trickiest part of porting jVi to nb6.5.

Though this issue is mentioned in issue #90403 there doesn't seem to be anything concrete. Any ideas about this? Is
there something I can or should be doing to find a resolution for this (difficult considering my limited available time).
Comment 3 Vitezslav Stejskal 2008-06-09 11:54:21 UTC
I'll generate and attach here the javadoc of StorageFilter. But basically you can hook into loading settings (eg.
keybindings) and add/remove/modify them as you like. StorageFilter has two methods afterLoad(), beforeSave(), which
allow intercepting both loading and saving. So filters can undo whatever they have done before settings are persisted to
the storage.
Comment 4 Miloslav Metelka 2008-11-26 14:30:56 UTC
Should be resolved in 7.0.
Comment 5 Martin Balin 2016-07-07 07:27:56 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss