App
, which is the XMLmind XML Editor desktop application, is an assembly of AppPart
s. This assembly is specified in DesktopApp.xxe_gui
.
AppPart
is an interface:
Method | Description |
---|---|
activeEditorChanged | Invoked after the active editor has changed or when there is no active editor at all (generally because all documents have been closed). |
isEditingContextSensitive | This method must return true if the part is intrinsically context sensitive and it must return false if this part is intrinsically not context sensitive. |
editingContextChanged | Invoked when the editing context (text node containing caret, node selection, etc) changes in active editor. This method is never invoked if isEditingContextSensitive returned false when the App has registered the part. |
validityStateChanged | Invoked after active document has been checked for validity. |
saveStateChanged | Invoked after active document has been saved or, on the contrary, when its has been modified and thus needs to be saved. |
namespacePrefixesChanged | Invoked after the namespace/prefix map has been modified for the active document. |
undoStateChanged | Invoked after it becomes possible to undo or redo a command in active document or, on the contrary, when it becomes impossible to undo or redo a command. |
applyPreferences | If this part supports user preferences, this part should update its state after reading its settings from the object returned by App.getPreferences . |
flushPreferences | If this part supports user preferences, this part should store its current settings in the object returned by App.getPreferences . |
Visual objects may implement this interface (EditAttributePane
, OpenAction
, etc) as well as non-visual objects (AutoSavePart
, SpellOptionsPart
, etc).
There are building blocks other than AppPart
s: AppPreferencesSheet
s. These objects are somewhat simpler than AppPart
s and much less related to the App
than AppPart
s. For now, suffice to say that next chapter will describe how to write a simple AppPreferencesSheet
.
This chapter will not attempt to describe another way to extend XMLmind XML Editor: OpenDocumentHook
.
Several interfaces extends the AppPart
interface:
AppTool
Interface implemented by a javax.swing.JComponent
designed to be included in an horizontal tool bar or in a status bar.
AppPane
Interface implemented by a javax.swing.JComponent
designed to be included in the “tool area” found at the left and/or at the right of the document views.
Several abstract classes implements the AppPart
interface (they are not all listed here):
AppAction
A javax.swing.AbstractAction
which implements the AppPart
interface.
LengthyAction
An AppAction
which is expected to take a long time to run.
CancelableAction
An AppAction
which is expected to take a long time to run and which can be canceled during its execution.
EditAction
An AppAction
which is a wrapper for a CommandBase
.
AppMenuItems
A dynamic set of menu items. For example, this is used to implement configuration specific menu items.
AppToolBarItems
A dynamic set of tool bar buttons. For example, this is used to implement configuration specific tool bar buttons.
AppRibbonItems
A dynamic set of “ribbon” buttons. For example, this is used to implement configuration specific ribbon buttons.
AppPartBase
A “worker” part, having no GUI. For example, the auto-save feature is implemented this way.