Package com.iizigo.term
Class TerminalComposite
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com.iizigo.term.TerminalComposite
- All Implemented Interfaces:
- ITerminalListener,- HostSessionListener,- Drawable
The terminal composite.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescriptionActions.Actions.Actions.Actions.Actions.Actions.Actions.Actions.Actions.Actions.Actions.Actions.Actions.Actions.- static final StringMemento variable, cursor position and insert mode: "terminalComposite.state".
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- void- addListener- (ITerminalStateListener listener) Adds a listener.- void- createActions- (IPartExtensionIZ extension) Creates the actions such as Copy/Paste/Select All, etc.- static TerminalComposite- createComposite- (Composite parent, EditorTerminalProps props, int charPixelSizeX, int charPixelSizeY, boolean doConnect, boolean allowNonConnected, boolean doAntiAlias) Creates a composite for use with tooltips or previews.- createTerminalAndWindow- (EditorActiveTerminalSession session, HostSessionProps hostSessionProps) Creates the Terminal and Terminal Window instance for a remote terminal session.- createTerminalAndWindow- (HostSession _hostSession, EditorTerminalProps _properties, IScreenDesigner designer) Creates the Terminal and Terminal Window instance for local terminal use in the Designer.- Object[]Gets the contribution menu items as an Object [] where null is menu separator, the rest are IAction instances.Gets the Canvas used for the terminal, used e.g.Gets the host session.Gets the terminal.- booleanCheck for Capture enabled.- booleanCheck for Clear enabled.- booleanCheck for Capture enabled.- booleanCheck for Connect enabled.- booleanCheck for Cut enabled.- booleanCheck for Cut enabled.- booleanCheck for Disconnect enabled.- booleanChecks if new screen is enabled.- booleanCheck for Cut enabled.- booleanCheck for Print enabled.- booleanCheck for Resume enabled.- booleanCheck for Select All enabled.- booleanCheck for Suspend enabled.- boolean- onActivateMenu- (boolean isPopup) Handles display of the pop-up window or activation of the menu bar, called from the TerminalWindow.- void- onConnectChange- (HostSessionPeer peer, boolean connected) Notifies the session of a connect state change.- void- onCursorPositionChange- (HostSessionPeer peer, int x, int y) Notifies the session that the cursor position has changed.- void- onFieldChange- (HostSessionPeer peer) Notifies the session that fields have changed.- void- onHostDataStreamProcessing- (HostSessionPeer peer, boolean isEntering, int updates) Repaint listener.- voidCalled from the Status Bar to toggle Insert mode.- voidCalled from the Status Bar to Reset the host.- voidCalled when the mark changes, called from the TerminalWindow.- boolean- onPopup- (int x, int y) Handles display of the pop-up window.- void- onRemoteState- (int state) Updates the states in a discrete way for the remote terminal.- void- onScreenChange- (HostSessionPeer peer, int beginPos, int endPos) Notifies the session of a screen change.- void- onScreenSizeChange- (HostSessionPeer peer, int cx, int cy) Notifies the session that the screen size has changed.- void- onSessionFailure- (HostSessionPeer peer, Throwable exception) Called when a session has had a failure.- void- onStateChange- (HostSessionPeer peer) Notifies the session of a state change (such as insert mode, lock state, error state).- voidCapture action.- voidPerforms Clear.- voidConfig action.- voidConnect action.- voidPerforms Copy.- voidPerforms Cut.- voidDisconnect action.- voidPerforms new screen.- voidPerforms Paste.- voidPerforms Terminal Preferences.- voidPerforms Print.- voidResume action.- voidPerforms Select All.- voidSuspend action.- void- removeListener- (ITerminalStateListener listener) Removes a listener.- void- resizePreview- (int charPixelSizeX, int charPixelSizeY) Resizes a terminal composite for preview.- void- restoreState- (IMemento memento) Restores the terminal composite state: the cursor position and insert mode.- voidSaves the state: the cursor position and insert mode.- void- setException- (Throwable exception) Sets an Exception in the status bar.- boolean- setFocus()Sets focus to the table.- void- soundAlarm- (HostSessionPeer peer) Sound alarm on the client.- void- switchSession- (HostSession _hostSession, EditorTerminalProps _properties) Switches session.- voidTriggers updates of the states of the actions.- Methods inherited from class org.eclipse.swt.widgets.Composite- changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, redraw, setBackgroundMode, setLayout, setLayoutDeferred, setTabList, toString- Methods inherited from class org.eclipse.swt.widgets.Scrollable- computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar- Methods inherited from class org.eclipse.swt.widgets.Control- addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update- Methods inherited from class org.eclipse.swt.widgets.Widget- addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface org.eclipse.swt.graphics.Drawable- isAutoScalable
- Field Details- MEMENTO_STATEMemento variable, cursor position and insert mode: "terminalComposite.state".- See Also:
 
- actionNewScreenActions.
- actionTermCaptureActions.
- actionCutActions.
- actionCopyActions.
- actionPasteActions.
- actionSelectAllActions.
- actionTermClearActions.
- actionPrintActions.
- actionTermConnectActions.
- actionTermSuspendActions.
- actionTermResumeActions.
- actionTermDisconnectActions.
- actionTermConfigActions.
- actionTermPrefActions.
 
- Constructor Details- TerminalCompositeConstructor.
 
- Method Details- createCompositepublic 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
 
