Package com.vaadin.client.ui.menubar
Class MenuBar
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.vaadin.client.ui.menubar.MenuBar
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.PopupListener,EventListener
- Direct Known Subclasses:
VComboBox.SuggestionMenu
@Deprecated public class MenuBar extends com.google.gwt.user.client.ui.Widget implements com.google.gwt.user.client.ui.PopupListener
Deprecated.A standard menu bar widget. A menu bar can contain any number of menu items, each of which can either fire aCommandor open a cascaded menu bar.
CSS Style Rules
- .gwt-MenuBar { the menu bar itself }
- .gwt-MenuBar .gwt-MenuItem { menu items }
- .gwt-MenuBar .gwt-MenuItem-selected { selected menu items }
Example
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddItem(MenuItem item)Deprecated.Adds a menu item to the bar.MenuItemaddItem(String text, boolean asHTML, com.google.gwt.user.client.Command cmd)Deprecated.Adds a menu item to the bar, that will fire the given command when it is selected.MenuItemaddItem(String text, boolean asHTML, MenuBar popup)Deprecated.Adds a menu item to the bar, that will open the specified menu when it is selected.MenuItemaddItem(String text, com.google.gwt.user.client.Command cmd)Deprecated.Adds a menu item to the bar, that will fire the given command when it is selected.MenuItemaddItem(String text, MenuBar popup)Deprecated.Adds a menu item to the bar, that will open the specified menu when it is selected.voidclearItems()Deprecated.Removes all menu items from this menu bar.protected voiddoItemAction(MenuItem item, boolean fireCommand)Deprecated.Performs the action associated with the given menu item.booleangetAutoOpen()Deprecated.Gets whether this menu bar's child menus will open when the mouse is moved over it.MenuItemgetFirstItem()Deprecated.Gets the first item from the menu or null if no items.List<MenuItem>getItems()Deprecated.Returns a list containing theMenuItemobjects in the menu bar.MenuItemgetLastItem()Deprecated.Gest the last item from the menu or null if no items.protected intgetPreferredHeight()Deprecated.Gets the preferred height of the menu.intgetSelectedIndex()Deprecated.Gets the index of the selected item.MenuItemgetSelectedItem()Deprecated.Returns theMenuItemthat is currently selected (highlighted) by the user.booleanisScrollActive()Deprecated.Gets whether the scroll is activate for this menu.voidonBrowserEvent(com.google.gwt.user.client.Event event)Deprecated.protected voidonDetach()Deprecated.voidonPopupClosed(com.google.gwt.user.client.ui.PopupPanel sender, boolean autoClosed)Deprecated.voidremoveItem(MenuItem item)Deprecated.Removes the specified menu item from the bar.voidscrollSelectionIntoView()Deprecated.Scroll the selected item into view.voidselectItem(MenuItem item)Deprecated.Moves the selection to the given item and scrolls it into view.voidsetAutoOpen(boolean autoOpen)Deprecated.Sets whether this menu bar's child menus will open when the mouse is moved over it.voidsetScrollEnabled(boolean enabled)Deprecated.Sets the menu scroll enabled or disabled.-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
-
-
-
Method Detail
-
addItem
public void addItem(MenuItem item)
Deprecated.Adds a menu item to the bar.- Parameters:
item- the item to be added
-
addItem
public MenuItem addItem(String text, boolean asHTML, com.google.gwt.user.client.Command cmd)
Deprecated.Adds a menu item to the bar, that will fire the given command when it is selected.- Parameters:
text- the item's textasHTML-trueto treat the specified text as htmlcmd- the command to be fired- Returns:
- the
MenuItemobject created
-
addItem
public MenuItem addItem(String text, boolean asHTML, MenuBar popup)
Deprecated.Adds a menu item to the bar, that will open the specified menu when it is selected.- Parameters:
text- the item's textasHTML-trueto treat the specified text as htmlpopup- the menu to be cascaded from it- Returns:
- the
MenuItemobject created
-
addItem
public MenuItem addItem(String text, com.google.gwt.user.client.Command cmd)
Deprecated.Adds a menu item to the bar, that will fire the given command when it is selected.- Parameters:
text- the item's textcmd- the command to be fired- Returns:
- the
MenuItemobject created
-
addItem
public MenuItem addItem(String text, MenuBar popup)
Deprecated.Adds a menu item to the bar, that will open the specified menu when it is selected.- Parameters:
text- the item's textpopup- the menu to be cascaded from it- Returns:
- the
MenuItemobject created
-
clearItems
public void clearItems()
Deprecated.Removes all menu items from this menu bar.
-
getAutoOpen
public boolean getAutoOpen()
Deprecated.Gets whether this menu bar's child menus will open when the mouse is moved over it.- Returns:
trueif child menus will auto-open
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
Deprecated.- Specified by:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classcom.google.gwt.user.client.ui.Widget
-
onPopupClosed
public void onPopupClosed(com.google.gwt.user.client.ui.PopupPanel sender, boolean autoClosed)Deprecated.- Specified by:
onPopupClosedin interfacecom.google.gwt.user.client.ui.PopupListener
-
removeItem
public void removeItem(MenuItem item)
Deprecated.Removes the specified menu item from the bar.- Parameters:
item- the item to be removed
-
setAutoOpen
public void setAutoOpen(boolean autoOpen)
Deprecated.Sets whether this menu bar's child menus will open when the mouse is moved over it.- Parameters:
autoOpen-trueto cause child menus to auto-open
-
getItems
public List<MenuItem> getItems()
Deprecated.Returns a list containing theMenuItemobjects in the menu bar. If there are no items in the menu bar, then an emptyListobject will be returned.- Returns:
- a list containing the
MenuItemobjects in the menu bar
-
getSelectedItem
public MenuItem getSelectedItem()
Deprecated.Returns theMenuItemthat is currently selected (highlighted) by the user. If none of the items in the menu are currently selected, thennullwill be returned.- Returns:
- the
MenuItemthat is currently selected, ornullif no items are currently selected
-
getFirstItem
public MenuItem getFirstItem()
Deprecated.Gets the first item from the menu or null if no items.- Returns:
- the first item from the menu or null if no items.
- Since:
- 7.2.6
-
getLastItem
public MenuItem getLastItem()
Deprecated.Gest the last item from the menu or null if no items.- Returns:
- the last item from the menu or null if no items.
- Since:
- 7.2.6
-
getSelectedIndex
public int getSelectedIndex()
Deprecated.Gets the index of the selected item.- Returns:
- the index of the selected item.
- Since:
- 7.2.6
-
onDetach
protected void onDetach()
Deprecated.- Overrides:
onDetachin classcom.google.gwt.user.client.ui.Widget
-
doItemAction
protected void doItemAction(MenuItem item, boolean fireCommand)
Deprecated.Performs the action associated with the given menu item. If the item has a popup associated with it, the popup will be shown. If it has a command associated with it, and 'fireCommand' is true, then the command will be fired. Popups associated with other items will be hidden.- Parameters:
item- the item whose popup is to be shown.fireCommand-trueif the item's command should be fired,falseotherwise.
-
selectItem
public void selectItem(MenuItem item)
Deprecated.Moves the selection to the given item and scrolls it into view. If the given item isnull, previous selection is removed but no scrolling will happen.- Parameters:
item- the item to select
-
scrollSelectionIntoView
public void scrollSelectionIntoView()
Deprecated.Scroll the selected item into view.- Since:
- 7.2.6
-
setScrollEnabled
public void setScrollEnabled(boolean enabled)
Deprecated.Sets the menu scroll enabled or disabled.- Parameters:
enabled- the enabled state of the scroll.- Since:
- 7.2.6
-
isScrollActive
public boolean isScrollActive()
Deprecated.Gets whether the scroll is activate for this menu.- Returns:
- true if the scroll is active, otherwise false.
- Since:
- 7.2.6
-
getPreferredHeight
protected int getPreferredHeight()
Deprecated.Gets the preferred height of the menu.- Returns:
- the preferred height
- Since:
- 7.2.6
-
-