public class VirtualMenuItem extends Object implements VirtualInterface, VirtualTooltipInterface, VirtualClientMessages, VirtualChangeEvent, ObjectMessages
Modifier and Type | Field and Description |
---|---|
static String[] |
actionKeys
The action key texts.
|
static int |
AKEY_ALT
Alt control bit.
|
static int |
AKEY_CTRL
Control key bit.
|
static int |
AKEY_MASK
The key value mask.
|
static int |
AKEY_SHIFT
Shift key bit.
|
protected int |
connectedControlIndex
The connected control index.
|
protected PhantomHostField |
hostField
The virtual host field where e.g.
|
protected HostScreen |
hostScreen
The host screen.
|
protected PhantomMenuItem |
menuItem
The menu item data.
|
protected VirtualChangeEvent |
owner
The owner of this pull-down menu (the pull-down menu or the pop-up menu).
|
protected VirtualPanel |
panel
The virtual panel.
|
protected VirtualInterface |
parent
The parent VirtualPullDownMenu, VirtualMenuItem,
VirtualPopupMenu or VirtualPopupMenuItem.
|
protected VirtualTextPrompt |
textData
The virtual text data.
|
TOOLTIP_TEXT
OBJACT_CHAR, OBJACT_CHECK, OBJACT_CLICK, OBJACT_CLOSE, OBJACT_COMMAND, OBJACT_CREATE, OBJACT_DBLCLICK, OBJACT_DDECONNECTION, OBJACT_DDEDATA, OBJACT_DDEERROR, OBJACT_DDEEXECUTE, OBJACT_DDEPOKE, OBJACT_DDEREQUEST, OBJACT_DDEVALIDATE, OBJACT_DEFOCUS, OBJACT_DESTROY, OBJACT_FOCUS, OBJACT_HIDDEN, OBJACT_HOSTCHANGE, OBJACT_LAST_MESSAGE_HANDLED, OBJACT_QUERYMSG, OBJACT_RECREATE, OBJACT_SELECT, OBJACT_SHOW, OBJACT_START, OBJACT_TRANSLATE, OBJACT_USERCHANGE, PHA_ICO_INFO, PHA_ICO_NOICON, PHA_ICO_QUESTION, PHA_ICO_STOP, PHA_ICO_WARNING, PHA_MSG_CANCEL, PHA_MSG_ENTER, PHA_MSG_ENTERCANCEL, PHA_MSG_OK, PHA_MSG_OKCANCEL, PHA_MSG_RETIGNCANCEL, PHA_MSG_RETRYCANCEL, PHA_MSG_YESNO, PHA_MSG_YESNOCANCEL
Constructor and Description |
---|
VirtualMenuItem(VirtualPanel vp,
VirtualChangeEvent owner,
PhantomMenuItem menuItem)
Creates the pull-down menu with all associated sub-menus
and menu items.
|
Modifier and Type | Method and Description |
---|---|
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).
|
boolean |
deleteAll()
Deletes all lines in a list capable control.
|
boolean |
deleteLine(int line)
Deletes a line in a list capable control.
|
void |
fireCreate(Transaction trans)
Fires the create transaction to the client.
|
protected void |
fireCreate(Transaction trans,
boolean isPopupMenu)
Fires the create transaction to the client.
|
void |
fireUpdate(Transaction trans)
Fires the update transaction to the client.
|
protected void |
fireUpdate(Transaction trans,
boolean isPopupMenu)
Fires the update transaction to the client.
|
int |
getBackgroundColor()
Gets the background color of an item.
|
PhantomMenuItem |
getBasicData()
Gets the menu item basic data.
|
String |
getCell(int col,
int line)
Gets a single cell in a list capable control.
|
se.entra.phantom.geditor.NPPColor |
getColor()
Get color of an item.
|
int |
getFont()
Gets the font index of an item.
|
int |
getForegroundColor()
Gets the foreground color of an item.
|
String |
getID()
Gets the ID of this menu item.
|
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 menu item.
|
VirtualInterface |
getParent()
Gets the parent VirtualPullDownMenu or VirtualMenuItem,
always null for pop-up menus.
|
VirtualPopupMenu |
getPopupMenu()
Gets the pop-up menu that is the owner of this menu item.
|
Object |
getProperty(String propertyName)
Gets a property of a virtual component.
|
VirtualPullDownMenu |
getPullDownMenu()
Gets the pull-down menu that is the owner of this menu item.
|
int |
getSubMenuCount()
Gets the count of menu items in this sub-menu.
|
String |
getText()
Gets the text of an item.
|
String |
getTooltipText()
Gets the tool tip text of this component.
|
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 |
isEnabled()
Gets the enabled state of an item.
|
void |
issueAction(Transaction trans)
This method is invoked by the server kernel whenever this menu item is selected
on the client side.
|
boolean |
isVisible()
Gets the visibility state of an item.
|
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.
|
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 color)
Set the color of an item.
|
boolean |
setEnabled(boolean state)
Sets the enabled state of an item.
|
boolean |
setEnabled(boolean state,
boolean isProgramatic)
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 tooltip text to a value for this component.
|
boolean |
setVisible(boolean state)
Sets the visibility state of an item.
|
void |
textFileChanged()
The application text file has been changed, resulting in the need to
reformat text strings (such as text prompts or send strings from a text ID)
in order to reflect the new text file content.
|
public static final int AKEY_MASK
public static final int AKEY_SHIFT
public static final int AKEY_CTRL
public static final int AKEY_ALT
public static final String[] actionKeys
protected VirtualTextPrompt textData
protected VirtualChangeEvent owner
protected VirtualPanel panel
protected PhantomMenuItem menuItem
protected HostScreen hostScreen
protected PhantomHostField hostField
protected int connectedControlIndex
protected VirtualInterface parent
public VirtualMenuItem(VirtualPanel vp, VirtualChangeEvent owner, PhantomMenuItem menuItem)
public VirtualInterface getParent()
public VirtualPullDownMenu getPullDownMenu()
public VirtualPopupMenu getPopupMenu()
public int getSubMenuCount()
public PhantomMenuItem getBasicData()
public void hostScreenChanged(PhantomHostScreen screen)
public void textFileChanged()
textFileChanged
in interface VirtualClientMessages
public void refresh()
A menu item is disabled if the connected host field is protected or non-display, unless the "Do not disable" option is set.
refresh
in interface VirtualClientMessages
public 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
.refreshTextPrompts
in interface VirtualClientMessages
public boolean areTextPromptsAlwaysRefreshed()
true
to this method call.
Otherwise return false
.areTextPromptsAlwaysRefreshed
in interface VirtualClientMessages
public void fireCreate(Transaction trans)
The following data is sent to the client:
+ STRING textPrompt + BYTE subMenuCount + BYTE bit0=hasSeparator, bit1=isEnabled, bit2=isChecked + SHORT actionKey (if subMenuCount is zero) + SHORT connectedControlIndex (if subMenuCount is zero)
fireCreate
in interface VirtualClientMessages
protected void fireCreate(Transaction trans, boolean isPopupMenu)
The following data is sent to the client:
+ STRING textPrompt + BYTE subMenuCount + BYTE bit0=hasSeparator, bit1=isEnabled, bit2=isChecked + SHORT actionKey (if subMenuCount is zero and isPopupMenu is false) + SHORT connectedControlIndex (if subMenuCount is zero)
public void fireUpdate(Transaction trans)
Prior to calling this method, the parent component or class
should use the method hasChanged()
in order to call
this method only when required.
The following data is sent to the client if the menu item text or state (checked/enabled) has changed.
+ SHORT index of menu item + BYTE bit0=isTextChanged, bit1=isEnabled, bit2=isChecked + STRING if bit0=isTextChanged is set, nothing otherwise
fireUpdate
in interface VirtualClientMessages
protected void fireUpdate(Transaction trans, boolean isPopupMenu)
Prior to calling this method, the parent component or class
should use the method hasChanged()
in order to call
this method only when required.
The following data is sent to the client if the menu item text or state (checked/enabled) has changed.
+ SHORT index of menu item + BYTE bit0=isTextChanged, bit1=isEnabled, bit2=isChecked + STRING if bit0=isTextChanged is set, nothing otherwise + SHORT connectedControlIndex (if subMenuCount is zero and isPopupMenu is false)
public void issueAction(Transaction trans)
public String callObject(int action, String argString)
public PhantomObject getObject()
public String getID()
public boolean setProperty(String propertyName, Object property)
setProperty
in interface VirtualInterface
public boolean setTooltipText(String text)
setTooltipText
in interface VirtualTooltipInterface
public String getTooltipText()
getTooltipText
in interface VirtualTooltipInterface
public Object getProperty(String propertyName)
getProperty
in interface VirtualInterface
public boolean setText(String text)
setText
in interface VirtualInterface
public String getText()
getText
in interface VirtualInterface
public boolean setEnabled(boolean state)
setEnabled
in interface VirtualInterface
public boolean setEnabled(boolean state, boolean isProgramatic)
public boolean isEnabled()
isEnabled
in interface VirtualInterface
public boolean setVisible(boolean state)
setVisible
in interface VirtualInterface
public boolean isVisible()
isVisible
in interface VirtualInterface
public boolean setColor(se.entra.phantom.geditor.NPPColor color)
setColor
in interface VirtualInterface
public se.entra.phantom.geditor.NPPColor getColor()
getColor
in interface VirtualInterface
public boolean setForegroundColor(int colorIndex)
setForegroundColor
in interface VirtualInterface
public int getForegroundColor()
getForegroundColor
in interface VirtualInterface
public boolean setBackgroundColor(int colorIndex)
setBackgroundColor
in interface VirtualInterface
public int getBackgroundColor()
getBackgroundColor
in interface VirtualInterface
public boolean setFont(int font)
setFont
in interface VirtualInterface
public int getFont()
getFont
in interface VirtualInterface
public boolean setFocus()
setFocus
in interface VirtualInterface
public boolean setFocus(PhantomHostFieldLocation hostFieldLocation)
setFocus
in interface VirtualInterface
public boolean selectField()
selectField
in interface VirtualInterface
public int getLength()
getLength
in interface VirtualInterface
public boolean setLength(int length)
setLength
in interface VirtualInterface
public boolean setChecked(int state)
setChecked
in interface VirtualInterface
public int isChecked()
isChecked
in interface VirtualInterface
public int getLineCount()
getLineCount
in interface VirtualInterface
public boolean insertLine(String data, int line)
insertLine
in interface VirtualInterface
public boolean setLine(String data, int line)
setLine
in interface VirtualInterface
public String getLine(int line)
getLine
in interface VirtualInterface
public boolean deleteLine(int line)
deleteLine
in interface VirtualInterface
public boolean deleteAll()
deleteAll
in interface VirtualInterface
public boolean setCell(int col, int line, String data)
setCell
in interface VirtualInterface
col
- 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 VirtualInterface
col
- The column for the cell.line
- The line for the column.public boolean setSelection(int line, boolean select)
setSelection
in interface VirtualInterface
public int getNextSelection(int line)
getNextSelection
in interface VirtualInterface
public boolean setFileFromList(PhantomOutputFile pFile)
setFileFromList
in interface VirtualInterface
public boolean setListFromFile(String fileName)
setListFromFile
in interface VirtualInterface
fileName
- the file name.public boolean callControl()
callControl
in interface VirtualInterface
public void setChanged()
setChanged
in interface VirtualChangeEvent
public 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 chane of components, even upwards in the tree will synchronize the client panels and components.
hasChanged
in interface VirtualChangeEvent
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.