com.sencha.gxt.widget.core.client.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.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.button.IconButton
All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, HasEnabled, HasVisibility, IsWidget, BeforeHideEvent.HasBeforeHideHandlers, BeforeSelectEvent.HasBeforeSelectHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, SelectEvent.HasSelectHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, HasFocusSupport, HasItemId
Direct Known Subclasses:
ToolButton

public class IconButton
extends Component
implements BeforeSelectEvent.HasBeforeSelectHandlers, SelectEvent.HasSelectHandlers

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

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


Nested Class Summary
static interface IconButton.IconButtonAppearance
           
static class IconButton.IconConfig
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
IconButton(IconButton.IconButtonAppearance appearance, IconButton.IconConfig config)
          Creates a new icon button.
IconButton(IconButton.IconConfig config)
          Creates a new icon button.
IconButton(java.lang.String style)
          Creates a new icon button.
IconButton(java.lang.String style, SelectEvent.SelectHandler handler)
          Creates a new icon button.
 
Method Summary
 HandlerRegistration addBeforeSelectHandler(BeforeSelectEvent.BeforeSelectHandler handler)
          Adds a BeforeSelectEvent.BeforeSelectHandler handler for BeforeSelectEvent events.
 HandlerRegistration addSelectHandler(SelectEvent.SelectHandler handler)
          Adds a SelectEvent.SelectHandler handler for SelectEvent events.
 void changeStyle(IconButton.IconConfig config)
          Changes the icon style.
 void changeStyle(java.lang.String style)
          Changes the icon style.
 void onBrowserEvent(Event event)
           
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IconButton

public IconButton(IconButton.IconButtonAppearance appearance,
                  IconButton.IconConfig config)
Creates a new icon button.

Parameters:
appearance - the icon button appearance
config - the icon configuration

IconButton

@UiConstructor
public IconButton(IconButton.IconConfig config)
Creates a new icon button.

Parameters:
config - the icon configuration

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,
                  SelectEvent.SelectHandler handler)
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
handler - the select handler
Method Detail

addBeforeSelectHandler

public HandlerRegistration addBeforeSelectHandler(BeforeSelectEvent.BeforeSelectHandler handler)
Description copied from interface: BeforeSelectEvent.HasBeforeSelectHandlers
Adds a BeforeSelectEvent.BeforeSelectHandler handler for BeforeSelectEvent events.

Specified by:
addBeforeSelectHandler in interface BeforeSelectEvent.HasBeforeSelectHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

addSelectHandler

public HandlerRegistration addSelectHandler(SelectEvent.SelectHandler handler)
Description copied from interface: SelectEvent.HasSelectHandlers
Adds a SelectEvent.SelectHandler handler for SelectEvent events.

Specified by:
addSelectHandler in interface SelectEvent.HasSelectHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

changeStyle

public void changeStyle(IconButton.IconConfig config)
Changes the icon style.

Parameters:
config - the config object

changeStyle

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

Parameters:
style - the new icon style

onBrowserEvent

public void onBrowserEvent(Event event)
Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Component


Copyright © 2012. All Rights Reserved.