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

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.toolbar.ToolItem
                  extended by com.extjs.gxt.ui.client.widget.toolbar.TextToolItem
All Implemented Interfaces:
Observable, com.google.gwt.user.client.EventListener
Direct Known Subclasses:
SplitToolItem, ToggleToolItem

public class TextToolItem
extends ToolItem

A tool item with optional text and icon style.

Events:
Select : ToolBarEvent(container, item, event)
Fires after the item is selected.

 

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
TextToolItem()
          Creates a new text tool item.
TextToolItem(java.lang.String text)
          Creates a new text tool item.
TextToolItem(java.lang.String text, SelectionListener<ToolBarEvent> selectionListener)
          Creates a new text tool item.
TextToolItem(java.lang.String text, java.lang.String iconStyle)
          Creates a new text tool item.
 
Method Summary
 void addSelectionListener(SelectionListener listener)
          Adds a selection listener.
 java.lang.String getIconStyle()
          Returns the item's icon style.
 Menu getMenu()
          Returns the item's menu (if it has one).
 java.lang.String getText()
          Returns the button's text.
 ToolBar getToolBar()
          Returns the item's parent tool bar.
 ToolTip getToolTip()
          Returns the component's tool tip.
 void removeSelectionListener(SelectionListener listener)
          Removes a selection listener.
 void setIconStyle(java.lang.String iconStyle)
          Sets the item's icon style.
 void setMenu(Menu menu)
          Sets the item's menu.
 void setText(java.lang.String text)
          Sets the item's text.
 void setToolTip(java.lang.String text)
          Sets the component's tool tip.
 void setToolTip(ToolTipConfig config)
          Sets the component's tool tip with the given config.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isVisible, onBrowserEvent, onComponentEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setHeight, setId, setIntStyleAttribute, setItemId, setPixelSize, setSize, setStyleAttribute, setStyleName, setTitle, setVisible, setWidth, show, sinkEvents, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
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

TextToolItem

public TextToolItem()
Creates a new text tool item.


TextToolItem

public TextToolItem(java.lang.String text)
Creates a new text tool item.

Parameters:
text - the tool item text

TextToolItem

public TextToolItem(java.lang.String text,
                    SelectionListener<ToolBarEvent> selectionListener)
Creates a new text tool item.

Parameters:
text - the item's text
selectionListener - a selection listener

TextToolItem

public TextToolItem(java.lang.String text,
                    java.lang.String iconStyle)
Creates a new text tool item.

Parameters:
text - the text
iconStyle - the icon style
Method Detail

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Adds a selection listener.

Parameters:
listener - the selection listener

getIconStyle

public java.lang.String getIconStyle()
Returns the item's icon style.

Returns:
the icon style

getMenu

public Menu getMenu()
Returns the item's menu (if it has one).

Returns:
the menu

getText

public java.lang.String getText()
Returns the button's text.

Returns:
the text

getToolBar

public ToolBar getToolBar()
Returns the item's parent tool bar.

Overrides:
getToolBar in class ToolItem
Returns:
the toolbar

getToolTip

public ToolTip getToolTip()
Description copied from class: Component
Returns the component's tool tip.

Overrides:
getToolTip in class Component
Returns:
the tool tip

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Removes a selection listener.

Parameters:
listener - the listener to be removed

setIconStyle

public void setIconStyle(java.lang.String iconStyle)
Sets the item's icon style. The style name should match a CSS style that specifies a background image using the following format:

 .my-icon {
    background: url(images/icons/my-icon.png) no-repeat center left !important;
 }
 

Parameters:
iconStyle - the icon style

setMenu

public void setMenu(Menu menu)
Sets the item's menu.

Parameters:
menu - the menu

setText

public void setText(java.lang.String text)
Sets the item's text.

Parameters:
text - the text

setToolTip

public void setToolTip(java.lang.String text)
Description copied from class: Component
Sets the component's tool tip.

Overrides:
setToolTip in class Component
Parameters:
text - the text

setToolTip

public void setToolTip(ToolTipConfig config)
Description copied from class: Component
Sets the component's tool tip with the given config.

Overrides:
setToolTip in class Component
Parameters:
config - the tool tip config