public abstract class VirtualControl extends Object implements PhantomControlType, VirtualInterface, VirtualTooltipInterface, VirtualClientMessages, VirtualChangeEvent, NetPhantomConstants
It also supports the basic methods in the VirtualInterface, such as
setting and getting the text (if the extending control supports text), font, enabled
and visible states, etc.
CTRLTYPE_BUTTON, CTRLTYPE_CHECK, CTRLTYPE_COMBO, CTRLTYPE_FRAME, CTRLTYPE_GRAPH, CTRLTYPE_GROUP, CTRLTYPE_INOUT, CTRLTYPE_LIST, CTRLTYPE_MLE, CTRLTYPE_NOTE, CTRLTYPE_OUT, CTRLTYPE_RADIO, CTRLTYPE_RECT, CTRLTYPE_SPIN, CTRLTYPE_SUB, CTRLTYPE_TEXT, CTRLTYPE_TREE, CTRLTYPE_UNKNOWN, CTRLTYPE_USER, CTRLTYPES_COUNT, namesTOOLTIP_TEXTACTION_CLOSEWINDOW, ACTION_CONTROL, ACTION_HOSTKEY, ACTION_MENU, ACTION_NONE, ACTION_NOTEBOOKPAGE, ACTION_POPUPMENU, CC_BACKGROUND, CC_BOTH, CC_FOREGROUND, CC_NONE, CLIPBOARD_GET, CLIPBOARD_SET, DATEF_DMY, DATEF_MDY, DATEF_SYSTEM, DATEF_YMD, DDE_ADVISE, DDE_EXECUTE, DDE_INITIATE, DDE_POKE, DDE_REQUEST, DDE_TERMINATE, DDE_UNADVISE, DDE_UPDATE, DDEVAR_DISABLE, DDEVAR_ENABLE, DDEVAR_REQUEST, DDEVAR_SET, DDEVAR_VALIDATE, EFT_AMOUNT, EFT_DATE, EFT_DATEAMOUNT, EFT_NORMAL, EFT_PASSWORD, EVENT_CHAR, EVENT_CHECK, EVENT_CLICK, EVENT_COMMAND, EVENT_DBLCLICK, EVENT_DDECONNECTION, EVENT_DDEDATA, EVENT_DDEERROR, EVENT_DDEEXECUTE, EVENT_DDEINVALIDATE, EVENT_DDEPOKE, EVENT_DDEREQUEST, EVENT_DEFOCUS, EVENT_FOCUS, EVENT_PAGEDOWN, EVENT_PAGEUP, EVENT_SELECT, EVENT_UNKNOWN, EVENT_USERCHANGE, EXTENDEDINFO_IDS_TO_CLIENT, FOCUSTYPE_CLIENTTARGET, FOCUSTYPE_CONTROL, FOCUSTYPE_NONE, ICON_CRITICAL, ICON_INFORMATION, ICON_NOICON, ICON_QUERY, ICON_WARNING, J_AUTO, J_BOTTOM, J_BOTTOMLEFT, J_BOTTOMRIGHT, J_CENTER, J_LEFT, J_RIGHT, J_TOP, J_TOPLEFT, J_TOPRIGHT, MAX_PANELS_PER_SESSION, MAX_SESSIONS, MB_ABORTRETRYIGNORE, MB_CANCEL, MB_ENTER, MB_ENTERCANCEL, MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL, MBID_CANCEL, MBID_DEFAULT, MBID_ENTER, MBID_IGNORE, MBID_NO, MBID_OK, MBID_RETRY, MBID_YES, MS_MOVE, MS_NONE, MS_SIZE, NETPHANTOM_COPYRIGHT, NETPHANTOM_COPYRIGHT2, NETPHANTOM_VERSION, OBJEVENT_CHECK, OBJEVENT_CLICK, OBJEVENT_DBLCLICK, OBJEVENT_DEFOCUS, OBJEVENT_FOCUS, OBJEVENT_SELECT, OBJEVENT_USERCHANGE, PANELCREATE_APPPANEL, PANELCREATE_DANGLINGPANEL, PANELCREATE_DLGFRAME, PANELCREATE_EXTENDEDINFO, PANELCREATE_ICON, PANELCREATE_INDIVIDUALSIZE, PANELCREATE_POPUP, REPLYTYPE_CLIENTEXECUTE, REPLYTYPE_CLIPBOARD, REPLYTYPE_DDE, REPLYTYPE_FFONTLIST, REPLYTYPE_MESSAGEBOX, REPLYTYPE_REPORT, REPLYTYPE_SAVEPROPS, REPLYTYPE_TERMMARK, RPRT_CANCELPRINTJOB, RPRT_CLOSEPRINTJOB, RPRT_CONTPRINTJOB, RPRT_OPENPRINTJOB, RPRT_PRINTJOBCANCLD, RPRT_PRINTJOBCLOSED, RPRT_PRINTJOBCONT, RPRT_PRINTJOBOPENED, RPRT_PRINTJOBSTARTED, RPRT_STARTPRINTJOB, SELMODE_NORMAL, SELMODE_NOTALLOWED, SELMODE_REQUIRED, SELTYPE_MULTIPLE, SELTYPE_SINGLE, SEPARATOR, SEPARATORCHAR, TRANS_APPLICATIONCHANGE, TRANS_CALLOBJECT, TRANS_CANCELEXIT, TRANS_CLEARLOCK, TRANS_CLIENTEXECUTE, TRANS_CLIENTJARS, TRANS_CLIENTTEXTTABLE, TRANS_CLIENTUPDATED, TRANS_CLIENTUPDATEDNOLOCK, TRANS_CLIPBOARD, TRANS_CLIPBOARDCOMPONENT, TRANS_CLOSETERMINALWINDOW, TRANS_CONNECTIONREFUSED, TRANS_COUNTRYINFO, TRANS_CREATEPANEL, TRANS_CREATESESSION, TRANS_DDE, TRANS_DDEEVENT, TRANS_DDEEVENTREPLY, TRANS_DDEVAREVENT, TRANS_DISPLAYHELP, TRANS_DISPLAYTERMINAL, TRANS_DISPLAYTOOLTIPS, TRANS_ENDCONVERSATION, TRANS_EXIT, TRANS_FONTSUBSTITUTION, TRANS_HOSTCOLORTABLE, TRANS_HOSTPRINT, TRANS_HWND, TRANS_INACTIVESESSION, TRANS_INITIATE, TRANS_KEEPALIVE, TRANS_LOCALE, TRANS_LOGEVENT, TRANS_MESSAGEBOX, TRANS_MESSAGEBOXWITHREPLY, TRANS_MODALREPLY, TRANS_MULTTERM, TRANS_PING, TRANS_PRINTCOMPONENT, TRANS_PRINTPANEL, TRANS_PRINTREPORT, TRANS_PRTWINKEY, TRANS_RECONNECT, TRANS_REDIRECTION, TRANS_REMOVEPANELATLEVEL, TRANS_REMOVETERMINAL, TRANS_RENEGOTIATESSL, TRANS_REQUESTHELP, TRANS_RESOURCEURL, TRANS_SELECTSESSION, TRANS_SESSIONACTIVE, TRANS_SESSIONSELECTED, TRANS_SETCOLORS, TRANS_SETFOCUS, TRANS_SETLOCK, TRANS_SETPANELNESTLEVEL, TRANS_SETUPPARAMS, TRANS_SHOWDOCUMENT, TRANS_SOCKET, TRANS_SOUNDALARM, TRANS_STARTUPINFO, TRANS_STOPSESSION, TRANS_TERMINALDATA, TRANS_TERMINALUPDATE, TRANS_TERMINALWINDOW, TRANS_TERMWINTEXT, TRANS_UPDATEAPPLICATION, TRANS_UPDATEPANEL, TRANS_USEREXITPRTKEY, TRANSACTION_VERSION, TS_CLOSE, TS_DATA, TS_ERROR, TS_OPEN, VSIGN_MINUS, VSIGN_NONE, VSIGN_PLUSMINUS, YEARF_6DIG, YEARF_8DIG, YEARF_EXP8| Constructor and Description |
|---|
VirtualControl(VirtualPanel panel,
PhantomControl pc)
This constructor must be called from any derived classes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendCreateTransaction(Transaction trans)
Appends the create transaction data that all controls must do.
|
static void |
appendFieldCheckTransaction(Transaction trans,
int fieldType,
boolean isDirectChecked,
boolean isProtected)
Appends the field check transaction.
|
static void |
appendFontTransaction(Transaction trans,
int font)
This static method can be used to add the font transaction to the
client.
|
void |
appendUpdateTransaction(Transaction trans)
Appends the update transaction data that all controls must do.
|
boolean |
areTextPromptsAlwaysRefreshed()
If the class has a need to refresh the text prompt at all host
changed, it must reply
true to this method call. |
boolean |
callControl()
"Calls" the control in question.
|
String |
callObject(int action,
String argString)
Calls the control's object (if defined).
|
String |
callObject(String controlID,
int action,
String argString)
Calls the control's object (if defined).
|
abstract void |
clientUpdated(Transaction trans)
This method is called from the VirtualPanel
to cause a client transaction to update the panels.
|
boolean |
deleteAll()
Deletes all lines in a list capable control.
|
boolean |
deleteLine(int line)
Deletes a line in a list capable control.
|
void |
dispose()
This method is called whenever a panel has been disposed of,
in order to remove listeners, etc, in order to free up memory.
|
void |
fireCreate(Transaction trans)
This method is used to fire a create message to the client by
a virtual class.
|
void |
fireUpdate(Transaction trans)
This method is used to fire an update message to the client by
a virtual class.
|
int |
getBackgroundColor()
Gets the background color of an item.
|
PhantomControl |
getBasicData()
Get the basic Phantom-data for this control.
|
String |
getCell(int col,
int line)
Gets a single cell in a list capable control.
|
ClientSessionInterface |
getClientSession()
Gets the client session.
|
se.entra.phantom.geditor.NPPColor |
getColor()
Get color of an item.
|
Object |
getComponentLockObject()
Gets the lock object for synchronization for Control Components.
|
VirtualControl |
getControlConnectedToHost(PhantomHostScreen screen,
PhantomHostField hostField,
int flags)
Check if control is connected to host field.
|
String |
getControlID()
Get the controls ID or null if none.
|
ControlIDHostFieldID |
getControlIDHostFieldID()
Gets the control ID and a possible host field ID.
|
int |
getControlType()
Gets the control type (PhantomControlType.CTRLTYPE_*).
|
HostSession |
getCurrentHostSession()
Gets the current host session.
|
protected int |
getExtraUpdateFlags()
Gets the extra flags used for the update transaction.
|
int |
getFont()
Gets the font index of an item.
|
int |
getForegroundColor()
Gets the foreground color of an item.
|
PhantomHostField |
getHostField(PhantomHostField hostField,
String hostFieldName)
Resolves the reference to a host field.
|
String |
getID()
Gets the ID of this control.
|
int |
getIndex()
Gets the index of this control.
|
int |
getLength()
Gets the control length.
|
String |
getLine(int line)
Sets a line in a list capable control.
|
int |
getLineCount()
Gets the line count for a list capable control.
|
int |
getNextSelection(int line)
Gets the next selected line in a list capable control.
|
PhantomObject |
getObject()
Gets the object of the control.
|
VirtualPanel |
getPanel()
Gets the virtual panel where the control is a child.
|
VirtualControl |
getPreviousConnectedControl()
Gets the previous connected control.
|
Object |
getProperty(String propertyName)
Gets a property of a virtual component.
|
VirtualControl |
getSelectableControl(int flags)
Check if this control can receive focus (is selectable).
|
String |
getText()
Gets the text of an item.
|
VirtualTextData |
getTextData()
Gets the text data instance.
|
String |
getTooltipText()
Gets the tool tip text of this component.
|
VirtualSessionManager |
getVirtualSessionManager()
Gets the VirtualSessionManager instance.
|
boolean |
hasChanged()
Checks if the base control data with possible text data has changed.
|
void |
hostScreenChanged(PhantomHostScreen screen)
The connected host screen has changed.
|
boolean |
insertLine(String data,
int line)
Inserts a line in a list capable control.
|
int |
isChecked()
Gets the check state of a control (e.g.
|
boolean |
isConnectToNextControlPropertySet()
Override this method and return true if you're a static text or a group box.
|
boolean |
isDirectChecked()
Is characters direct checked.
|
boolean |
isEnabled()
Gets the enabled state of an item.
|
boolean |
isNewGroup()
Checks if this control is the start of a new group of controls.
|
abstract void |
issueAction(Transaction trans)
Every virtual control could be updated with data from the client.
|
void |
issueControlAction(int actionEvent,
Transaction trans,
VirtualHostField hostField)
This method is invoked by the server kernel when an event has occurred
on the client side (such as a push button has been pressed).
|
boolean |
isTabSkipped()
Checks if tab stop should be skipped for this control.
|
boolean |
isVisible()
Gets the visibility state of an item.
|
static int |
parseRuntimeFont(int font)
Get/parse font from old style runtime file into multi functional integer.
|
void |
refresh()
This method is used to refresh all virtual controls when e.g.
|
void |
refreshTextPrompts()
This method is used to refresh all virtual classes that have
text prompt data in them.
|
void |
refreshTextPrompts(boolean alwaysRefresh)
Refreshes the text prompts, but with a flag indicating the text prompts
always needs to be updated, due to a panel that is created or recreated.
|
void |
requestFocus()
Requests focus for the control.
|
boolean |
selectField()
Performs a visual selection of the field.
|
boolean |
setBackgroundColor(int colorIndex)
Sets the background color of an item.
|
boolean |
setCell(int col,
int line,
String data)
Sets a single cell in a list capable control.
|
void |
setChanged()
This method is used to indicate that a virtual class has changed and that it
needs to update the client.
|
boolean |
setChecked(int state)
Sets the check state of a control (e.g.
|
boolean |
setColor(se.entra.phantom.geditor.NPPColor newcolor)
Set the color of an item.
|
boolean |
setEnabled(boolean state)
Sets the enabled state of an item.
|
boolean |
setFileFromList(PhantomOutputFile pFile)
Insert the contents of a list into a file.
|
boolean |
setFocus()
Sets focus in the panel to this item.
|
boolean |
setFocus(PhantomHostFieldLocation hostFieldLocation)
Sets focus in the panel to this item according
to a host field location.
|
boolean |
setFont(int font)
Sets the font index of an item.
|
boolean |
setForegroundColor(int colorIndex)
Sets the foreground color of an item.
|
boolean |
setLength(int length)
Sets the control length.
|
boolean |
setLine(String data,
int line)
Sets a line in a list capable control.
|
boolean |
setListFromFile(String fileName)
Sets the contents of a list capable control from a file.
|
boolean |
setProperty(String propertyName,
Object property)
Sets a property of a virtual component.
|
boolean |
setSelection(int line,
boolean select)
Sets a line as selected (or not) in a list capable control.
|
boolean |
setText(String text)
Sets the text of an item.
|
boolean |
setTooltipText(String text)
Sets the tool tip text to a value for this component.
|
void |
setupControlIDObject(String controlID,
PhantomObject object)
Sets up a control ID and the object reference.
|
void |
setVirtualText(VirtualTextData td)
Assigns a class that handles text data, e.g.
|
boolean |
setVisible(boolean state)
Sets the visibility state of an item.
|
void |
textFileChanged()
Text file is changed.
|
public VirtualControl(VirtualPanel panel, PhantomControl pc)
public Object getComponentLockObject()
public void dispose()
public void setupControlIDObject(String controlID, PhantomObject object)
public VirtualTextData getTextData()
public VirtualPanel getPanel()
public VirtualSessionManager getVirtualSessionManager()
public void setVirtualText(VirtualTextData td)
public void requestFocus()
public boolean setProperty(String propertyName, Object property)
setProperty in interface VirtualInterfacepublic boolean setTooltipText(String text)
setTooltipText in interface VirtualTooltipInterfacepublic String getTooltipText()
getTooltipText in interface VirtualTooltipInterfacepublic Object getProperty(String propertyName)
getProperty in interface VirtualInterfacepublic boolean setText(String text)
setText in interface VirtualInterfacepublic String getText()
getText in interface VirtualInterfacepublic boolean setEnabled(boolean state)
setEnabled in interface VirtualInterfacepublic boolean isEnabled()
isEnabled in interface VirtualInterfacepublic boolean setVisible(boolean state)
setVisible in interface VirtualInterfacepublic boolean isVisible()
isVisible in interface VirtualInterfacepublic boolean setColor(se.entra.phantom.geditor.NPPColor newcolor)
setColor in interface VirtualInterfacepublic se.entra.phantom.geditor.NPPColor getColor()
getColor in interface VirtualInterfacepublic boolean setForegroundColor(int colorIndex)
setForegroundColor in interface VirtualInterfacepublic int getForegroundColor()
getForegroundColor in interface VirtualInterfacepublic boolean setBackgroundColor(int colorIndex)
setBackgroundColor in interface VirtualInterfacepublic int getBackgroundColor()
getBackgroundColor in interface VirtualInterfacepublic boolean setFont(int font)
setFont in interface VirtualInterfacepublic int getFont()
getFont in interface VirtualInterfacepublic boolean setFocus()
setFocus in interface VirtualInterfacepublic boolean setFocus(PhantomHostFieldLocation hostFieldLocation)
setFocus.setFocus in interface VirtualInterfacesetFocus()public boolean selectField()
selectField in interface VirtualInterfacepublic int getLength()
getLength in interface VirtualInterfacepublic boolean setLength(int length)
setLength in interface VirtualInterfacepublic boolean setChecked(int state)
setChecked in interface VirtualInterfacepublic int isChecked()
isChecked in interface VirtualInterfacepublic int getLineCount()
getLineCount in interface VirtualInterfacepublic boolean insertLine(String data, int line)
insertLine in interface VirtualInterfacepublic boolean setLine(String data, int line)
setLine in interface VirtualInterfacepublic String getLine(int line)
getLine in interface VirtualInterfacepublic boolean deleteLine(int line)
deleteLine in interface VirtualInterfacepublic boolean deleteAll()
deleteAll in interface VirtualInterfacepublic boolean setCell(int col,
int line,
String data)
setCell in interface VirtualInterfacecol - The column for the cell.line - The line for the column.data - The data for the cell.public String getCell(int col, int line)
getCell in interface VirtualInterfacecol - The column for the cell.line - The line for the column.public boolean setSelection(int line,
boolean select)
setSelection in interface VirtualInterfacepublic int getNextSelection(int line)
getNextSelection in interface VirtualInterfacepublic boolean setFileFromList(PhantomOutputFile pFile)
setFileFromList in interface VirtualInterfacepublic boolean setListFromFile(String fileName) throws IOException
setListFromFile in interface VirtualInterfacefileName - the file name.IOException - for file failures.public boolean callControl()
If a control supports being called, it must override this method and return true.
callControl in interface VirtualInterfacepublic void setChanged()
setChanged in interface VirtualChangeEventpublic boolean hasChanged()
The text change flag is not checked in this method, the control subclassing this class is responsible to call "setChanged()" whenever any child component of the virtual control has changed. This will guarantee that the entire chain of components, even upwards in the tree will synchronize the client panels and components.
hasChanged in interface VirtualChangeEventpublic void refresh()
refresh in interface VirtualClientMessagespublic void refreshTextPrompts()
mustRefresh
is set when the panel is created or recreated. If the class has
a need to refresh the text prompt at all host changed, it must
reply true to the method call
areTextPromptsAlwaysRefreshed.
Override this method if other text prompts than the registered one can change.
refreshTextPrompts in interface VirtualClientMessagespublic void refreshTextPrompts(boolean alwaysRefresh)
public boolean areTextPromptsAlwaysRefreshed()
true to this method call.
Otherwise return false.
A class extending VirtualControl have to override this method and return true if the text prompts need a constant refresh.
areTextPromptsAlwaysRefreshed in interface VirtualClientMessagespublic void hostScreenChanged(PhantomHostScreen screen)
All controls extending from VirtualControl must override this method for it's own host field processing if this is required.
public void fireCreate(Transaction trans)
fireCreate in interface VirtualClientMessagespublic void fireUpdate(Transaction trans)
fireUpdate in interface VirtualClientMessagespublic void appendCreateTransaction(Transaction trans)
protected int getExtraUpdateFlags()
public void appendUpdateTransaction(Transaction trans)
public static void appendFontTransaction(Transaction trans, int font)
public static int parseRuntimeFont(int font)
public static void appendFieldCheckTransaction(Transaction trans, int fieldType, boolean isDirectChecked, boolean isProtected)
The following data is sent:
+ BYTE (bit 0-5: field type, bit 6: protected=not editable, bit 7: isDirectChecked).
public VirtualControl getPreviousConnectedControl()
public boolean isConnectToNextControlPropertySet()
public int getIndex()
public abstract void clientUpdated(Transaction trans)
trans - A transaction that is already being processed.public abstract void issueAction(Transaction trans)
Override this method in order to process controls that can carry actions from the client.
trans - A transaction that is already being processed.public final void issueControlAction(int actionEvent,
Transaction trans,
VirtualHostField hostField)
public String callObject(int action, String argString)
public String callObject(String controlID, int action, String argString)
public HostSession getCurrentHostSession()
public ClientSessionInterface getClientSession()
public PhantomHostField getHostField(PhantomHostField hostField, String hostFieldName)
public void textFileChanged()
textFileChanged in interface VirtualClientMessagespublic VirtualControl getControlConnectedToHost(PhantomHostScreen screen, PhantomHostField hostField, int flags)
public VirtualControl getSelectableControl(int flags)
public String getControlID()
public int getControlType()
public ControlIDHostFieldID getControlIDHostFieldID()
public boolean isTabSkipped()
public boolean isDirectChecked()
public boolean isNewGroup()
true if this is a new group, false otherwise.public PhantomObject getObject()
null if no object is assigned,
otherwise the assigned PhantomObject.public String getID()
null for none.public PhantomControl getBasicData()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.