org.exoplatform.gwtframework.ui.client.menu
Class MenuBar

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.exoplatform.gwtframework.ui.client.menu.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.IsRenderable, com.google.gwt.user.client.ui.IsWidget, CloseMenuHandler, ItemSelectedHandler

public class MenuBar
extends com.google.gwt.user.client.ui.Composite
implements ItemSelectedHandler, CloseMenuHandler

Created by The eXo Platform SAS . MenuBar is visual component, represents top menu.

Version:
$
Author:
Vitaliy Gulyy

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
MenuBar()
          Create MenuBar.
 
Method Summary
 MenuItem addItem(java.lang.String title)
          Create and add new item in menu.
 MenuItem addItem(java.lang.String title, com.google.gwt.user.client.Command command)
          Create and add new item in menu.
 MenuItem addItem(java.lang.String icon, java.lang.String title)
          Create and add new item in menu.
 MenuItem addItem(java.lang.String icon, java.lang.String title, com.google.gwt.user.client.Command command)
          Create and add new item in menu.
 java.util.List<MenuItem> getItems()
          Get list of items.
 void onCloseMenu()
          Handle closing of all popup windows.
 void onMenuItemSelected(MenuItem menuItem)
          Handle selection of Menu Item.
 void openPopupMenu(MenuBarItem item)
          Open Popup Menu.
 java.lang.String toString()
           
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
 
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, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
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, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuBar

public MenuBar()
Create MenuBar.

Method Detail

addItem

public MenuItem addItem(java.lang.String title)
Create and add new item in menu.

Parameters:
title - title of new item
Returns:
new instance of MenuBarItem which extends MenuItem

addItem

public MenuItem addItem(java.lang.String title,
                        com.google.gwt.user.client.Command command)
Create and add new item in menu.

Parameters:
title - title of new item
command - command, which will be executed when menu item will be selected
Returns:
new instance of MenuBarItem which extends MenuItem

addItem

public MenuItem addItem(java.lang.String icon,
                        java.lang.String title)
Create and add new item in menu.

Parameters:
icon - item's icon which must be represented as HTML image. Image must be prepared like "" tag
title - title of new item
Returns:
new instance of MenuBarItem which extends MenuItem

addItem

public MenuItem addItem(java.lang.String icon,
                        java.lang.String title,
                        com.google.gwt.user.client.Command command)
Create and add new item in menu.

Parameters:
icon - item's icon which must be represented as HTML image. Image must be prepared like "" tag
title - title of new item
command - command, which will be executed when menu item will be selected
Returns:
new instance of MenuBarItem which extends MenuItem

getItems

public java.util.List<MenuItem> getItems()
Get list of items.

Returns:
list of items

onCloseMenu

public void onCloseMenu()
Handle closing of all popup windows.

Specified by:
onCloseMenu in interface CloseMenuHandler
See Also:
org.exoplatform.gwtframework.ui.client.CloseMenuHandler.menu.nn.impl.CloseMenuCallback#onCloseMenu()

onMenuItemSelected

public void onMenuItemSelected(MenuItem menuItem)
Handle selection of Menu Item.

Specified by:
onMenuItemSelected in interface ItemSelectedHandler
Parameters:
menuItem - selected MenuItem
See Also:
org.exoplatform.gwtframework.ui.client.ItemSelectedHandler.menu.nn.impl.ItemSelectedCallback#onMenuItemSelected(org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem)

openPopupMenu

public void openPopupMenu(MenuBarItem item)
Open Popup Menu.

Parameters:
item - - popup menu item.

toString

public java.lang.String toString()
Overrides:
toString in class com.google.gwt.user.client.ui.UIObject


Copyright © 2013 eXo Platform SAS. All Rights Reserved.