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 IconButton.IconButtonAppearance |
appearance |
protected boolean |
cancelBubble |
protected IconButton.IconConfig |
config |
adjustSize, allowTextSelection, cacheSizes, contextMenu, contextMenuGestureRecognizer, dataMap, deferHeight, disableContextMenu, disabled, disabledStyle, disableEvents, ensureVisibilityOnSizing, focusManagerSupport, gestureRecognizers, height, hidden, hideMode, itemId, lastSize, layer, left, mask, maskMessage, monitorWindowResize, overElements, pageX, pageY, resizeHandler, shadow, shadowPosition, shim, stateful, stateId, 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, isAdjustSize, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, makeVisible, mask, mask, notifyHide, notifyShow, onAfterFirstAttach, onAttach, onBlur, onDetach, onFocus, onHide, onHideContextMenu, onLoad, onPosition, onResize, onRightClick, onShow, onShowContextMenu, onTouch, onUnload, onWindowResize, removeStyleDependentName, removeStyleOnOver, removeToolTip, restoreVisible, setAdjustSize, 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, unmaskprotected IconButton.IconConfig config
protected boolean cancelBubble
protected final IconButton.IconButtonAppearance appearance
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.HasBeforeSelectHandlersBeforeSelectEvent.BeforeSelectHandler handler for BeforeSelectEvent events.addBeforeSelectHandler in interface BeforeSelectEvent.HasBeforeSelectHandlershandler - the handlerpublic HandlerRegistration addSelectHandler(SelectEvent.SelectHandler handler)
SelectEvent.HasSelectHandlersSelectEvent.SelectHandler handler for SelectEvent events.addSelectHandler in interface SelectEvent.HasSelectHandlershandler - 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 Componentprotected void onClick(Event e)
protected void onKeyPress(Event ce)
Copyright © 2018. All rights reserved.