Package overit.geocall.ui
Class Menu.Item
java.lang.Object
overit.geocall.ui.Menu.Item
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SortableMenu.Item
- Enclosing class:
Menu
The class implements a menu voice
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionItem()Empty constructorCreates a non-active menu voice with the desired label.Creates an active menu voiceCreates an active menu voice with a specified css class -
Method Summary
Modifier and TypeMethodDescriptionReturn the css class associated to this menu itemgetId()Return the id used as target for the event of the itemgetLabel()Returns the item labelgetParam()Return the param associated to the item's eventbooleanisEmpty()Checks if the item is emptyprotected booleanisFull()Checks if the item has both the specific icon and the boolean (seesetCheck(java.lang.Boolean)) check iconbooleanisTitle()Checks if the item is a titleDefines if it will appears a boolean icon on the left of the menu voice, and the type of the iconSets the parameters for the event associated to the itemSets if the value returned by the prompt can be an empty string ""Sets the readonly state of the itemSets the target for the event of the item
-
Field Details
-
_label
-
_icon
-
_event
-
_id
-
_param
-
_msg
-
_prompt
-
promptEmpty
protected boolean promptEmpty -
_check
-
_ro
-
_cssClass
-
-
Constructor Details
-
Item
public Item()Empty constructor -
Item
Creates a non-active menu voice with the desired label. This kind of voices will be rendered like titles, so in a different way than the others- Parameters:
title- The label of the menu voice
-
Item
Creates an active menu voice- Parameters:
label- The label that appears on the menuicon- The icon that appears on the left of the voiceevent- The event triggered when the user clicks on the voice; if null, the item is a title
-
Item
Creates an active menu voice with a specified css class- Parameters:
label- The label that appears on the menuicon- The icon that appears on the left of the voiceevent- The event triggered when the user clicks on the voice; if null, the item is a titlecssClass- the css class that will be associatd to this item
-
-
Method Details
-
setTarget
Sets the target for the event of the item- Parameters:
target- The desired id of the object that must be used as target for the event- Returns:
- The item with the given target
-
setParams
Sets the parameters for the event associated to the item- Parameters:
param- The parameters passed to the eventmsg- The string that appears as a message whe the user clicks the itemprompt- The string that appears as a prompt when the user clicks the item- Returns:
- The item with the given parameters
-
setCheck
Defines if it will appears a boolean icon on the left of the menu voice, and the type of the icon- Parameters:
check- true if the menu voice must have a "true" boolean icon, false if the menu voice must have a "false" boolean icon- Returns:
- The item with the given attribute
-
setRO
Sets the readonly state of the item- Parameters:
ro- true if the voice must be in readonly state (not clickable by the user), false otherwise- Returns:
- The item with the given attribute
-
setPromptEmpty
Sets if the value returned by the prompt can be an empty string ""- Parameters:
s-trueif you want to allow to return an empty value by the prompt,falseotherwise.- Returns:
- The button with the given parameters
-
isFull
protected boolean isFull()Checks if the item has both the specific icon and the boolean (seesetCheck(java.lang.Boolean)) check icon- Returns:
- true if the item has both the icons, false otherwise
-
isTitle
public boolean isTitle()Checks if the item is a title- Returns:
- true if the item has a label and an empty event, false otherwise
-
isEmpty
public boolean isEmpty()Checks if the item is empty- Returns:
- true if the label is null and the event is null
-
getLabel
Returns the item label- Returns:
- The string that corresponds to the label of the menu voice
-
getId
Return the id used as target for the event of the item- Returns:
- The id of the item
-
getParam
Return the param associated to the item's event- Returns:
- The parameters passed to the event when the user clicks on the menu voice
-
getCssClass
Return the css class associated to this menu item- Returns:
- String containing the css class
-