- resizePreviewpublic void resizePreview- (int charPixelSizeX, int charPixelSizeY) Resizes a terminal composite for preview.
- createActionsCreates the actions such as Copy/Paste/Select All, etc.- Parameters:
- extension- The IIZI part.
 
- getActionsGets the contribution menu items as an Object [] where null is menu separator, the rest are IAction instances.
- getCanvasGets the Canvas used for the terminal, used e.g. for context menus.
- getTerminalGets the terminal.- Returns:
- The terminal instance or null if not yet created.
 
- getHostSessionGets the host session.- Returns:
- The host session or null for none.
 
- addListenerAdds a listener.
- removeListenerRemoves a listener.
- createTerminalAndWindowpublic Terminal createTerminalAndWindow- (HostSession _hostSession, EditorTerminalProps _properties, IScreenDesigner designer) Creates the Terminal and Terminal Window instance for local terminal use in the Designer.
- createTerminalAndWindowpublic Terminal createTerminalAndWindow- (EditorActiveTerminalSession session, HostSessionProps hostSessionProps) Creates the Terminal and Terminal Window instance for a remote terminal session.
- switchSessionSwitches session.
- setFocuspublic boolean setFocus()Sets focus to the table.
- triggerUpdateStatespublic void triggerUpdateStates()Triggers updates of the states of the actions.
- onRemoteStatepublic void onRemoteState- (int state) Updates the states in a discrete way for the remote terminal.
- isCutEnabledpublic boolean isCutEnabled()Check for Cut enabled.
- isCopyEnabledpublic boolean isCopyEnabled()Check for Cut enabled.
- isPasteEnabledpublic boolean isPasteEnabled()Check for Cut enabled.
- isClearEnabledpublic boolean isClearEnabled()Check for Clear enabled.
- isSelectAllEnabledpublic boolean isSelectAllEnabled()Check for Select All enabled.
- isPrintEnabledpublic boolean isPrintEnabled()Check for Print enabled.
- isConnectEnabledpublic boolean isConnectEnabled()Check for Connect enabled.
- isSuspendEnabledpublic boolean isSuspendEnabled()Check for Suspend enabled.
- isResumeEnabledpublic boolean isResumeEnabled()Check for Resume enabled.
- isDisconnectEnabledpublic boolean isDisconnectEnabled()Check for Disconnect enabled.
- isCaptureEnabledpublic boolean isCaptureEnabled()Check for Capture enabled.
- isNewScreenEnabledpublic boolean isNewScreenEnabled()Checks if new screen is enabled.
- isConfigEnabledpublic boolean isConfigEnabled()Check for Capture enabled.
- performCutpublic void performCut()Performs Cut.
- performCopypublic void performCopy()Performs Copy.
- performPastepublic void performPaste()Performs Paste.
- performClearpublic void performClear()Performs Clear.
- performSelectAllpublic void performSelectAll()Performs Select All.
- performPrintpublic void performPrint()Performs Print.
- performConnectpublic void performConnect()Connect action.
- performSuspendpublic void performSuspend()Suspend action.
- performResumepublic void performResume()Resume action.
- performDisconnectpublic void performDisconnect()Disconnect action.
- performCapturepublic void performCapture()Capture action.
- performNewScreenpublic void performNewScreen()Performs new screen.
- performConfigpublic void performConfig()Config action.
- performPrefpublic void performPref()Performs Terminal Preferences.
- onScreenChangeNotifies the session of a screen change.- Specified by:
- onScreenChangein interface- HostSessionListener
 
- onFieldChangeNotifies the session that fields have changed.- Specified by:
- onFieldChangein interface- HostSessionListener
 
- onScreenSizeChangeNotifies the session that the screen size has changed.- Specified by:
- onScreenSizeChangein interface- HostSessionListener
 
- onCursorPositionChangeNotifies the session that the cursor position has changed.- Specified by:
- onCursorPositionChangein interface- HostSessionListener
 
- onConnectChangeNotifies the session of a connect state change.- Specified by:
- onConnectChangein interface- HostSessionListener
 
- onStateChangeNotifies the session of a state change (such as insert mode, lock state, error state).- Specified by:
- onStateChangein interface- HostSessionListener
 
- onHostDataStreamProcessingRepaint listener.- Specified by:
- onHostDataStreamProcessingin 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).
 
- onSessionFailureCalled when a session has had a failure.- Specified by:
- onSessionFailurein interface- HostSessionListener
 
- soundAlarmSound alarm on the client.- Specified by:
- soundAlarmin interface- HostSessionListener
 
- onPopuppublic boolean onPopup- (int x, int y) Handles display of the pop-up window.- Specified by:
- onPopupin 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).
 
- onActivateMenupublic boolean onActivateMenu- (boolean isPopup) Handles display of the pop-up window or activation of the menu bar, called from the TerminalWindow.- Specified by:
- onActivateMenuin 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).
 
- onMarkChangepublic void onMarkChange()Called when the mark changes, called from the TerminalWindow.- Specified by:
- onMarkChangein interface- ITerminalListener
 
- onKeyboardResetpublic void onKeyboardReset()Called from the Status Bar to Reset the host.
- onInsertModeTogglepublic void onInsertModeToggle()Called from the Status Bar to toggle Insert mode.
- setExceptionSets an Exception in the status bar.
- saveStateSaves the state: the cursor position and insert mode.
- restoreStateRestores the terminal composite state: the cursor position and insert mode.