Package org.praxislive.ide.pxr.spi
Interface RootEditor
- All Known Implementing Classes:
GraphEditor,GuiEditor
public interface RootEditor
An interface for services providing the ability to edit a root. The provided
editor will be installed within the root editor top component.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA context for the root editor, providing additional data and a connection back to the containing editor top component.static interfaceAn interface for providers of root editors.static enumTypes of tool action. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidHook called when the containing top component is activated.default voidHook called when the containing top component is deactivated.default voidHook called when the containing top component is hidden.default voidHook called when the containing top component is shown.default voiddispose()Hook called when the editor component is being uninstalled and disposed of.Get a list of action to be added to the top component toolbar.Acquire the main editor component.default org.openide.util.LookupGet the editor lookup.default org.openide.awt.UndoRedoGet the undo-redo support.default booleanRequest focus of the editor component.default Set<RootEditor.ToolAction> Return the set of tool actions this editor wishes to support.default voidsync()Hook called to ensure any data in the editor is synced to the underlying model.
-
Method Details
-
getEditorComponent
JComponent getEditorComponent()Acquire the main editor component. This component will be installed in the central pane of the root editor top component. This method should always return the same instance.- Returns:
- main editor component
-
componentShowing
default void componentShowing()Hook called when the containing top component is shown. SeeTopComponent.componentShowing().The default implementation does nothing.
-
componentActivated
default void componentActivated()Hook called when the containing top component is activated. SeeTopComponent.componentActivated().The default implementation does nothing.
-
componentDeactivated
default void componentDeactivated()Hook called when the containing top component is deactivated. SeeTopComponent.componentDeactivated().The default implementation does nothing.
-
componentHidden
default void componentHidden()Hook called when the containing top component is hidden. SeeTopComponent.componentHidden().The default implementation does nothing.
-
sync
default void sync()Hook called to ensure any data in the editor is synced to the underlying model. Will be called prior to saving, and any other time the model needs to be up-to-date.The default implementation does nothing.
-
dispose
default void dispose()Hook called when the editor component is being uninstalled and disposed of.The default implementation does nothing.
-
getActions
Get a list of action to be added to the top component toolbar.The default implementation returns an empty list.
- Returns:
- list of toolbar actions
-
getLookup
default org.openide.util.Lookup getLookup()Get the editor lookup. This lookup will be merged into the top component lookup.The top component lookup will already reflect the main context explorer manager from
RootEditor.Context.explorerManager().The default implementation returns an empty lookup.
- Returns:
- editor lookup
-
getUndoRedo
default org.openide.awt.UndoRedo getUndoRedo()Get the undo-redo support.The default implementation returns
UndoRedo.NONE.- Returns:
- undo redo
-
requestFocus
default boolean requestFocus()Request focus of the editor component. This method is called by the default implementation ofcomponentActivated(). This method will also be called while the component is activated to return focus to the RootEditor component (eg. from tool actions). The default implementation callsJComponent.requestFocusInWindow()on the editor component.- Returns:
falseif the request is guaranteed to fail,trueif it is likely to succeed.
-
supportedToolActions
Return the set of tool actions this editor wishes to support. The default implementation returnsEnumSet.noneOf(ToolAction.class). To install all default tool actions, returnEnumSet.allOf(ToolActions.class)or otherwise filter the returned set.- Returns:
- support tool actions
-