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)
.
Modifier and Type | Class and Description |
---|---|
static interface |
IconButton.IconButtonAppearance |
static class |
IconButton.IconConfig |
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancelBubble |
protected IconButton.IconConfig |
config |
adjustSize, allowTextSelection, cacheSizes, disableContextMenu, disabled, disabledStyle, ensureVisibilityOnSizing, height, hidden, lastSize, layer, left, mask, maskMessage, monitorWindowResize, pageX, pageY, resizeHandler, shim, tabIndex, toolTip, toolTipConfig, top, width, windowResizeDelay, windowResizeTask
Constructor and Description |
---|
IconButton(IconButton.IconButtonAppearance appearance,
IconButton.IconConfig config)
Creates a new icon button.
|
IconButton(IconButton.IconConfig config)
Creates a new icon button.
|
IconButton(String style)
Creates a new icon button.
|
IconButton(String style,
SelectEvent.SelectHandler handler)
Creates a new icon button.
|
Modifier and Type | Method and Description |
---|---|
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(String style)
Changes the icon style.
|
IconButton.IconButtonAppearance |
getAppearance() |
void |
onBrowserEvent(Event event) |
protected void |
onClick(Event e) |
protected void |
onDisable() |
protected void |
onEnable() |
protected void |
onKeyPress(Event ce) |
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addGestureRecognizer, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleDependentName, addStyleOnOver, adjustPosition, adjustSize, applyState, assertAfterRender, assertPreRender, blur, clearSizeCache, disable, disableContextMenu, disableEvents, enable, enableEvents, fireCancellableEvent, fireEvent, focus, getData, getElement, getFocusEl, getFocusSupport, getGestureRecognizer, getGestureRecognizerCount, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getPositionEl, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideShadow, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, notifyHide, notifyShow, onAfterFirstAttach, onAttach, onBlur, onDetach, onFocus, onHide, onHideContextMenu, onLoad, onPosition, onResize, onRightClick, onShow, onShowContextMenu, onTouch, onUnload, onWindowResize, removeStyleDependentName, removeStyleOnOver, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setMonitorWindowResize, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setStyleDependentName, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
protected IconButton.IconConfig config
protected boolean cancelBubble
public IconButton(IconButton.IconButtonAppearance appearance, IconButton.IconConfig config)
appearance
- the icon button appearanceconfig
- the icon configurationpublic IconButton(IconButton.IconConfig config)
config
- the icon configurationpublic IconButton(String style)
style
- the base stylepublic IconButton(String style, SelectEvent.SelectHandler handler)
style
- the base stylehandler
- the select handlerpublic HandlerRegistration addBeforeSelectHandler(BeforeSelectEvent.BeforeSelectHandler handler)
BeforeSelectEvent.HasBeforeSelectHandlers
BeforeSelectEvent.BeforeSelectHandler
handler for BeforeSelectEvent
events.addBeforeSelectHandler
in interface BeforeSelectEvent.HasBeforeSelectHandlers
handler
- the handlerpublic HandlerRegistration addSelectHandler(SelectEvent.SelectHandler handler)
SelectEvent.HasSelectHandlers
SelectEvent.SelectHandler
handler for SelectEvent
events.addSelectHandler
in interface SelectEvent.HasSelectHandlers
handler
- the handlerpublic void changeStyle(IconButton.IconConfig config)
config
- the config objectpublic void changeStyle(String style)
style
- the new icon stylepublic IconButton.IconButtonAppearance getAppearance()
public void onBrowserEvent(Event event)
onBrowserEvent
in class Component
protected void onClick(Event e)
protected void onKeyPress(Event ce)
Copyright © 2018. All rights reserved.