Package com.iizigo.term.prop
Class TerminalDesignerProp
- java.lang.Object
- com.iizigo.prop.DesignerProp
- com.iizigo.term.prop.TerminalDesignerProp
- All Implemented Interfaces:
INavigatorPresentation
,EventListener
,HostSessionListener
,HostSessionOwner
,org.eclipse.core.runtime.IAdaptable
public class TerminalDesignerProp extends DesignerProp implements HostSessionOwner
Class for the EditorScreenProp in the designer.- Author:
- Christopher Mindus
Field Summary
Fields inherited from class com.iizigo.prop.DesignerProp
DESIGNER_PROPERTY, isFolder, isRoot, moveDownProperty, moveUpProperty, OP_COPY, OP_DELETE, OP_MOVE, propertyContainer
Fields inherited from interface com.iizigo.navigator.INavigatorPresentation
CN_PREFERENCE_FLAGS_NAME, DEFAULT_COMPARATOR, EMPTY_ARRAY, FLAG_ADD_FILE_ITEM_PACKAGE_LOCATION, FLAG_ADD_FILE_ITEM_PROJECT, FLAG_ADD_FOLDER_PACKAGE_LOCATION, FLAG_ADD_FOLDER_PROJECT, FLAG_CUSTOM_1, FLAG_CUSTOM_2, FLAG_CUSTOM_3, FLAG_JAVA_SUPPORT, FLAG_PACKAGE_VIEW, FLAG_SHOW_DESIGNER_PROPERTIES, FLAG_SHOW_EMPTY_MODULE_FOLDERS, FLAG_SHOW_EMPTY_PACKAGES, FLAG_SHOW_FILE_ITEMS, FLAG_SHOW_SUBPROPERTIES, FLAGS_NORMAL, FLAGS_ONLY_FOLDERS
Constructor Summary
Constructors Constructor Description TerminalDesignerProp(PropCnr propertyContainer)
The constructor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.widgets.Composite
createCNToolTip(org.eclipse.swt.widgets.Event event, org.eclipse.jface.viewers.ViewerCell cell, org.eclipse.swt.widgets.Composite parent)
Creates a small tooltip composite for terminal preview, if possible.HostSession
createHostSession()
Creates a HostSession if not already created.protected void
dispose()
Dispose.java.lang.Object[]
getCNChildren(int flags)
Gets the children of this container for Common Navigator.java.lang.String
getCNDescriptionType()
Provide a type description for the status bar view, if available.org.eclipse.swt.graphics.Image
getCNImage(int flags)
Gets the image for the Common Navigator.java.lang.String
getCNText(int flags)
Gets the label text for the Common Navigator.java.lang.String
getCNText(int columnIndex, int flags)
Gets the label text for the Common Navigator.org.eclipse.swt.graphics.Point
getCNToolTipShift(org.eclipse.jface.viewers.ViewerCell cell)
Return the amount of pixels in x and y direction you want the tool tip to pop up from the mouse pointer.int
getCNToolTipTimeDisplayed(org.eclipse.jface.viewers.ViewerCell cell)
The time in milliseconds the tool tip is shown for.HostSession
getHostSession()
Gets the host session instance.EditorScreenProp[]
getMatchingScreens()
Gets the matching screens.protected PropertyEditorSetup
getPropertyEditorSetup()
Gets the edit setup.SessionInfo
getSessionInfo()
Gets the SessionInfo.TerminalModule
getTerminalModule()
Gets the TerminalModule instance for this project.Worker
getWorker()
Gets the worker of the session.boolean
hasCNToolTip(org.eclipse.jface.viewers.ViewerCell cell)
Checks for Common Navigator tool-tip for this item.boolean
isConnectEnabled()
Checks if session is connectable.boolean
isDisconnectEnabled()
Checks if session is disconnectable.boolean
isResumeEnabled()
Checks if session can be resumed.boolean
isSuspendEnabled()
Checks if session can be suspended.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.int
onHostDataStreamProcessing(HostSessionPeer peer, boolean isEntering)
Called when the datastream enters or exits processing.void
onHostDataStreamProcessing(HostSessionPeer peer, boolean isEntering, int updates)
N/A.void
onHostPrintPage(HostSessionPeer peer)
Called when a host printer needs printing of a new page.void
onScreenChange(HostSessionPeer peer, int beginPos, int endPos)
Notifies the session of a screen change.void
onScreenChanged(EditorScreenProp screen, boolean isRemoved)
Method to refresh the matching screens when one has been changed.void
onScreenSizeChange(HostSessionPeer peer, int cx, int cy)
Notifies the session that the screen size has changed.void
onSessionFailure(HostSessionPeer peer, java.lang.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).boolean
printSession(HostSessionPeer peer)
Called when the host (mainframe) has issued a Print Session (Print Local Copy).void
soundAlarm(HostSessionPeer peer)
Sound alarm on the client.Methods inherited from class com.iizigo.prop.DesignerProp
addCommandContributionItem, addContextMenuItems, addContextMenuItems, addContextMenuItems, addMarker, appendCNStyledTextAdditions, appendTooltipPropErrors, appendTooltipPropErrors, canPerform, clearPropErrorMarkers, createCNToolTip, createCNToolTip0, createCNToolTipItemList, createFileErrorAtom, createImageDefinitions, doSortIndexOnCategories, firePropertyUpdateViewerEvent, getAdapter, getCNBackground, getCNBackground, getCNBackground0, getCNCategory, getCNComparator, getCNDescription, getCNDescription, getCNDescription0, getCNForeground, getCNForeground, getCNForeground0, getCNImage, getCNImage, getCNImage, getCNImage0, getCNImage0, getCNParent, getCNParent, getCNRealProp, getCNStyledText, getCNStyledText, getCNStyledText0, getCNText, getCNText, getCNText0, getCNText0, getCNToolTipDisplayDelayTime, getCNToolTipDisplayDelayTime, getCNToolTipDisplayDelayTime0, getCNToolTipShift, getCNToolTipShift0, getCNToolTipTimeDisplayed, getCNToolTipTimeDisplayed0, getContextMenuItems, getDataDesignerProp, getErrorSeverity, getException, getFolder, getFolderProp, getIEditorFileActions, getInstance, getInstance, getIResource, getJavaProject, getMarkers, getModel, getModificationStamp, getParent, getParentFolderProp, getProject, getPropCnr, getRoot, getSubPropertyName, getTransferDefaultPasteAllowed, getUndoContextFromTree, hasCNChildren, hasCNToolTip, hasCNToolTip0, hasMarkerID, hasNamingError, isBeforeAfterDropTarget, isCNVisible, isCNVisible0, isDesignerLoaded, isDesignerMoved, onEvent, onPropErrorChanged, paste, pasteProperties, processQuery, rebuildPropErrorMarkers, removeFileErrors, removeMarkers, setDesignerLoaded, setDesignerMoved, setException, setIEditorFileActions, setIResource, setIResource, setModificationStamp, setTransferDefaultPasteAllowed, toString, updateFolderResources, validateClasses, validateResouce
Constructor Detail
TerminalDesignerProp
public TerminalDesignerProp(PropCnr propertyContainer)
The constructor.- Parameters:
propertyContainer
- The property container.
Method Detail
getTerminalModule
public TerminalModule getTerminalModule()
Gets the TerminalModule instance for this project.- Returns:
- The terminal module.
getPropertyEditorSetup
protected PropertyEditorSetup getPropertyEditorSetup()
Gets the edit setup.- Overrides:
getPropertyEditorSetup
in classDesignerProp
dispose
protected void dispose()
Dispose.- Overrides:
dispose
in classDesignerProp
getCNChildren
public java.lang.Object[] getCNChildren(int flags)
Gets the children of this container for Common Navigator.- Specified by:
getCNChildren
in interfaceINavigatorPresentation
- Overrides:
getCNChildren
in classDesignerProp
- Parameters:
flags
- The flags: FLAG_PACKAGE_VIEW, FLAG_SHOW_EMPTY_MAIN_FOLDER, FLAG_SHOW_EMPTY_PACKAGES, FLAG_SHOW_FILE_ITEMS, FLAG_SHOW_DESIGNER_PROPERTIES and FLAG_SHOW_SUBPROPERTIES are relevant.- Returns:
- An array of children objects or EMPTY_ARRAY for none.
getCNImage
public org.eclipse.swt.graphics.Image getCNImage(int flags)
Gets the image for the Common Navigator.- Specified by:
getCNImage
in interfaceINavigatorPresentation
- Overrides:
getCNImage
in classDesignerProp
- Parameters:
flags
- The flags for the image, see FLAG_IMAGE_*.- Returns:
- Image or
null
if there is no image.
getCNText
public java.lang.String getCNText(int flags)
Gets the label text for the Common Navigator.- Specified by:
getCNText
in interfaceINavigatorPresentation
- Overrides:
getCNText
in classDesignerProp
- Returns:
- String or or
null
if there is no text.
getCNDescriptionType
public java.lang.String getCNDescriptionType()
Provide a type description for the status bar view, if available.- Overrides:
getCNDescriptionType
in classDesignerProp
- Returns:
- A type description for the status bar view, or null if not available.
getCNText
public java.lang.String getCNText(int columnIndex, int flags)
Gets the label text for the Common Navigator.- Specified by:
getCNText
in interfaceINavigatorPresentation
- Overrides:
getCNText
in classDesignerProp
- Parameters:
columnIndex
- The zero-based index for the column (zero is never used, the method getCNText() is called instead.- Returns:
- String or or
null
if there is no text for the given object at columnIndex.
createHostSession
public HostSession createHostSession() throws java.io.IOException
Creates a HostSession if not already created.- Returns:
- The existing or created host session.
- Throws:
java.io.IOException
- For failures when creating SSL engine.
getHostSession
public HostSession getHostSession()
Gets the host session instance.- Returns:
- The host session, null if none is created.
getMatchingScreens
public EditorScreenProp[] getMatchingScreens()
Gets the matching screens.- Returns:
- The array of matching screens, never null.
onScreenChanged
public void onScreenChanged(EditorScreenProp screen, boolean isRemoved)
Method to refresh the matching screens when one has been changed.- Parameters:
screen
- The changed screen or null for all.isRemoved
- Flag for screen has been removed.
onHostDataStreamProcessing
public int onHostDataStreamProcessing(HostSessionPeer peer, boolean isEntering)
Called when the datastream enters or exits processing. This enables the owner to "group" multiple notification events together.- Specified by:
onHostDataStreamProcessing
in interfaceHostSessionOwner
- Parameters:
peer
- The peer.isEntering
- Flag for entering or exiting.- Returns:
- Bit flags 0x01 = characters changed, 0x02=fields changed.
onHostPrintPage
public void onHostPrintPage(HostSessionPeer peer)
Called when a host printer needs printing of a new page.- Specified by:
onHostPrintPage
in interfaceHostSessionOwner
- Parameters:
peer
- The peer.
printSession
public boolean printSession(HostSessionPeer peer)
Called when the host (mainframe) has issued a Print Session (Print Local Copy).- Specified by:
printSession
in interfaceHostSessionOwner
- Parameters:
peer
- The peer.- Returns:
- true for success, false for cancel.
getWorker
public Worker getWorker() throws java.io.IOException
Gets the worker of the session.- Specified by:
getWorker
in interfaceHostSessionOwner
- Returns:
- The worker.
- Throws:
java.io.IOException
- For error when getting the worker.
getSessionInfo
public SessionInfo getSessionInfo()
Gets the SessionInfo.- Specified by:
getSessionInfo
in interfaceHostSessionOwner
- Returns:
- The session info, never null.
onScreenChange
public void onScreenChange(HostSessionPeer peer, int beginPos, int endPos)
Notifies the session of a screen change.- Specified by:
onScreenChange
in interfaceHostSessionListener
onFieldChange
public void onFieldChange(HostSessionPeer peer)
Notifies the session that fields have changed.- Specified by:
onFieldChange
in interfaceHostSessionListener
onScreenSizeChange
public void onScreenSizeChange(HostSessionPeer peer, int cx, int cy)
Notifies the session that the screen size has changed.- Specified by:
onScreenSizeChange
in interfaceHostSessionListener
onCursorPositionChange
public void onCursorPositionChange(HostSessionPeer peer, int x, int y)
Notifies the session that the cursor position has changed.- Specified by:
onCursorPositionChange
in interfaceHostSessionListener
onConnectChange
public void onConnectChange(HostSessionPeer peer, boolean connected)
Notifies the session of a connect state change.- Specified by:
onConnectChange
in interfaceHostSessionListener
onStateChange
public void onStateChange(HostSessionPeer peer)
Notifies the session of a state change (such as insert mode, lock state, error state).- Specified by:
onStateChange
in interfaceHostSessionListener
onSessionFailure
public void onSessionFailure(HostSessionPeer peer, java.lang.Throwable exception)
Called when a session has had a failure.- Specified by:
onSessionFailure
in interfaceHostSessionListener
onHostDataStreamProcessing
public void onHostDataStreamProcessing(HostSessionPeer peer, boolean isEntering, int updates)
N/A.- Specified by:
onHostDataStreamProcessing
in interfaceHostSessionListener
- 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).
soundAlarm
public void soundAlarm(HostSessionPeer peer)
Sound alarm on the client.- Specified by:
soundAlarm
in interfaceHostSessionListener
isConnectEnabled
public boolean isConnectEnabled()
Checks if session is connectable.- Returns:
- Connectable flag.
isSuspendEnabled
public boolean isSuspendEnabled()
Checks if session can be suspended.- Returns:
- Suspendable flag.
isResumeEnabled
public boolean isResumeEnabled()
Checks if session can be resumed.- Returns:
- Resumable flag.
isDisconnectEnabled
public boolean isDisconnectEnabled()
Checks if session is disconnectable.- Returns:
- The disconnectable flag.
hasCNToolTip
public boolean hasCNToolTip(org.eclipse.jface.viewers.ViewerCell cell)
Checks for Common Navigator tool-tip for this item.- Overrides:
hasCNToolTip
in classDesignerProp
- Parameters:
cell
- The cell (might be in a table), or null for none.
getCNToolTipShift
public org.eclipse.swt.graphics.Point getCNToolTipShift(org.eclipse.jface.viewers.ViewerCell cell)
Return the amount of pixels in x and y direction you want the tool tip to pop up from the mouse pointer. The default shift is 10px right and 0px below your mouse cursor. Be aware of the fact that you should at least position the tool tip 1px right to your mouse cursor else click events may not get propagated properly.- Overrides:
getCNToolTipShift
in classDesignerProp
- Parameters:
cell
- The cell (might be in a table), or null for none.- Returns:
Point
to shift of the tool tip ornull
if the default shift should be used.
getCNToolTipTimeDisplayed
public int getCNToolTipTimeDisplayed(org.eclipse.jface.viewers.ViewerCell cell)
The time in milliseconds the tool tip is shown for.- Overrides:
getCNToolTipTimeDisplayed
in classDesignerProp
- Parameters:
cell
- The cell (might be in a table), or null for none.- Returns:
- Time in milliseconds the tool tip is shown for, -1 for default.
createCNToolTip
public org.eclipse.swt.widgets.Composite createCNToolTip(org.eclipse.swt.widgets.Event event, org.eclipse.jface.viewers.ViewerCell cell, org.eclipse.swt.widgets.Composite parent)
Creates a small tooltip composite for terminal preview, if possible.- Overrides:
createCNToolTip
in classDesignerProp
- Parameters:
event
- Event triggering the tooltip (mouse hover).cell
- The cell (might be in a table).parent
- The parent composite.- Returns:
- The created composite in the parent.