Package org.sakaiproject.cheftool.menu
Class MenuField
- java.lang.Object
-
- org.sakaiproject.cheftool.menu.MenuField
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_accessibilityLabelOptional accessibility info that can be setprotected Stringm_actionThe action to perform.protected Stringm_formThe form name string for the entry.protected Stringm_nameThe form field name.protected Stringm_valueThe value to display in the field.-
Fields inherited from interface org.sakaiproject.cheftool.api.MenuItem
CHECKED_FALSE, CHECKED_NA, CHECKED_TRUE, STATE_MENU
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessibilityLabel()StringgetAction()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()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 - this is really the form field name.StringgetUrl()Access the full URL string for this item; what to do when the user clicks.StringgetValue()Access the value string for this item - the initial value.booleanisEmpty()Check if there are any sub-items.MenuFieldsetUrl(String url)Set the full URL of the entry.intsize()Count the sub-items of the item.
-
-
-
Field Detail
-
m_name
protected String m_name
The form field name.
-
m_form
protected String m_form
The form name string for the entry.
-
m_value
protected String m_value
The value to display in the field.
-
m_action
protected String m_action
The action to perform.
-
m_accessibilityLabel
protected String m_accessibilityLabel
Optional accessibility info that can be set
-
-
Method Detail
-
setUrl
public MenuField setUrl(String url)
Set the full URL of the entry. To create an entry with a URL, create one first with a "" action, then call this.- Parameters:
url- The full URL for the entry.- Returns:
- This, for convenience.
-
getIsContainer
public boolean getIsContainer()
Does this item act as a container for other items?- Specified by:
getIsContainerin interfaceMenuItem- Returns:
- true if this MenuItem is a container for other items, false if not.
-
getIsDivider
public boolean getIsDivider()
Is this item a divider ?- Specified by:
getIsDividerin interfaceMenuItem- Returns:
- true if this MenuItem is a divider, false if not.
-
getTitle
public String getTitle()
Access the display title for the item - this is really the form field name.
-
getIcon
public String getIcon()
Access the icon name for the item (or null if no icon).
-
getIsEnabled
public boolean getIsEnabled()
Access the enabled flag for the item.- Specified by:
getIsEnabledin interfaceMenuItem- Returns:
- True if the item is enabled, false if not.
-
getValue
public String getValue()
Access the value string for this item - the initial value.- Returns:
- The value string for this item - the initial value.
-
getAction
public 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 ""). Note: if the entry is not enabled, this will return "".
-
getUrl
public 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 "").
-
getForm
public String getForm()
Access the form name whose values will be used when this item is selected.
-
getItems
public List<MenuItem> getItems()
Access the sub-items of the item. Note: if !isContainer(), there will be no sub-items (will return EmptyIterator).
-
getItem
public MenuItem getItem(int index)
Access one sub-items of the item. Note: if !isContainer(), there will be no sub-items (will return null).
-
getChecked
public int getChecked()
Access the checked status of this item. Possible values:- Specified by:
getCheckedin interfaceMenuItem- Returns:
- The the checked status of this item.
- See Also:
MenuItem
-
size
public int size()
Count the sub-items of the item. Note: if !isContainer(), the count is 0.
-
isEmpty
public boolean isEmpty()
Check if there are any sub-items. Note: if !isContainer(), this is empty.
-
getIsField
public boolean getIsField()
Access the is-field (not a button) flag.- Specified by:
getIsFieldin interfaceMenuItem- Returns:
- True if the item is a field, false if not.
-
getIsCurrent
public boolean getIsCurrent()
- Specified by:
getIsCurrentin interfaceMenuItem
-
getAccessibilityLabel
public String getAccessibilityLabel()
- Specified by:
getAccessibilityLabelin interfaceMenuItem
-
-