Class TerminalView

All Implemented Interfaces:
IActivationListener, IWorkbenchPartIZ, ITerminalStateListener, IDisposedPart, IAdaptable, IExecutableExtension, IPersistable, IViewPart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation

public class TerminalView extends ViewPart implements ITerminalStateListener, IActivationListener, IWorkbenchPartIZ
The Terminal View Part shows one terminal session.
Author:
Christopher Mindus
  • Field Details

    • ID

      public static final String ID
      The Terminal Sessions View Part ID "com.iizigo.term.TerminalView".
  • Constructor Details

    • TerminalView

      public TerminalView()
      Eclipse constructor.
  • Method Details

    • createOrShow

      public static void createOrShow(Shell shell, EditorTerminalProps props)
      Creates a TerminalView for properties, or shows an existing one.
      Parameters:
      shell - The shell.
      props - The terminal properties.
    • hasHostSession

      public boolean hasHostSession()
      Checks if a host session is created.
      Returns:
      true if there is a session created, false otherwise.
    • init

      public void init(IViewSite site) throws PartInitException
      Initializes this view with the given view site.

      This method is automatically called by the workbench shortly after the part is instantiated. It marks the start of the views's life cycle. Clients must not call this method.

      Specified by:
      init in interface IViewPart
      Overrides:
      init in class ViewPart
      Parameters:
      site - The view site.
      Throws:
      PartInitException - if this view was not initialized successfully.
    • init

      public void init(IViewSite site, IMemento memento) throws PartInitException
      Initializes this view with the given view site. A memento is passed to the view which contains a snapshot of the views state from a previous session. Where possible, the view should try to recreate that state within the part controls.

      This method is automatically called by the workbench shortly after the part is instantiated. It marks the start of the views's life cycle. Clients must not call this method.

      Specified by:
      init in interface IViewPart
      Overrides:
      init in class ViewPart
      Parameters:
      site - The view site
      memento - The IViewPart state or null if there is no previous saved state.
      Throws:
      PartInitException - if this view was not initialized successfully.
    • saveState

      public void saveState(IMemento memento)
      Saves the object state within a memento.
      Specified by:
      saveState in interface IPersistable
      Specified by:
      saveState in interface IViewPart
      Overrides:
      saveState in class ViewPart
      Parameters:
      memento - A memento to receive the object state.
    • createPartControl

      public void createPartControl(Composite parent)
      Create contents of the view part.
      Specified by:
      createPartControl in interface IWorkbenchPart
      Specified by:
      createPartControl in class WorkbenchPart
      Parameters:
      parent - The parent composite.
    • dispose

      public void dispose()
      Disposes of the view part.
      Specified by:
      dispose in interface IWorkbenchPart
      Overrides:
      dispose in class WorkbenchPart
    • getExtension

      public IPartExtensionIZ getExtension()
      Gets the extensions framework.
      Specified by:
      getExtension in interface IWorkbenchPartIZ
    • getSelectionEnabler

      public SelectionEnabler getSelectionEnabler()
      Gets the selection enabler instance.
      Specified by:
      getSelectionEnabler in interface IWorkbenchPartIZ
    • isDisposed

      public boolean isDisposed()
      Checks if the part is disposed of.
      Specified by:
      isDisposed in interface IActivationListener
      Specified by:
      isDisposed in interface IDisposedPart
      Specified by:
      isDisposed in interface IWorkbenchPartIZ
      Returns:
      true if disposed of, false otherwise.
    • setFocus

      public void setFocus()
      Sets focus to the terminal.
      Specified by:
      setFocus in interface IWorkbenchPart
      Specified by:
      setFocus in class WorkbenchPart
    • 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.
    • updateStates

      public void updateStates()
      Called when states needs to be updated.
      Specified by:
      updateStates in interface IActivationListener
    • onActivated

      public void onActivated(boolean on)
      Called when activator or deactivated.
      Specified by:
      onActivated in interface IActivationListener
    • onClose

      public void onClose()
      Called when about to close, but SWT is still there.
      Specified by:
      onClose in interface IActivationListener
    • getUndoRedo

      public IPropUndoRedo getUndoRedo()
      Gets the undo context.
      Specified by:
      getUndoRedo in interface IWorkbenchPartIZ