Package com.iizigo.term.internal
Class Terminal
java.lang.Object
com.iizigo.term.internal.Terminal
- All Implemented Interfaces:
- TerminalWindowListener
The Terminal class displays the window of the emulator. All keystrokes are sent to the host and all changes of the screen is mapped back into the terminal window.
- Constructor SummaryConstructorsConstructorDescription- Terminal- (EditorActiveTerminalSession session, HostSessionProps props) Constructor for a remote session to a server.- Terminal- (HostSession hostSession, EditorTerminalProps terminalProps) Creates a new terminal session for a local connection inside the Designer.
- Method SummaryModifier and TypeMethodDescription- void- addListener- (ITerminalListener listener) Adds a terminal listener.- void- clear()Clears the entire screen.- void- createTerminal- (org.eclipse.swt.widgets.Canvas canvas, TerminalStatusBar statusBar, IScreenDesigner designer) Creates an instance of the terminal window.- void- dispose()Disposes of the instance.- int[]Gets the attributes for direct manipulation of underlines.- intGets the cursor X.- intGets the cursor X.Gets the HostSession.- booleanGets the insert mode.- org.eclipse.swt.graphics.Rectangle[]- getMarks()Gets the rectangle presently marked.Gets the Settings container.Gets the AWT TerminalWindow container.- boolean- hasMark()Checks if a rectangle is presently marked.- booleanThe insert mode can be read using this method.- booleanChecks if disconnected, used e.g.- boolean- isLocked()Checks if the terminal session is locked.- booleanChecks if marking is allowed, i.e.- boolean- onActivateMenu- (boolean isPopup) Handles display of the pop-up window or activation of the menu bar.- voidCalled when the mark changes.- boolean- onPopup- (int x, int y) Handles display of the pop-up window.- void- removeListener- (ITerminalListener listener) Removes a terminal listener.- voidRemoves the rectangle mark.- voidSelects all in terminal window.- void- sendCharacter- (char ch) Sends a character string to the terminal.- void- sendHostKey- (int key) Sends a host key to the host.- voidSends a key to the terminal.- boolean- setCursor- (int x, int y) Sets the cursor position to X/Y.- void- soundAlarm- (boolean isHostAlarm) Sounds the Alarm.- void- switchProperties- (HostSession hostSession, EditorTerminalProps terminalProps) Switches properties.- void- updateCursor- (int x, int y) The cursor position has changed from Local terminal.- void- updateScreenData- (int begin, int end) The screen has changed between two points in a wrapping fashion.- voidSets the screen size from Local terminal.
- Constructor Details- TerminalConstructor for a remote session to a server.
- TerminalCreates a new terminal session for a local connection inside the Designer.
 
- Method Details- addListenerAdds a terminal listener.
- removeListenerRemoves a terminal listener.
- switchPropertiesSwitches properties.
- getHostSessionGets the HostSession.
- getSettingsGets the Settings container.
- createTerminalpublic void createTerminal- (org.eclipse.swt.widgets.Canvas canvas, TerminalStatusBar statusBar, IScreenDesigner designer) Creates an instance of the terminal window.
- onActivateMenupublic boolean onActivateMenu- (boolean isPopup) Handles display of the pop-up window or activation of the menu bar.- Specified by:
- onActivateMenuin interface- TerminalWindowListener
- 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).
 
- onPopuppublic boolean onPopup- (int x, int y) Handles display of the pop-up window.- Specified by:
- onPopupin interface- TerminalWindowListener
- 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).
 
- clearpublic void clear()Clears the entire screen.
- sendKeySends a key to the terminal.- Specified by:
- sendKeyin interface- TerminalWindowListener
- Parameters:
- e- The Host Key Event.
 
- sendHostKeypublic void sendHostKey- (int key) Sends a host key to the host. This method is only called from the "block mode" terminal emulation (HScreen, HField's or "this"), and doesn't take keyboard type-ahead into account.- Specified by:
- sendHostKeyin interface- TerminalWindowListener
- Parameters:
- key- The key to send.
 
- sendCharacterpublic void sendCharacter- (char ch) Sends a character string to the terminal.- Specified by:
- sendCharacterin interface- TerminalWindowListener
- Parameters:
- ch- The character to send.
 
- setCursorpublic boolean setCursor- (int x, int y) Sets the cursor position to X/Y.- Specified by:
- setCursorin interface- TerminalWindowListener
- Parameters:
- x- The X position.
- y- The Y position.
- Returns:
- false for failure (or not supported).
 
- isLockedpublic boolean isLocked()Checks if the terminal session is locked.- Specified by:
- isLockedin interface- TerminalWindowListener
- Returns:
- true if locked.
 
- inInsertModepublic boolean inInsertMode()The insert mode can be read using this method.- Specified by:
- inInsertModein interface- TerminalWindowListener
- Returns:
- true if insert mode, false = overwrite.
 
- soundAlarmpublic void soundAlarm- (boolean isHostAlarm) Sounds the Alarm.
- updateScreenDatapublic void updateScreenData- (int begin, int end) The screen has changed between two points in a wrapping fashion.- Parameters:
- begin- The beginning position.
- end- The end position (inclusive).
 
- updateScreenSizepublic void updateScreenSize()Sets the screen size from Local terminal.
- updateCursorpublic void updateCursor- (int x, int y) The cursor position has changed from Local terminal.
- disposepublic void dispose()Disposes of the instance.
- hasMarkpublic boolean hasMark()Checks if a rectangle is presently marked.
- getMarkspublic org.eclipse.swt.graphics.Rectangle[] getMarks()Gets the rectangle presently marked.
- removeMarkspublic void removeMarks()Removes the rectangle mark.
- isDisconnectedpublic boolean isDisconnected()Checks if disconnected, used e.g. to paint the cursor.- Specified by:
- isDisconnectedin interface- TerminalWindowListener
- Returns:
- true if disconnected.
 
- selectAllpublic void selectAll()Selects all in terminal window.
- onMarkChangepublic void onMarkChange()Called when the mark changes.- Specified by:
- onMarkChangein interface- TerminalWindowListener
 
- getTerminalWindowGets the AWT TerminalWindow container.
- isMarkAllowedpublic boolean isMarkAllowed()Checks if marking is allowed, i.e. connected.- Specified by:
- isMarkAllowedin interface- TerminalWindowListener
- Returns:
- Mark allowed.
 
- getCursorXpublic int getCursorX()Gets the cursor X.
- getCursorYpublic int getCursorY()Gets the cursor X.
- getInsertModepublic boolean getInsertMode()Gets the insert mode.
- getAttributespublic int[] getAttributes()Gets the attributes for direct manipulation of underlines.