com.extjs.gxt.ui.client.widget.toolbar
Class ToolBar

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<Component>
                      extended by com.extjs.gxt.ui.client.widget.toolbar.ToolBar
All Implemented Interfaces:
Observable, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener
Direct Known Subclasses:
ButtonBar, PagingToolBar

public class ToolBar
extends Container<Component>

A standard tool bar.

Events:
BeforeAdd : ToolBarEvent(container, item, index)
Fires before a item is added or inserted. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
BeforeRemove : ToolBarEvent(container, item)
Fires before a item is removed. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
Add : ToolBarEvent(container, item, index)
Fires after a item has been added or inserted.
Remove : ToolBarEvent(container, item)
Fires after a item has been removed.
Inherited Events:
BoxComponent Move
BoxComponent Resize
Component Enable
Component Disable
Component BeforeHide
Component Hide
Component BeforeShow
Component Show
Component Attach
Component Detach
Component BeforeRender
Component Render
Component BrowserEvent
Component BeforeStateRestore
Component StateRestore
Component BeforeStateSave
Component SaveState
CSS:
x-toolbar (the tool 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
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
ToolBar()
          Creates a new tool bar.
 
Method Summary
 boolean add(Component item)
          Adds a item to the tool bar.
 Style.HorizontalAlignment getAlignment()
          Returns the alignment of the items.
 int getMinButtonWidth()
          Returns the min button width.
 int getSpacing()
          Returns the child component spacing.
 boolean insert(Component item, int index)
          Inserts a item into the tool bar.
 boolean isEnableOverflow()
          Returns true if overflow is enabled.
 boolean layout()
          Executes the container's layout.
 boolean remove(Component item)
          Removes a component from the tool bar.
 void setAlignment(Style.HorizontalAlignment alignment)
          Sets the ailgnment of the items.
 void setEnableOverflow(boolean enableOverflow)
          True to show a drop down icon when the available width is less than the required width (defaults to false).
 void setMinButtonWidth(int minButtonWidth)
          Sets the minWidth for any Component of type Button
 void setSpacing(int spacing)
          Sets the spacing between child items (defaults to 0).
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Container
disable, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getLayoutTarget, getWidget, indexOf, iterator, removeAll, scrollIntoView
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, 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
addListener, addPlugin, addStyleName, addWidgetListener, clearState, disableEvents, disableTextSelection, el, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getContextMenu, getData, getElement, getHideMode, getId, getItemId, getListeners, getModel, getState, getStateId, getToolTip, hasListeners, hasListeners, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isStateful, isVisible, mask, mask, mask, onBrowserEvent, onComponentEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setBorders, setContextMenu, setData, setElement, setEnabled, setHideMode, setId, setIntStyleAttribute, setItemId, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
fireEvent, getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToolBar

public ToolBar()
Creates a new tool bar.

Method Detail

add

public boolean add(Component item)
Adds a item to the tool bar.

Parameters:
item - the item to add

getAlignment

public Style.HorizontalAlignment getAlignment()
Returns the alignment of the items.

Returns:
the alignment

getMinButtonWidth

public int getMinButtonWidth()
Returns the min button width.

Returns:
the min button width

getSpacing

public int getSpacing()
Returns the child component spacing.

Returns:
the spacing

insert

public boolean insert(Component item,
                      int index)
Inserts a item into the tool bar.

Parameters:
item - the item to add
index - the insert location

isEnableOverflow

public boolean isEnableOverflow()
Returns true if overflow is enabled.

Returns:
the overflow state

layout

public boolean layout()
Description copied from class: Container
Executes the container's layout. If a layout has not been set a FlowLayout will be used.

Returns:
true if layout was executed.

remove

public boolean remove(Component item)
Removes a component from the tool bar.

Parameters:
item - the item to be removed
Returns:
true if the item was removed

setAlignment

public void setAlignment(Style.HorizontalAlignment alignment)
Sets the ailgnment of the items. (defaults to LEFT, pre-render).

Parameters:
alignment - the alignment to set

setMinButtonWidth

public void setMinButtonWidth(int minButtonWidth)
Sets the minWidth for any Component of type Button

Parameters:
minButtonWidth - the min button width to set

setEnableOverflow

public void setEnableOverflow(boolean enableOverflow)
True to show a drop down icon when the available width is less than the required width (defaults to false).

Parameters:
enableOverflow - true to enable overflow support

setSpacing

public void setSpacing(int spacing)
Sets the spacing between child items (defaults to 0).

Parameters:
spacing - the spacing