org.sakaiproject.cheftool.api
Interface MenuItem

All Known Subinterfaces:
Menu

public interface MenuItem

MenuItem is the interface for all the objects that can live on a menu.


Field Summary
static int CHECKED_FALSE
           
static int CHECKED_NA
          Checked status values.
static int CHECKED_TRUE
           
static String STATE_MENU
           
 
Method Summary
 String getAccessibilityLabel()
          Get the optional label that may be set by components to provide accessiblity information, eg alt tags, title attributes etc
 String getAction()
          Access the action string for this item; what to do when the user clicks.
 int getChecked()
          Access the checked status of this item.
 String getForm()
          Access the form name whose values will be used when this item is selected.
 String getIcon()
          Access the icon name for the item (or null if no icon).
 boolean getIsContainer()
          Does this item act as a container for other items?
 boolean getIsDivider()
          Is this item a divider ?
 boolean getIsEnabled()
          Access the enabled flag for the item.
 boolean getIsField()
          Access the is-field (not a button) flag.
 MenuItem getItem(int index)
          Access one sub-items of the item.
 List getItems()
          Access the sub-items of the item.
 String getTitle()
          Access the display title for the item.
 String getUrl()
          Access the full URL string for this item; what to do when the user clicks.
 boolean isEmpty()
          Check if there are any sub-items.
 int size()
          Count the sub-items of the item.
 

Field Detail

CHECKED_NA

static final int CHECKED_NA
Checked status values.

See Also:
Constant Field Values

CHECKED_FALSE

static final int CHECKED_FALSE
See Also:
Constant Field Values

CHECKED_TRUE

static final int CHECKED_TRUE
See Also:
Constant Field Values

STATE_MENU

static final String STATE_MENU
See Also:
Constant Field Values
Method Detail

getIsContainer

boolean getIsContainer()
Does this item act as a container for other items?

Returns:
true if this MenuItem is a container for other items, false if not.

getIsDivider

boolean getIsDivider()
Is this item a divider ?

Returns:
true if this MenuItem is a divider, false if not.

getTitle

String getTitle()
Access the display title for the item.

Returns:
The display title for the item.

getIcon

String getIcon()
Access the icon name for the item (or null if no icon).

Returns:
The icon name for the item (or null if no icon).

getIsEnabled

boolean getIsEnabled()
Access the enabled flag for the item.

Returns:
True if the item is enabled, false if not.

getAction

String getAction()
Access the action string for this item; what to do when the user clicks. Note: if getIsMenu(), there will not be an action string (will return "").

Returns:
The action string for this item.

getUrl

String getUrl()
Access the full URL string for this item; what to do when the user clicks. Note: this if defined overrides getAction() which should be "". Note: if getIsMenu(), there will not be a URL string (will return "").

Returns:
The full URL string for this item.

getForm

String getForm()
Access the form name whose values will be used when this item is selected.

Returns:
The form name whose values will be used when this item is selected, or null if there is none.

getChecked

int getChecked()
Access the checked status of this item. Possible values are (see above) CHECKED_NA, CHECKED_FALSE, CHECKED_TRUE

Returns:
The the checked status of this item.

getItems

List getItems()
Access the sub-items of the item. Note: if !isContainer(), there will be no sub-items (will return EmptyIterator).

Returns:
The sub-items of the item.

size

int size()
Count the sub-items of the item. Note: if !isContainer(), the count is 0.

Returns:
The count of sub-items of the item.

isEmpty

boolean isEmpty()
Check if there are any sub-items. Note: if !isContainer(), this is empty.

Returns:
true of there are no sub-items, false if there are.

getItem

MenuItem getItem(int index)
Access one sub-items of the item. Note: if !isContainer(), there will be no sub-items (will return null).

Parameters:
index - The index position (0 based) for the sub-item to get.
Returns:
The sub-item of the item.

getIsField

boolean getIsField()
Access the is-field (not a button) flag.

Returns:
True if the item is a field, false if not.

getAccessibilityLabel

String getAccessibilityLabel()
Get the optional label that may be set by components to provide accessiblity information, eg alt tags, title attributes etc

Returns:
the value


Copyright © 2006-2013 The Sakai Foundation. All Rights Reserved.