ilog.views.util.servlet.model
Class IlvMenuItem

java.lang.Object
  extended by ilog.views.util.servlet.model.IlvMenuItem
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IlvMenu, IlvMenuSeparator

public class IlvMenuItem
extends Object
implements Serializable

This class defines a menu item that should be contained by an IlvMenu.

Since:
JViews 7.5
See Also:
IlvMenu, Serialized Form

Constructor Summary
IlvMenuItem()
          Creates a menu item.
IlvMenuItem(String label)
          Creates a menu item.
IlvMenuItem(String label, ActionListener actionListener)
          Creates a menu item.
IlvMenuItem(String label, ActionListener actionListener, String image)
          Creates a menu item.
IlvMenuItem(String label, ActionListener actionListener, String image, boolean enabled)
          Creates a menu item.
IlvMenuItem(String label, String image)
          Creates a menu item.
 
Method Summary
 void fireActionPerformed(EventObject event)
          Broadcast the event to all the listeners registered on this menu item.
 ActionListener getActionListener()
          Returns the action listener that will be triggered if this menu item is selected by the user.
 String getId()
          Returns the ID of this menu item.
 String getImage()
          Returns the string representation of an URL to an image displayed on this menu item.
 String getLabel()
          Returns the label of this menu item.
 IlvMenu getParent()
          Returns the parent IlvMenu that contains this menu item.
 boolean isEnabled()
          Checks whether this menu item is enabled.
 void setActionListener(ActionListener actionListener)
          Sets the action listener that will be triggered if this menu item is selected by the user.
 void setEnabled(boolean enabled)
          Specifies whether this menu item can be chosen.
 void setId(String id)
          Sets the ID of this menu item.
 void setImage(String image)
          Sets the string representation of an URL to an image displayed on this menu item.
 void setLabel(String label)
          Sets the label of this menu item.
 void setParent(IlvMenu parent)
          Sets the parent IlvMenu of this menu item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMenuItem

public IlvMenuItem(String label,
                   ActionListener actionListener,
                   String image,
                   boolean enabled)
Creates a menu item.

Parameters:
label - The label of the menu item.
actionListener - The action listener triggered on this menu item selection.
image - The URL of an image.
enabled - If true, the menu item is enabled; if false, the menu item is disabled.

IlvMenuItem

public IlvMenuItem(String label,
                   ActionListener actionListener,
                   String image)
Creates a menu item.

Parameters:
label - The label of the menu item.
actionListener - The action listener triggered on this menu item selection.
image - The URL of an image.

IlvMenuItem

public IlvMenuItem(String label,
                   ActionListener actionListener)
Creates a menu item.

Parameters:
label - The label of the menu item.
actionListener - The action listener triggered on this menu item selection.

IlvMenuItem

public IlvMenuItem(String label,
                   String image)
Creates a menu item.

Parameters:
label - The label of the menu item.
image - image The URL of an image.

IlvMenuItem

public IlvMenuItem(String label)
Creates a menu item.

Parameters:
label - The label of the menu item.

IlvMenuItem

public IlvMenuItem()
Creates a menu item.

Method Detail

setActionListener

public void setActionListener(ActionListener actionListener)
Sets the action listener that will be triggered if this menu item is selected by the user.

Note that the action listener must be supported by the IlvPopupMenuEncoder implementation set on the IlvPopupMenuServletSupport.

Parameters:
actionListener - The action listener.

getActionListener

public ActionListener getActionListener()
Returns the action listener that will be triggered if this menu item is selected by the user.

Returns:
The action listener.

isEnabled

public boolean isEnabled()
Checks whether this menu item is enabled.

Returns:
true if the menu item is enabled; false if it is disabled.

setEnabled

public void setEnabled(boolean enabled)
Specifies whether this menu item can be chosen.

Parameters:
enabled - If true, the menu item is enabled; if false, the menu item is disabled.

getImage

public String getImage()
Returns the string representation of an URL to an image displayed on this menu item.

Returns:
The image of this menu item.

setImage

public void setImage(String image)
Sets the string representation of an URL to an image displayed on this menu item.

Parameters:
image - The image of this menu item.

getLabel

public String getLabel()
Returns the label of this menu item.

Returns:
The label of this menu item.

setLabel

public void setLabel(String label)
Sets the label of this menu item.

Parameters:
label - The label to set.

getParent

public IlvMenu getParent()
Returns the parent IlvMenu that contains this menu item.

Returns:
The parent menu.

setParent

public void setParent(IlvMenu parent)
Sets the parent IlvMenu of this menu item.

Parameters:
parent - The menu that will contain this menu item.

getId

public String getId()
Returns the ID of this menu item.

Returns:
The ID.

setId

public void setId(String id)

Sets the ID of this menu item.

This ID could be used in a listener to determine which menu item triggered the action.

Parameters:
id - The ID to set.

fireActionPerformed

public void fireActionPerformed(EventObject event)
                         throws Exception
Broadcast the event to all the listeners registered on this menu item.

Parameters:
event - The event object.
Throws:
Exception


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.