| java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.client.ui.MenuBar
MenuBar | public class MenuBar extends Widget implements PopupListener(Code) | | A standard menu bar widget. A menu bar can contain any number of menu items,
each of which can either fire a
com.google.gwt.user.client.Command or
open a cascaded menu bar.
CSS Style Rules
- .gwt-MenuBar { the menu bar itself }
- .gwt-MenuBar-horizontal { dependent style applied to horizontal menu
bars }
- .gwt-MenuBar-vertical { dependent style applied to vertical menu bars }
- .gwt-MenuBar .gwt-MenuItem { menu items }
- .gwt-MenuBar .gwt-MenuItem-selected { selected menu items }
Example
|
Constructor Summary | |
public | MenuBar() Creates an empty horizontal menu bar. | public | MenuBar(boolean vertical) Creates an empty menu bar. |
Method Summary | |
public void | addItem(MenuItem item) Adds a menu item to the bar. | public MenuItem | addItem(String text, boolean asHTML, Command cmd) Adds a menu item to the bar, that will fire the given command when it is
selected. | public MenuItem | addItem(String text, boolean asHTML, MenuBar popup) Adds a menu item to the bar, that will open the specified menu when it is
selected. | public MenuItem | addItem(String text, Command cmd) Adds a menu item to the bar, that will fire the given command when it is
selected. | public MenuItem | addItem(String text, MenuBar popup) Adds a menu item to the bar, that will open the specified menu when it is
selected. | public void | clearItems() Removes all menu items from this menu bar. | void | closeAllParents() | void | doItemAction(MenuItem item, boolean fireCommand) | public boolean | getAutoOpen() Gets whether this menu bar's child menus will open when the mouse is moved
over it. | protected List<MenuItem> | getItems() Returns a list containing the MenuItem objects in the menu
bar. | protected MenuItem | getSelectedItem() Returns the MenuItem that is currently selected
(highlighted) by the user. | void | itemOver(MenuItem item) | public void | onBrowserEvent(Event event) | protected void | onDetach() | public void | onPopupClosed(PopupPanel sender, boolean autoClosed) | public void | removeItem(MenuItem item) Removes the specified menu item from the bar. | void | selectItem(MenuItem item) | public void | setAutoOpen(boolean autoOpen) Sets whether this menu bar's child menus will open when the mouse is moved
over it. |
MenuBar | public MenuBar()(Code) | | Creates an empty horizontal menu bar.
|
MenuBar | public MenuBar(boolean vertical)(Code) | | Creates an empty menu bar.
Parameters: vertical - true to orient the menu bar vertically |
addItem | public void addItem(MenuItem item)(Code) | | Adds a menu item to the bar.
Parameters: item - the item to be added |
addItem | public MenuItem addItem(String text, boolean asHTML, Command cmd)(Code) | | Adds a menu item to the bar, that will fire the given command when it is
selected.
Parameters: text - the item's text Parameters: asHTML - true to treat the specified text as html Parameters: cmd - the command to be fired the MenuItem object created |
addItem | public MenuItem addItem(String text, boolean asHTML, MenuBar popup)(Code) | | Adds a menu item to the bar, that will open the specified menu when it is
selected.
Parameters: text - the item's text Parameters: asHTML - true to treat the specified text as html Parameters: popup - the menu to be cascaded from it the MenuItem object created |
addItem | public MenuItem addItem(String text, Command cmd)(Code) | | Adds a menu item to the bar, that will fire the given command when it is
selected.
Parameters: text - the item's text Parameters: cmd - the command to be fired the MenuItem object created |
addItem | public MenuItem addItem(String text, MenuBar popup)(Code) | | Adds a menu item to the bar, that will open the specified menu when it is
selected.
Parameters: text - the item's text Parameters: popup - the menu to be cascaded from it the MenuItem object created |
clearItems | public void clearItems()(Code) | | Removes all menu items from this menu bar.
|
closeAllParents | void closeAllParents()(Code) | | |
doItemAction | void doItemAction(MenuItem item, boolean fireCommand)(Code) | | |
getAutoOpen | public boolean getAutoOpen()(Code) | | Gets whether this menu bar's child menus will open when the mouse is moved
over it.
true if child menus will auto-open |
getItems | protected List<MenuItem> getItems()(Code) | | Returns a list containing the MenuItem objects in the menu
bar. If there are no items in the menu bar, then an empty List
object will be returned.
a list containing the MenuItem objects in the menubar |
getSelectedItem | protected MenuItem getSelectedItem()(Code) | | Returns the MenuItem that is currently selected
(highlighted) by the user. If none of the items in the menu are currently
selected, then null will be returned.
the MenuItem that is currently selected, ornull if no items are currently selected |
onBrowserEvent | public void onBrowserEvent(Event event)(Code) | | |
onDetach | protected void onDetach()(Code) | | |
onPopupClosed | public void onPopupClosed(PopupPanel sender, boolean autoClosed)(Code) | | |
removeItem | public void removeItem(MenuItem item)(Code) | | Removes the specified menu item from the bar.
Parameters: item - the item to be removed |
setAutoOpen | public void setAutoOpen(boolean autoOpen)(Code) | | Sets whether this menu bar's child menus will open when the mouse is moved
over it.
Parameters: autoOpen - true to cause child menus to auto-open |
|
|