com.extjs.gxt.ui.client.widget.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.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.Container<MenuBarItem>
                      extended by com.extjs.gxt.ui.client.widget.menu.MenuBar
All Implemented Interfaces:
Observable, 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.IsWidget

public class MenuBar
extends Container<MenuBarItem>

A horizontal menu bar.


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
protected  MenuBarItem active
           
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Container
attachChildren, enableLayout, layoutExecuted, layoutNeeded, layoutOnAttach, layoutOnChange
 
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Component
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
MenuBar()
           
 
Method Summary
 boolean add(MenuBarItem item)
          Adds a item to the container.
protected  void collapse(MenuBarItem item)
           
protected  void expand(MenuBarItem item, boolean selectFirst)
           
 boolean insert(MenuBarItem item, int index)
          Adds a item into the container.
protected  void onActivate(MenuBarItem item)
           
 void onComponentEvent(ComponentEvent ce)
          Any events a component receives will be forwarded to this method.
protected  void onDeactivate(MenuBarItem item)
           
protected  void onInsert(MenuBarItem item, int index)
           
protected  void onKeyPress(ComponentEvent ce)
           
protected  void onLeft(ComponentEvent ce)
           
protected  void onMouseOut(ComponentEvent ce)
           
protected  void onMouseOver(ComponentEvent ce)
           
protected  void onRemove(MenuBarItem item)
           
protected  void onRender(com.google.gwt.user.client.Element target, int index)
          Subclasses must override and ensure setElement is called for lazy rendered components.
protected  void onResize(int width, int height)
          Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs.
protected  void onRight(ComponentEvent ce)
           
 boolean remove(MenuBarItem item)
          Removes the item from the container.
 void setActiveItem(MenuBarItem item, boolean expand)
          Sets the active item.
 void toggle(MenuBarItem item)
          Toggles the given item.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Container
adjustIndex, adopt, createContainerEvent, disable, doAttachChildren, doDetachChildren, doLayout, doLayout, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getLayout, getLayoutTarget, getWidget, indexOf, isLayoutNeeded, iterator, layout, layout, notifyHide, notifyShow, onAfterLayout, onAttach, onBeforeLayoutExcecuted, onLayoutExcecuted, orphan, remove, removeAll, removeAll, scrollIntoView, setLayout, setLayoutNeeded, setLayoutOnChange, wrapWidget
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustPosition, adjustSize, afterRender, createComponentEvent, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onHide, onPosition, onShow, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addAttachable, addListener, addPlugin, addStyleName, addStyleOnOver, addWidgetListener, applyState, assertAfterRender, assertPreRender, beforeRender, blur, clearState, createObservable, createStyles, disableContextMenu, disableEvents, disableTextSelection, el, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, frame, getAriaSupport, getBaseStyle, getBorders, getContextMenu, getData, getElement, getFocusEl, getFocusSupport, getHideMode, getId, getItemId, getListeners, getModel, getObservable, getPlugins, getState, getStateId, getTabIndex, getTitle, getToolTip, getWindowResizeDelay, hasListeners, hasListeners, hide, hideToolTip, initState, isDisabledEvents, isDisableTextSelection, isEnabled, isMasked, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, mask, onBrowserEvent, onDetach, onDetachHelper, onDisable, onEnable, onEnsureDebugId, onHideContextMenu, onLoad, onRightClick, onShowContextMenu, onWindowResize, previewEvent, recalculate, removeAllListeners, removeAttachagle, removeFromParent, removeListener, removeStyleName, removeStyleOnOver, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setAriaRole, setAriaState, setAriaSupport, setBorders, setContextMenu, setData, setEl, setElement, setElement, setEnabled, setFiresEvents, setHideMode, setId, setIntStyleAttribute, setItemId, setModel, setMonitorWindowResize, setParent, setStateful, setStateId, setStyleAttribute, setStyleName, setTabIndex, setTitle, setToolTip, setToolTip, setVisible, setWindowResizeDelay, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unframe, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

active

protected MenuBarItem active
Constructor Detail

MenuBar

public MenuBar()
Method Detail

add

public boolean add(MenuBarItem item)
Description copied from class: Container
Adds a item to the container. Fires the BeforeAdd event before inserting, then fires the Add event after the widget has been inserted.

Overrides:
add in class Container<MenuBarItem>
Parameters:
item - the item to be added

insert

public boolean insert(MenuBarItem item,
                      int index)
Description copied from class: Container
Adds a item into the container. Fires the BeforeAdd event before inserting, then fires the Add event after the widget has been inserted.

Overrides:
insert in class Container<MenuBarItem>
Parameters:
item - the item to insert
index - the insert location

onComponentEvent

public void onComponentEvent(ComponentEvent ce)
Description copied from class: Component
Any events a component receives will be forwarded to this method. Subclasses should override as needed. The Component.onBrowserEvent(com.google.gwt.user.client.Event) method should not be overridden or modified.

Overrides:
onComponentEvent in class Component
Parameters:
ce - the base event

remove

public boolean remove(MenuBarItem item)
Description copied from class: Container
Removes the item from the container. Fires the BeforeRemove event before removing, then fires the Remove event after the widget has been removed.

Overrides:
remove in class Container<MenuBarItem>
Parameters:
item - the item to remove
Returns:
true if the item was removed

setActiveItem

public void setActiveItem(MenuBarItem item,
                          boolean expand)
Sets the active item.

Parameters:
item - the item to activate
expand - true to expand the item's menu

toggle

public void toggle(MenuBarItem item)
Toggles the given item.

Parameters:
item - the item to toggle

collapse

protected void collapse(MenuBarItem item)

expand

protected void expand(MenuBarItem item,
                      boolean selectFirst)

onActivate

protected void onActivate(MenuBarItem item)

onDeactivate

protected void onDeactivate(MenuBarItem item)

onInsert

protected void onInsert(MenuBarItem item,
                        int index)
Overrides:
onInsert in class Container<MenuBarItem>

onRemove

protected void onRemove(MenuBarItem item)
Overrides:
onRemove in class Container<MenuBarItem>

onKeyPress

protected void onKeyPress(ComponentEvent ce)

onLeft

protected void onLeft(ComponentEvent ce)

onMouseOut

protected void onMouseOut(ComponentEvent ce)

onMouseOver

protected void onMouseOver(ComponentEvent ce)

onRender

protected void onRender(com.google.gwt.user.client.Element target,
                        int index)
Description copied from class: Component
Subclasses must override and ensure setElement is called for lazy rendered components.

Overrides:
onRender in class Component
Parameters:
target - the target element
index - the insert location

onResize

protected void onResize(int width,
                        int height)
Description copied from class: BoxComponent
Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs.

Overrides:
onResize in class BoxComponent
Parameters:
width - the width
height - the height

onRight

protected void onRight(ComponentEvent ce)