Class TerminalComposite

All Implemented Interfaces:
ITerminalListener, HostSessionListener, Drawable

public class TerminalComposite extends Composite implements ITerminalListener, HostSessionListener
The terminal composite.
Author:
Christopher Mindus
  • Field Details Link icon

    • MEMENTO_STATE Link icon

      public static final String MEMENTO_STATE
      Memento variable, cursor position and insert mode: "terminalComposite.state".
      See Also:
    • actionNewScreen Link icon

      public PartAction actionNewScreen
      Actions.
    • actionTermCapture Link icon

      public PartAction actionTermCapture
      Actions.
    • actionCut Link icon

      public PartAction actionCut
      Actions.
    • actionCopy Link icon

      public PartAction actionCopy
      Actions.
    • actionPaste Link icon

      public PartAction actionPaste
      Actions.
    • actionSelectAll Link icon

      public PartAction actionSelectAll
      Actions.
    • actionTermClear Link icon

      public PartAction actionTermClear
      Actions.
    • actionPrint Link icon

      public PartAction actionPrint
      Actions.
    • actionTermConnect Link icon

      public PartAction actionTermConnect
      Actions.
    • actionTermSuspend Link icon

      public PartAction actionTermSuspend
      Actions.
    • actionTermResume Link icon

      public PartAction actionTermResume
      Actions.
    • actionTermDisconnect Link icon

      public PartAction actionTermDisconnect
      Actions.
    • actionTermConfig Link icon

      public PartAction actionTermConfig
      Actions.
    • actionTermPref Link icon

      public PartAction actionTermPref
      Actions.
  • Constructor Details Link icon

  • Method Details Link icon

    • createComposite Link icon

      public static TerminalComposite createComposite(Composite parent, EditorTerminalProps props, int charPixelSizeX, int charPixelSizeY, boolean doConnect, boolean allowNonConnected, boolean doAntiAlias) throws IOException
      Creates a composite for use with tooltips or previews.
      Throws:
      IOException
    • resizePreview Link icon

      public void resizePreview(int charPixelSizeX, int charPixelSizeY)
      Resizes a terminal composite for preview.
    • createActions Link icon

      public void createActions(IPartExtensionIZ extension)
      Creates the actions such as Copy/Paste/Select All, etc.
      Parameters:
      extension - The IIZI part.
    • getActions Link icon

      public Object[] getActions()
      Gets the contribution menu items as an Object [] where null is menu separator, the rest are IAction instances.
    • getCanvas Link icon

      public Canvas getCanvas()
      Gets the Canvas used for the terminal, used e.g. for context menus.
    • getTerminal Link icon

      public Terminal getTerminal()
      Gets the terminal.
      Returns:
      The terminal instance or null if not yet created.
    • getHostSession Link icon

      public HostSession getHostSession()
      Gets the host session.
      Returns:
      The host session or null for none.
    • addListener Link icon

      public void addListener(ITerminalStateListener listener)
      Adds a listener.
    • removeListener Link icon

      public void removeListener(ITerminalStateListener listener)
      Removes a listener.
    • createTerminalAndWindow Link icon

      public Terminal createTerminalAndWindow(HostSession _hostSession, EditorTerminalProps _properties, IScreenDesigner designer)
      Creates the Terminal and Terminal Window instance for local terminal use in the Designer.
    • createTerminalAndWindow Link icon

      public Terminal createTerminalAndWindow(EditorActiveTerminalSession session, HostSessionProps hostSessionProps)
      Creates the Terminal and Terminal Window instance for a remote terminal session.
    • switchSession Link icon

      public void switchSession(HostSession _hostSession, EditorTerminalProps _properties)
      Switches session.
    • setFocus Link icon

      public boolean setFocus()
      Sets focus to the table.
      Overrides:
      setFocus in class Composite
    • triggerUpdateStates Link icon

      public void triggerUpdateStates()
      Triggers updates of the states of the actions.
    • onRemoteState Link icon

      public void onRemoteState(int state)
      Updates the states in a discrete way for the remote terminal.
    • isCutEnabled Link icon

      public boolean isCutEnabled()
      Check for Cut enabled.
    • isCopyEnabled Link icon

      public boolean isCopyEnabled()
      Check for Cut enabled.
    • isPasteEnabled Link icon

      public boolean isPasteEnabled()
      Check for Cut enabled.
    • isClearEnabled Link icon

      public boolean isClearEnabled()
      Check for Clear enabled.
    • isSelectAllEnabled Link icon

      public boolean isSelectAllEnabled()
      Check for Select All enabled.
    • isPrintEnabled Link icon

      public boolean isPrintEnabled()
      Check for Print enabled.
    • isConnectEnabled Link icon

      public boolean isConnectEnabled()
      Check for Connect enabled.
    • isSuspendEnabled Link icon

      public boolean isSuspendEnabled()
      Check for Suspend enabled.
    • isResumeEnabled Link icon

      public boolean isResumeEnabled()
      Check for Resume enabled.
    • isDisconnectEnabled Link icon

      public boolean isDisconnectEnabled()
      Check for Disconnect enabled.
    • isCaptureEnabled Link icon

      public boolean isCaptureEnabled()
      Check for Capture enabled.
    • isNewScreenEnabled Link icon

      public boolean isNewScreenEnabled()
      Checks if new screen is enabled.
    • isConfigEnabled Link icon

      public boolean isConfigEnabled()
      Check for Capture enabled.
    • performCut Link icon

      public void performCut()
      Performs Cut.
    • performCopy Link icon

      public void performCopy()
      Performs Copy.
    • performPaste Link icon

      public void performPaste()
      Performs Paste.
    • performClear Link icon

      public void performClear()
      Performs Clear.
    • performSelectAll Link icon

      public void performSelectAll()
      Performs Select All.
    • performPrint Link icon

      public void performPrint()
      Performs Print.
    • performConnect Link icon

      public void performConnect()
      Connect action.
    • performSuspend Link icon

      public void performSuspend()
      Suspend action.
    • performResume Link icon

      public void performResume()
      Resume action.
    • performDisconnect Link icon

      public void performDisconnect()
      Disconnect action.
    • performCapture Link icon

      public void performCapture()
      Capture action.
    • performNewScreen Link icon

      public void performNewScreen()
      Performs new screen.
    • performConfig Link icon

      public void performConfig()
      Config action.
    • performPref Link icon

      public void performPref()
      Performs Terminal Preferences.
    • onScreenChange Link icon

      public void onScreenChange(HostSessionPeer peer, int beginPos, int endPos)
      Notifies the session of a screen change.
      Specified by:
      onScreenChange in interface HostSessionListener
    • onFieldChange Link icon

      public void onFieldChange(HostSessionPeer peer)
      Notifies the session that fields have changed.
      Specified by:
      onFieldChange in interface HostSessionListener
    • onScreenSizeChange Link icon

      public void onScreenSizeChange(HostSessionPeer peer, int cx, int cy)
      Notifies the session that the screen size has changed.
      Specified by:
      onScreenSizeChange in interface HostSessionListener
    • onCursorPositionChange Link icon

      public void onCursorPositionChange(HostSessionPeer peer, int x, int y)
      Notifies the session that the cursor position has changed.
      Specified by:
      onCursorPositionChange in interface HostSessionListener
    • onConnectChange Link icon

      public void onConnectChange(HostSessionPeer peer, boolean connected)
      Notifies the session of a connect state change.
      Specified by:
      onConnectChange in interface HostSessionListener
    • onStateChange Link icon

      public void onStateChange(HostSessionPeer peer)
      Notifies the session of a state change (such as insert mode, lock state, error state).
      Specified by:
      onStateChange in interface HostSessionListener
    • onHostDataStreamProcessing Link icon

      public void onHostDataStreamProcessing(HostSessionPeer peer, boolean isEntering, int updates)
      Repaint listener.
      Specified by:
      onHostDataStreamProcessing in interface HostSessionListener
      Parameters:
      peer - The peer.
      isEntering - The state of processing (true=before, false=after).
      updates - What has been updated on screen (bit flag: 0x01=characters, 0x02=fields).
    • onSessionFailure Link icon

      public void onSessionFailure(HostSessionPeer peer, Throwable exception)
      Called when a session has had a failure.
      Specified by:
      onSessionFailure in interface HostSessionListener
    • soundAlarm Link icon

      public void soundAlarm(HostSessionPeer peer)
      Sound alarm on the client.
      Specified by:
      soundAlarm in interface HostSessionListener
    • onPopup Link icon

      public boolean onPopup(int x, int y)
      Handles display of the pop-up window.
      Specified by:
      onPopup in interface ITerminalListener
      Parameters:
      x - The mouse position in X relative the terminal container.
      y - The mouse position in Y relative the terminal container.
      Returns:
      true if handled (i.e. menu is displayed).
    • onActivateMenu Link icon

      public boolean onActivateMenu(boolean isPopup)
      Handles display of the pop-up window or activation of the menu bar, called from the TerminalWindow.
      Specified by:
      onActivateMenu in interface ITerminalListener
      Parameters:
      isPopup - Flag indicating it's a pop-up that should be activated, as opposed to the menu bar.
      Returns:
      true if handled (i.e. menu is displayed).
    • onMarkChange Link icon

      public void onMarkChange()
      Called when the mark changes, called from the TerminalWindow.
      Specified by:
      onMarkChange in interface ITerminalListener
    • onKeyboardReset Link icon

      public void onKeyboardReset()
      Called from the Status Bar to Reset the host.
    • onInsertModeToggle Link icon

      public void onInsertModeToggle()
      Called from the Status Bar to toggle Insert mode.
    • setException Link icon

      public void setException(Throwable exception)
      Sets an Exception in the status bar.
    • saveState Link icon

      public void saveState(IMemento memento)
      Saves the state: the cursor position and insert mode.
    • restoreState Link icon

      public void restoreState(IMemento memento)
      Restores the terminal composite state: the cursor position and insert mode.