public class IlxWMenuItem extends IlxWComponent
A menu item must always be a descendant of a menu bar element: do not
try to call the print method directly on a menu item; a menu
item cannot be printed unless its parent menu bar is printed.
IlxWMenuBar,
Serialized FormIlxWComponent.DynamicStyleMaplistenerList| Constructor and Description |
|---|
IlxWMenuItem()
Creates a menu item with no predefined text or icon.
|
IlxWMenuItem(java.lang.String text)
Creates a menu item with text.
|
IlxWMenuItem(java.lang.String text,
java.lang.String icon)
Creates a menu item with the supplied text and icon.
|
| Modifier and Type | Method and Description |
|---|---|
IlxWAction |
getAction()
Gets the action associated with this menu item.
|
java.lang.String |
getIcon()
Gets the icon of the menu item
|
java.lang.String |
getText()
Gets the text of the menu item.
|
boolean |
isEnabled()
Specifies whether the menu item is disabled or not.
|
boolean |
isRoot()
Tells whether the parent of this menu item is a menu bar.
|
void |
notifyDependencies(IlxWPort port) |
protected void |
printComponent(IlxWPort port)
Prints the HTML code that will display the graphical
representation of this component.
|
void |
setAction(IlxWAction action)
Sets the action associated with this menu item.
|
void |
setEnabled(boolean enabled)
Enables (or disables) the menu item.
|
void |
setIcon(java.lang.String icon)
Sets the icon of the menu item.
|
void |
setText(java.lang.String text)
Sets the text of the menu item.
|
addPropertyChangeListener, addPropertyChangeListener, detach, doPrint, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, print, removePropertyChangeListener, removePropertyChangeListener, setName, validateadd, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, getUserAgentRules, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizerpublic IlxWMenuItem()
public IlxWMenuItem(java.lang.String text)
text - The text of the menu item.public IlxWMenuItem(java.lang.String text,
java.lang.String icon)
text - The text of the menu item.icon - The icon of the menu item.public boolean isRoot()
true if the parent component is a menu bar;
false otherwise.public void setText(java.lang.String text)
public java.lang.String getText()
public void setIcon(java.lang.String icon)
public java.lang.String getIcon()
public void setEnabled(boolean enabled)
public boolean isEnabled()
true if the menu item is enabled.public void setAction(IlxWAction action)
action - The actionpublic IlxWAction getAction()
protected void printComponent(IlxWPort port) throws java.io.IOException
IlxWComponentIlxWComponent.print(ilog.webui.dhtml.IlxWPort) method.printComponent in class IlxWComponentjava.io.IOExceptionport - The port on which the component will be printed.IlxWComponent.print(ilog.webui.dhtml.IlxWPort)public void notifyDependencies(IlxWPort port)
notifyDependencies in interface ilog.webui.dhtml.IlxWDependencyProvidernotifyDependencies in class IlxWComponent© Copyright IBM Corp. 1987, 2017