|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.MenuBar
A standard menu bar widget. A menu bar can contain any number of menu items,
each of which can either fire a Command
or
open a cascaded menu bar.
code
Field Summary |
Fields inherited from class java.lang.Object |
typeId, typeName |
Constructor Summary | |
MenuBar()
Creates an empty horizontal menu bar. |
|
MenuBar(boolean vertical)
Creates an empty menu bar. |
Method Summary | |
void |
addItem(MenuItem item)
Adds a menu item to the bar. |
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. |
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. |
MenuItem |
addItem(String text,
Command cmd)
Adds a menu item to the bar, that will fire the given command when it is selected. |
MenuItem |
addItem(String text,
MenuBar popup)
Adds a menu item to the bar, that will open the specified menu when it is selected. |
void |
clearItems()
Removes all menu items from this menu bar. |
boolean |
getAutoOpen()
Gets whether this menu bar's child menus will open when the mouse is moved over it. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
protected void |
onDetach()
This method is called when a widget is detached from the browser's document. |
void |
onPopupClosed(PopupPanel sender,
boolean autoClosed)
Fired when the popup is closed. |
void |
removeItem(MenuItem item)
Removes the specified menu item from the bar. |
void |
setAutoOpen(boolean autoOpen)
Sets whether this menu bar's child menus will open when the mouse is moved over it. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
getParent, isAttached, onAttach, onLoad |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
equals, finalize, hashCode |
Constructor Detail |
public MenuBar()
public MenuBar(boolean vertical)
vertical
- true
to orient the menu bar verticallyMethod Detail |
public void addItem(MenuItem item)
item
- the item to be addedpublic MenuItem addItem(String text, boolean asHTML, Command cmd)
text
- the item's textasHTML
- true
to treat the specified text as htmlcmd
- the command to be fired
MenuItem
object createdpublic MenuItem addItem(String text, boolean asHTML, MenuBar popup)
text
- the item's textasHTML
- true
to treat the specified text as htmlpopup
- the menu to be cascaded from it
MenuItem
object createdpublic MenuItem addItem(String text, Command cmd)
text
- the item's textcmd
- the command to be fired
MenuItem
object createdpublic MenuItem addItem(String text, MenuBar popup)
text
- the item's textpopup
- the menu to be cascaded from it
MenuItem
object createdpublic void clearItems()
public boolean getAutoOpen()
true
if child menus will auto-openpublic void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Widget
public void onPopupClosed(PopupPanel sender, boolean autoClosed)
PopupListener
onPopupClosed
in interface PopupListener
sender
- popup being closed.autoClosed
- true
if the popup was automatically
closed; false
if it was closed programmatically.public void removeItem(MenuItem item)
item
- the item to be removedpublic void setAutoOpen(boolean autoOpen)
autoOpen
- true
to cause child menus to auto-openprotected void onDetach()
Widget
Panel
.
onDetach
in class Widget
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |