Awesome, it's very cool that you're using this stuff! I'm not sure many people actually use the library framework in fife.common.jar besides me. Because of that, I'm sure it's way more difficult to use than it needs to be.
Glad you figured out how to add dockable windows. The AbstractPluggableGUIApplication only exposes an addPlugin() method, so you had to do some ugly casting to add just a dockable window. There's one example of something that should be doable via a simple method. Also I suppose DockableWindows should default to "active"?
As for the size of the docked windows, use app.setSplitPaneDividerLocation
(int side, int pos). The "side" parameter is one of the DockableWindowConstants
Loading and saving preferences is one of the worst parts of the library. The loading of preferences is automatic, and the setting of all the built-in fields of GUIApplicationPreferences is also automatic - window location & size, LookAndFeel, etc. But any app-specific preferences you define in your GUIApplicationPreferences subclass must be set yourself, usually from your preDisplayInit override (cast the GUIApplicationPreferences to your concrete type and use it).
Saving of the preference values is not
automatic, however. You have to create an instance of your concrete GUIApplicationPreferences subclass yourself and call its savePreferences() method. Probably the best thing to do is look at how RText does it:
- Override the doExit() method and save your preferences there.
- Have some sort of way to generate the preferences object, and use the Java Preferences API to actually save the stuff (see the RTextPreferences class, particularly the savePreferences() method)
The preferences are stored wherever the Java Preferences APi saves them; on Windows it's the registry (yuck), everywhere else it's an XML file in your home directory.
Honestly though, I'd suggest forgoing this route and using the simpler org.fife.ui.app.Prefs
class instead. It's what the RText plugins use (see e.g. SourceBrowserPlugin
#loadPrefs()/savePreferences() and SourceBrowserPrefs
). It's better (in my opinion) because it's simpler than the Java Preferences API, and loads/saves to a simple properties file (doesn't use the registry on Windows). I'm probably going to redo AbstractGUIApplication to use this class instead of what it currently does in the future because it's so much simpler.