public class VirtualPullDownMenu extends Object implements VirtualInterface, VirtualTooltipInterface, VirtualChangeEvent
Modifier and Type | Field and Description |
---|---|
protected int |
index
The index of this pull-down menu within the menu.
|
protected VirtualMenuItem[] |
menuItems
The menu items.
|
protected VirtualChangeEvent |
owner
The owner of this pull-down menu (the menu bar or the pop-up menu).
|
protected VirtualTextPrompt |
textData
The virtual text data.
|
TOOLTIP_TEXT
Constructor and Description |
---|
VirtualPullDownMenu(VirtualPanel vp,
PhantomMenu menuData,
VirtualChangeEvent owner)
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.
|
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.
|
void |
fireUpdate(Transaction trans)
Fires the update transaction to the client.
|
int |
getBackgroundColor()
Gets the background color of an item.
|
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.
|
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.
|
VirtualMenuItem |
getMenuItem(int index)
Gets the menu item by index (zero based).
|
int |
getMenuItemCount()
Gets the menu item by index (zero based).
|
VirtualInterface |
getMenuItemFromIndex(int menuIndex)
Gets a menu item VirtualInterface from a menu index.
|
int |
getNextSelection(int line)
Gets the next selected line in a list capable control.
|
Object |
getProperty(String propertyName)
Gets a property of a virtual component.
|
String |
getText()
Gets the text of an item.
|
String |
getTooltipText()
Gets the tool tip text of this component.
|
boolean |
hasChanged()
Check if anything in the menu tree has been 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 this pull-down menu.
|
boolean |
isEnabled()
Gets the enabled state of an item.
|
void |
issueAction(Transaction trans,
int menuIndex)
This method is invoked by the server kernel whenever a menu item has
been pressed on the client side.
|
boolean |
isVisible()
Gets the visibility state of an item.
|
void |
refresh()
Causes the text prompt of this pull-down menu to be refreshed along
with all menu items.
|
void |
refreshTextPrompts(boolean alwaysRefresh)
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 (range 1-30).
|
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 |
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 (range 1-30).
|
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.
|
boolean |
setVisible(boolean state)
Sets the visibility state of an item.
|
void |
textFileChanged()
Text file is changed, format text prompt.
|
protected VirtualChangeEvent owner
protected VirtualMenuItem[] menuItems
protected VirtualTextPrompt textData
protected int index
public VirtualPullDownMenu(VirtualPanel vp, PhantomMenu menuData, VirtualChangeEvent owner)
public void textFileChanged()
public void refresh()
public void refreshTextPrompts(boolean alwaysRefresh)
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
.public boolean areTextPromptsAlwaysRefreshed()
true
to this method call.
Otherwise return false
.public void fireCreate(Transaction trans)
The following data is sent to the client:
+ STRING textPrompt + BYTE menuItemCount + BYTE bit0=reserved, bit1=isEnabled, bit2=isChecked
public void fireUpdate(Transaction trans)
The following data is sent to the client if the pull-down menu text or state (checked/enabled) has changed.
+ SHORT index of pull-down menu + BYTE bit0=isTextChanged, bit1=isEnabled, bit2=isChecked + STRING if bit0=isTextChanged is set, nothing otherwise
public void hostScreenChanged(PhantomHostScreen screen)
public void issueAction(Transaction trans, int menuIndex)
public int getMenuItemCount()
public VirtualMenuItem getMenuItem(int index)
public VirtualInterface getMenuItemFromIndex(int menuIndex)
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 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()
If a control supports being called, it must override this method and return true.
callControl
in interface VirtualInterface
public void setChanged()
setChanged
in interface VirtualChangeEvent
public boolean hasChanged()
hasChanged
in interface VirtualChangeEvent
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.