public interface IMenu extends com.google.gwt.user.client.ui.IsWidget, IUpgrade
Modifier and Type | Method and Description |
---|---|
void |
addItem(String item,
boolean enabled)
Syntactic sugar for
addItem(String, String, boolean) where
the text and value are the same. |
void |
addItem(String text,
String value,
boolean enabled)
Adds a new option to the list of options in the menu.
|
void |
addItem(String text,
String value,
int index,
boolean enabled)
Adds a an option into the set of options of the menu at a specified
position.
|
void |
addItemClickListener(Menu.ItemClickListener listener)
When an object needs to be notified upon a
MenuItem click, it must
be be registered to the Menu as an Menu.ItemClickListener .In order to receive item click notifications, the object should : Implement the Menu.ItemClickListener interface
Define the actions that should be performed when a MenuItem is
clicked inside Menu.ItemClickListener.onItemClicked(ItemClickEvent)
Call Menu.addItemClickListener(ItemClickListener) to register
itself to the menu and receive click notifications
|
void |
clearMenu()
Remove all items from the menu.
|
int |
getItemCount()
Returns the items count in a menu.
|
String |
getItemText(int index)
return the text of the item located at the position provided as input.
|
String |
getValue(int index)
return the value of the item located at the position provided as input.
|
boolean |
isEnabled(int index)
Modify the enabled state of an item.
|
void |
removeItem(int index)
Removes an item from the menu.
|
void |
setAnchor(MenuAnchor anchor)
Sets the position of the
Menu on the screen related to its
associated action button using one of the available anchoring options
provided by MenuAnchor .An extra care should be taken when anchoring the menu. |
boolean |
setEnabled(int index,
boolean enabled)
Modify the enabled state of an item.
|
isUpgraded, upgrade
void setAnchor(MenuAnchor anchor)
Menu
on the screen related to its
associated action button using one of the available anchoring options
provided by MenuAnchor
.anchor
- the requested Anchor
position for the Menu
void clearMenu()
void addItem(String text, String value, boolean enabled)
text
- The text to be displayedvalue
- The value to be addedenabled
- Defines whether the option can be chosen or not.void addItem(String item, boolean enabled)
addItem(String, String, boolean)
where
the text and value are the same.item
- The text to be displayedenabled
- Defines whether the option can be chosen or not.void addItem(String text, String value, int index, boolean enabled)
text
- The text to be displayedvalue
- The value to be addedenabled
- Defines whether the option is available for selection.index
- the insertion position of the itemvoid addItemClickListener(Menu.ItemClickListener listener)
MenuItem
click, it must
be be registered to the Menu
as an Menu.ItemClickListener
.Menu.ItemClickListener
interfaceMenuItem
is
clicked inside Menu.ItemClickListener.onItemClicked(ItemClickEvent)
Menu.addItemClickListener(ItemClickListener)
to register
itself to the menu and receive click notificationslistener
- The object to be notified when a MenuItem
is clicked.Menu.ItemClickListener
int getItemCount()
String getItemText(int index)
index
- the position of the itemString getValue(int index)
index
- the position of the itemboolean setEnabled(int index, boolean enabled)
index
- the position of the item in the item list of the menuenabled
- the state to be set for the itemtrue
if the state was modified, false
otherwise.boolean isEnabled(int index)
index
- the position of the item in the item list of the menutrue
if the item is enabled, false
otherwise.void removeItem(int index)
index
- the position of the item to be removedCopyright © 2016 com.github.ilyes4j. All rights reserved.