com.extjs.gxt.ui.client.widget.button
Class IconButton

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.button.IconButton
All Implemented Interfaces:
Observable, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener
Direct Known Subclasses:
ToolButton

public class IconButton
extends BoxComponent

A simple css styled button with 3 states: normal, over, and disabled.

Note: To change the icon style after construction use changeStyle(String).

Events:
Select : IconButtonEvent(iconButton, event)
Fires after the item is selected.
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


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
IconButton()
          Creates a new icon button.
IconButton(java.lang.String style)
          Creates a new icon button.
IconButton(java.lang.String style, SelectionListener<IconButtonEvent> listener)
          Creates a new icon button.
 
Method Summary
 void addSelectionListener(SelectionListener<IconButtonEvent> listener)
           
 void changeStyle(java.lang.String style)
          Changes the icon style.
 void onComponentEvent(ComponentEvent ce)
          Any events a component receives will be forwarded to this method.
 void removeSelectionListener(SelectionListener<ButtonEvent> listener)
          Removes a previously added listener.
 
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, disable, disableEvents, disableTextSelection, el, enable, 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, 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

IconButton

public IconButton()
Creates a new icon button. When using the default constructor, changeStyle(String) must be called to initialize the button.


IconButton

public IconButton(java.lang.String style)
Creates a new icon button. The 'over' style and 'disabled' style names determined by adding '-over' and '-disabled' to the base style name.

Parameters:
style - the base style

IconButton

public IconButton(java.lang.String style,
                  SelectionListener<IconButtonEvent> listener)
Creates a new icon button. The 'over' style and 'disabled' style names determined by adding '-over' and '-disabled' to the base style name.

Parameters:
style - the base style
listener - the click listener
Method Detail

addSelectionListener

public void addSelectionListener(SelectionListener<IconButtonEvent> listener)
Parameters:
listener -

changeStyle

public void changeStyle(java.lang.String style)
Changes the icon style.

Parameters:
style - the new icon style

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

removeSelectionListener

public void removeSelectionListener(SelectionListener<ButtonEvent> listener)
Removes a previously added listener.

Parameters:
listener - the listener to be removed