Package org.sakaiproject.cheftool.api
Interface MenuItem
-
- All Known Subinterfaces:
Menu
public interface MenuItemMenuItem is the interface for all the objects that can live on a menu.
-
-
Field Summary
Fields Modifier and Type Field Description static intCHECKED_FALSEstatic intCHECKED_NAChecked status values.static intCHECKED_TRUEstatic StringSTATE_MENU
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAccessibilityLabel()Get the optional label that may be set by components to provide accessiblity information, eg alt tags, title attributes etcStringgetAction()Access the action string for this item; what to do when the user clicks.intgetChecked()Access the checked status of this item.StringgetForm()Access the form name whose values will be used when this item is selected.StringgetIcon()Access the icon name for the item (or null if no icon).booleangetIsContainer()Does this item act as a container for other items?booleangetIsCurrent()Access the is-current flag.booleangetIsDivider()Is this item a divider ?booleangetIsEnabled()Access the enabled flag for the item.booleangetIsField()Access the is-field (not a button) flag.MenuItemgetItem(int index)Access one sub-items of the item.List<MenuItem>getItems()Access the sub-items of the item.StringgetTitle()Access the display title for the item.StringgetUrl()Access the full URL string for this item; what to do when the user clicks.booleanisEmpty()Check if there are any sub-items.intsize()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<MenuItem> 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.
-
getIsCurrent
boolean getIsCurrent()
Access the is-current flag.- Returns:
- True if the item is the currently selected one, 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
-
-