Decision Center API

ilog.webui.dhtml.components
Class IlxWMenuItem

java.lang.Object
  extended by ilog.webui.dhtml.IlxWContainer
      extended by ilog.webui.dhtml.IlxWComponent
          extended by ilog.webui.dhtml.components.IlxWMenuItem
All Implemented Interfaces:
ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, Serializable
Direct Known Subclasses:
IlxWCheckBoxMenuItem, IlxWMenu

public class IlxWMenuItem
extends IlxWComponent

An implementation of a menu item. A menu item is basically a button in a list. When the user selects such a "button", the associated action is performed.

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.

See Also:
IlxWMenuBar, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.webui.dhtml.IlxWComponent
IlxWComponent.DynamicStyleMap
 
Field Summary
 
Fields inherited from class ilog.webui.dhtml.IlxWContainer
listenerList
 
Constructor Summary
IlxWMenuItem()
          Creates a menu item with no predefined text or icon.
IlxWMenuItem(String text)
          Creates a menu item with text.
IlxWMenuItem(String text, String icon)
          Creates a menu item with the supplied text and icon.
 
Method Summary
 IlxWAction getAction()
          Gets the action associated with this menu item.
 String getIcon()
          Gets the icon of the menu item
 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(String icon)
          Sets the icon of the menu item.
 void setText(String text)
          Sets the text of the menu item.
 
Methods inherited from class ilog.webui.dhtml.IlxWComponent
addPropertyChangeListener, addPropertyChangeListener, detach, doPrint, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, print, removePropertyChangeListener, removePropertyChangeListener, setName, validate
 
Methods inherited from class ilog.webui.dhtml.IlxWContainer
add, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, getUserAgentRules, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlxWMenuItem

public IlxWMenuItem()
Creates a menu item with no predefined text or icon.


IlxWMenuItem

public IlxWMenuItem(String text)
Creates a menu item with text.

Parameters:
text - The text of the menu item.

IlxWMenuItem

public IlxWMenuItem(String text,
                    String icon)
Creates a menu item with the supplied text and icon.

Parameters:
text - The text of the menu item.
icon - The icon of the menu item.
Method Detail

isRoot

public boolean isRoot()
Tells whether the parent of this menu item is a menu bar.

Returns:
true if the parent component is a menu bar; false otherwise.

setText

public void setText(String text)
Sets the text of the menu item.


getText

public String getText()
Gets the text of the menu item.

Returns:
The text of the menu item.

setIcon

public void setIcon(String icon)
Sets the icon of the menu item.


getIcon

public String getIcon()
Gets the icon of the menu item

Returns:
The icon of the menu item.

setEnabled

public void setEnabled(boolean enabled)
Enables (or disables) the menu item.


isEnabled

public boolean isEnabled()
Specifies whether the menu item is disabled or not.

Returns:
true if the menu item is enabled.

setAction

public void setAction(IlxWAction action)
Sets the action associated with this menu item. When the user selects this menu item on the client, the corresponding action is triggered.

Parameters:
action - The action

getAction

public IlxWAction getAction()
Gets the action associated with this menu item.

Returns:
The associated action.

printComponent

protected void printComponent(IlxWPort port)
                       throws IOException
Description copied from class: IlxWComponent
Prints the HTML code that will display the graphical representation of this component. This method is called by the IlxWComponent.print(ilog.webui.dhtml.IlxWPort) method.

Specified by:
printComponent in class IlxWComponent
Throws:
IOException
Parameters:
port - The port on which the component will be printed.
See Also:
IlxWComponent.print(ilog.webui.dhtml.IlxWPort)

notifyDependencies

public void notifyDependencies(IlxWPort port)
Specified by:
notifyDependencies in interface ilog.webui.dhtml.IlxWDependencyProvider
Overrides:
notifyDependencies in class IlxWComponent

Decision Center API

© Copyright IBM Corp. 1987, 2013