NextApp Echo3 Extras
v3.0.b4

nextapp.echo.extras.app.menu
Class DefaultMenuModel

java.lang.Object
  extended by nextapp.echo.extras.app.menu.DefaultMenuModel
All Implemented Interfaces:
java.io.Serializable, ItemModel, MenuModel

public class DefaultMenuModel
extends java.lang.Object
implements MenuModel

Default MenuModel implementation. Provides capabilities to add and remove menu items.

See Also:
Serialized Form

Constructor Summary
DefaultMenuModel()
          Creates a new DefaultMenuModel.
DefaultMenuModel(java.lang.String id, java.lang.String text)
          Creates a new DefaultMenuModel with the specified title text.
DefaultMenuModel(java.lang.String id, java.lang.String text, nextapp.echo.app.ImageReference icon)
          Creates a new DefaultMenuModel with the specified title text and icon
 
Method Summary
 void addItem(ItemModel item)
          Adds an ItemModel to the end of the menu.
 void addItem(ItemModel item, int index)
          Adds an ItemModel to the menu at the specified index
 nextapp.echo.app.ImageReference getIcon()
          Returns the icon of the menu.
 java.lang.String getId()
          Returns the id of the OptionModel.
 ItemModel getItem(int itemIndex)
          Retrieves the ItemModel contained in this menu at the specified index.
 int getItemCount()
          Returns the number of items in the menu.
 java.lang.String getText()
          Returns the text of the menu.
 void removeItem(ItemModel item)
          REmoves an ItemModel from the menu
 void setIcon(nextapp.echo.app.ImageReference newValue)
          Sets the title icon of the menu
 void setText(java.lang.String newValue)
          Sets the title text of the menu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMenuModel

public DefaultMenuModel()
Creates a new DefaultMenuModel.


DefaultMenuModel

public DefaultMenuModel(java.lang.String id,
                        java.lang.String text)
Creates a new DefaultMenuModel with the specified title text.

Parameters:
id - the menu identifier
text - the title text

DefaultMenuModel

public DefaultMenuModel(java.lang.String id,
                        java.lang.String text,
                        nextapp.echo.app.ImageReference icon)
Creates a new DefaultMenuModel with the specified title text and icon

Parameters:
id - the menu identifier
text - the title text
icon - the title icon
Method Detail

addItem

public void addItem(ItemModel item)
Adds an ItemModel to the end of the menu.

Parameters:
item - the ItemModel to add

addItem

public void addItem(ItemModel item,
                    int index)
Adds an ItemModel to the menu at the specified index

Parameters:
item - the ItemModel to add
index - the index at which to insert it within the menu

getIcon

public nextapp.echo.app.ImageReference getIcon()
Description copied from interface: MenuModel
Returns the icon of the menu. This icon is displayed in the parent menu if this menu is used as a sub-menu.

Specified by:
getIcon in interface MenuModel
Returns:
the icon
See Also:
MenuModel.getIcon()

getId

public java.lang.String getId()
Description copied from interface: ItemModel
Returns the id of the OptionModel. The id will be used as the actionCommand of ActionEvents fired by a menu when the option is selected.

Specified by:
getId in interface ItemModel
Returns:
the id
See Also:
ItemModel.getId()

getItem

public ItemModel getItem(int itemIndex)
Description copied from interface: MenuModel
Retrieves the ItemModel contained in this menu at the specified index.

Specified by:
getItem in interface MenuModel
Parameters:
itemIndex - the index of the item to retrieve
Returns:
the item
See Also:
MenuModel.getItem(int)

getItemCount

public int getItemCount()
Description copied from interface: MenuModel
Returns the number of items in the menu.

Specified by:
getItemCount in interface MenuModel
Returns:
the number of items
See Also:
MenuModel.getItemCount()

getText

public java.lang.String getText()
Description copied from interface: MenuModel
Returns the text of the menu. This text is displayed in the parent menu if this menu is used as a sub-menu.

Specified by:
getText in interface MenuModel
Returns:
the text
See Also:
MenuModel.getText()

removeItem

public void removeItem(ItemModel item)
REmoves an ItemModel from the menu

Parameters:
item - the ItemModel to remove

setIcon

public void setIcon(nextapp.echo.app.ImageReference newValue)
Sets the title icon of the menu

Parameters:
newValue - the new title icon

setText

public void setText(java.lang.String newValue)
Sets the title text of the menu

Parameters:
newValue - the new title text

NextApp Echo3 Extras
v3.0.b4