Class ScreenEditor

All Implemented Interfaces:
IActivationListener, IDraggingFix, IWorkbenchPartIZ, IPropertyEditorController, IPropUndoContext, ITermEditor, ITerminalStateListener, IDisposedPart, IPropUndoRedo, IAdaptable, IExecutableExtension, ISelectionChangedListener, ISelectionProvider, IGotoMarker, IEditorPart, INavigationLocationProvider, IPersistable, IPersistableEditor, ISaveablePart, ISaveablesSource, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation

public class ScreenEditor extends PropEditorPart implements ITerminalStateListener, ITermEditor
The Terminal Screen Editor part.
Author:
Christopher Mindus
  • Field Details

    • ID

      public static final String ID
      The Part ID.
    • sessionNameQualifier

      public static final QualifiedName sessionNameQualifier
      The Session Name Qualifier for files.
    • hostSession

      public HostSession hostSession
      The host session.
    • xPopupOffset

      public int xPopupOffset
      The popup offset in X.
    • yPopupOffset

      public int yPopupOffset
      The popup offset in Y.
  • Constructor Details

    • ScreenEditor

      public ScreenEditor()
      Eclipse constructor.
  • Method Details

    • initEditor

      protected void initEditor(PropCnr cnr) throws PartInitException
      The initialize editor method.

      Subclasses may override this method.

      Overrides:
      initEditor in class PropEditorPart
      Parameters:
      cnr - The property container being edited. Note: the real name of the property is in the parent FilePropCnr Atom.
      Throws:
      PartInitException - For initialization failures.
    • onEditorActivated

      protected void onEditorActivated(boolean on)
      Called when editor is activated. The time is stored so that focus events can check if they should be processed or not (marking in Terminal).
      Overrides:
      onEditorActivated in class PropEditorPart
    • usePasteBeforeAfter

      protected boolean usePasteBeforeAfter()
      Override to return how paste before/after are processed.
      Overrides:
      usePasteBeforeAfter in class PropEditorPart
      Returns:
      true to handle before/after.
    • isTooltipTextShown

      public boolean isTooltipTextShown()
      If tool tips are shown.
      Specified by:
      isTooltipTextShown in interface ITermEditor
    • isHotSpotEnabled

      public boolean isHotSpotEnabled()
      Check for hotspot enabled.
      Specified by:
      isHotSpotEnabled in interface ITermEditor
    • isCursorPresent

      public boolean isCursorPresent()
      Cursor present (and blinking)?
      Specified by:
      isCursorPresent in interface ITermEditor
    • getViewer

      public TreeViewer getViewer()
      Gets the viewer.
      Specified by:
      getViewer in interface ITermEditor
    • getHostSession

      public HostSession getHostSession()
      Gets the HostSession.
      Specified by:
      getHostSession in interface ITermEditor
    • onClose

      public void onClose()
      Called when the part is being closed but is not yet disposed but hidden.
      Specified by:
      onClose in interface IActivationListener
      Overrides:
      onClose in class PropEditorPart
    • dispose

      public void dispose()
      Dispose of the editor.
      Specified by:
      dispose in interface IWorkbenchPart
      Overrides:
      dispose in class PropEditorPart
    • createEditorComposite

      protected void createEditorComposite(Composite parent)
      Creates the Editor Main Composite.
      Specified by:
      createEditorComposite in class PropEditorPart
      Parameters:
      parent - The empty parent composite without initialized layout, with the widget background color.
    • getMarkingConstraints

      public Rectangle getMarkingConstraints()
      Gets the rectangle marking constraints. This is used for pop-up windows.
      Specified by:
      getMarkingConstraints in interface ITermEditor
      Returns:
      null If no constrains are present.
    • performPrint

      protected void performPrint()
      Performs Print.
      Specified by:
      performPrint in class PropEditorPart
    • onTerminalStateUpdate

      public void onTerminalStateUpdate(HostSession hostSession, TerminalWindow tw)
      Called when state probably needs update or check.
      Specified by:
      onTerminalStateUpdate in interface ITerminalStateListener
      Parameters:
      hostSession - The host session, may be null.
      tw - The TerminalWindow, may be null when hostSession is null, not otherwise.
    • onTerminalFieldChanged

      public void onTerminalFieldChanged(HostSession hostSession, TerminalWindow tw)
      Called when the screen needs updates due to field change.
      Specified by:
      onTerminalFieldChanged in interface ITerminalStateListener
      Parameters:
      hostSession - The host session, may be null.
      tw - The TerminalWindow, may be null when hostSession is null, not otherwise.
    • updateToolStates

      public void updateToolStates()
      Updates tool states.
      Specified by:
      updateToolStates in interface ITermEditor
    • saveStateImpl

      protected void saveStateImpl(IMemento memento)
      Saves the state.
      Overrides:
      saveStateImpl in class PropEditorPart
      Parameters:
      memento - The storage area for object's state.
    • getTerminalComposite

      public TerminalComposite getTerminalComposite()
      Gets the terminal composite.
      Specified by:
      getTerminalComposite in interface ITermEditor
    • selectionChangedEx

      protected void selectionChangedEx(SelectionChangedEvent event)
      Selection changes in the tree.
      Overrides:
      selectionChangedEx in class PropEditorPart
    • updateStatesEx

      protected void updateStatesEx()
      Called to update the states.
      Overrides:
      updateStatesEx in class PropEditorPart
    • doOpen

      public boolean doOpen(GProp<?>[] props)
      Opens the property by selecting it in focus.
      Overrides:
      doOpen in class PropEditorPart
    • doOpen

      public boolean doOpen(GProp<?> prop, int index, String childName)
      Opens the property by selecting it in focus. This method must be overridden.
      Overrides:
      doOpen in class PropEditorPart
      Parameters:
      prop - The property to focus.
      index - The index in a multi-property.
      childName - Name of child property or null.
      Returns:
      true for success, false for failure.
    • onDoubleClick

      public void onDoubleClick(int x, int y)
      Marks the host field.
      Specified by:
      onDoubleClick in interface ITermEditor
    • paint

      public void paint(Graphics2D g, int leftMargin, int topMargin, int cxFont, int cyFont, int cxFontReal, int cyFontReal, int cxScreen, int cyScreen, Rectangle clipRect)
      Paints the Graphics once the screen is drawn, before the cursor.
      Specified by:
      paint in interface ITermEditor