Package overit.geocall.ui
Class Menu
java.lang.Object
overit.geocall.ui.Menu
- All Implemented Interfaces:
SingleUseComponent
- Direct Known Subclasses:
SortableMenu
The class implements the user interface element that should be used to display contextual menus that appears in popups when the user click on
a graphical object. The menu is composed by a list of items (each of which is a voice of the menu) that can either be non-active titles or active voices
that can trigger events.
The class implements the
The class implements the
SingleUseComponent interface.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a menu voicevoidCreates and add an item to the menuvoidCreates and add an item to the menuvoidaddItem(String label, String icon, String event, String id, String param, String msg, String prompt) Creates and add an item to the menuvoidAdds a non-active menu voicevoidEvery component can add a script to the StringBuilder, script executed when the component is created The method add the script that manage the creation and showing of the menuprotected org.apache.ecs.Elementprotected org.apache.ecs.ElementgetCheckDiv(Boolean checked, Boolean ro) protected org.apache.ecs.ElementgetCheckOrIconDiv(Boolean checked, Icon icon, Boolean ro) protected org.apache.ecs.Elementorg.apache.ecs.ElementReturns the html code of the menuprotected org.apache.ecs.ElementgetIconDiv(Icon icon, Boolean ro) getItems()Returns the item of the menuprotected org.apache.ecs.ElementgetLabelDiv(String label) Returns theTeacher, the object that manages the translationsprotected org.apache.ecs.ElementgetTitleDiv(String title) voidSets the title of the menu
-
Field Details
-
_sequence
protected static int _sequence -
_items
-
_id
-
_cellStyle
-
_nospinAttrib
-
_checkOnIcon
-
_checkOffIcon
-
_emptyIcon
-
-
Constructor Details
-
Menu
Creates a menu- Parameters:
teacher- The component that manage the translations (seeTeacher)
-
-
Method Details
-
getTeacher
Returns theTeacher, the object that manages the translations- Returns:
- The
Teacherthat manages the translations
-
addItem
Creates and add an item to the menu- Parameters:
label- The label of the itemicon- The icon of the itemevent- The event associated to the item
-
addItem
Creates and add an item to the menu- Parameters:
label- The label of the itemicon- The icon of the itemevent- The event associated to the itemid- The target for the event
-
addItem
public void addItem(String label, String icon, String event, String id, String param, String msg, String prompt) Creates and add an item to the menu- Parameters:
label- The label of the itemicon- The icon of the itemevent- The event associated to the itemid- The target for the eventparam- The parameter passed to the event triggered when the user clicks the menu voicemsg- The string that appears as a message when the user clicks the menu voiceprompt- The string that appears as a prompt when the user clicks the menu voice
-
add
Adds a menu voice- Parameters:
item- The item to be added to the menu
-
setTitle
Sets the title of the menu- Parameters:
title- The string that will appear as a title - always the first voice - for the menu
-
addTitle
Adds a non-active menu voice- Parameters:
title- The string, rendered as a title, for the menu
-
getItems
Returns the item of the menu- Returns:
- The list of the items
-
getHtml
Returns the html code of the menu- Specified by:
getHtmlin interfaceSingleUseComponent- Parameters:
es- TheEntitySetto which the element belongsw- TheWindowcurrently displayed- Returns:
- The html code of the menu
-
drawItem
-
getEmptyDiv
protected org.apache.ecs.Element getEmptyDiv() -
getTitleDiv
-
getLabelDiv
-
getCheckDiv
-
getIconDiv
-
getCheckOrIconDiv
-
buildSetupScript
Every component can add a script to the StringBuilder, script executed when the component is created The method add the script that manage the creation and showing of the menu- Specified by:
buildSetupScriptin interfaceSingleUseComponent- Parameters:
sb- The StringBuilder on which we want to add the script
-