Interface RootEditor


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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A context for the root editor, providing additional data and a connection back to the containing editor top component.
    static interface 
    An interface for providers of root editors.
    static enum 
    Types of tool action.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Hook called when the containing top component is activated.
    default void
    Hook called when the containing top component is deactivated.
    default void
    Hook called when the containing top component is hidden.
    default void
    Hook called when the containing top component is shown.
    default void
    Hook called when the editor component is being uninstalled and disposed of.
    default List<Action>
    Get a list of action to be added to the top component toolbar.
    Acquire the main editor component.
    default org.openide.util.Lookup
    Get the editor lookup.
    default org.openide.awt.UndoRedo
    Get the undo-redo support.
    default boolean
    Request focus of the editor component.
    Return the set of tool actions this editor wishes to support.
    default void
    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. See TopComponent.componentShowing().

      The default implementation does nothing.

    • componentActivated

      default void componentActivated()
      Hook called when the containing top component is activated. See TopComponent.componentActivated().

      The default implementation does nothing.

    • componentDeactivated

      default void componentDeactivated()
      Hook called when the containing top component is deactivated. See TopComponent.componentDeactivated().

      The default implementation does nothing.

    • componentHidden

      default void componentHidden()
      Hook called when the containing top component is hidden. See TopComponent.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

      default List<Action> 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 of componentActivated(). 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 calls JComponent.requestFocusInWindow() on the editor component.
      Returns:
      false if the request is guaranteed to fail, true if it is likely to succeed.
    • supportedToolActions

      default Set<RootEditor.ToolAction> supportedToolActions()
      Return the set of tool actions this editor wishes to support. The default implementation returns EnumSet.noneOf(ToolAction.class). To install all default tool actions, return EnumSet.allOf(ToolActions.class) or otherwise filter the returned set.
      Returns:
      support tool actions