ilog.webui.dhtml.components

Class IlxWMenuItem

  • All Implemented Interfaces:
    ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, java.io.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
    • Constructor Detail

      • IlxWMenuItem

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

        public IlxWMenuItem(java.lang.String text)
        Creates a menu item with text.
        Parameters:
        text - The text of the menu item.
      • IlxWMenuItem

        public IlxWMenuItem(java.lang.String text,
                    java.lang.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(java.lang.String text)
        Sets the text of the menu item.
      • getText

        public java.lang.String getText()
        Gets the text of the menu item.
        Returns:
        The text of the menu item.
      • setIcon

        public void setIcon(java.lang.String icon)
        Sets the icon of the menu item.
      • getIcon

        public java.lang.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.
      • notifyDependencies

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

© Copyright IBM Corp. 1987, 2017