public class Button extends IconAnchor implements HasClickHandlers, HasDoubleClickHandlers, HasEnabled, HasType<ButtonType>, HasAllDragAndDropHandlers, HasAllFocusHandlers, HasAllGestureHandlers, HasAllKeyHandlers, HasAllMouseHandlers, HasAllTouchHandlers
<b:Button icon="TRASH" type="ERROR" toggle="true" loadingText="I'm loading..." completeText="Oh hoh, I completed the action!">Delete</b:Button>
All arguments are optional.
ButtonGroup,
ButtonToolbar,
DropdownButton,
SplitDropdownButton,
NavbarButton| Modifier and Type | Class and Description |
|---|---|
class |
Button.LoadingStateBehavior
A simple class to encapsulate the button state managing from the user.
|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledHasWidgets.ForIsWidgetIndexedPanel.ForIsWidgeticonDEBUG_ID_PREFIX| Constructor and Description |
|---|
Button()
Creates an empty Button.
|
Button(ClickHandler handler)
Creates an Button with ClickHandler
|
Button(String caption)
Creates a Button with the given caption.
|
Button(String caption,
ClickHandler handler)
Create Button with click handler.
|
Button(String caption,
IconType icon)
Creates a Button with the given caption and icon.
|
Button(String caption,
IconType icon,
ClickHandler handler)
Creates a Button with the given caption and icon and ClickHandler.
|
getAnchorElement, getHref, getName, getTabIndex, getTarget, getTargetHistoryToken, getText, isActive, onAttach, onBrowserEvent, setAccessKey, setActive, setBaseIcon, setCaret, setCustomIconStyle, setEmptyHref, setFocus, setHref, setIcon, setIconPosition, setIconSize, setName, setTabIndex, setTarget, setTargetHistoryToken, setTextadd, addStyle, insert, removeStyle, setHideOn, setShowOn, setStyleadd, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeadd, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfireEventclear, iterator, removepublic Button()
public Button(ClickHandler handler)
handler - Butotn ClickHandlerpublic Button(String caption)
caption - the caption of the Buttonpublic Button(String caption, ClickHandler handler)
caption - the caption of the Buttonhandler - Button Click Handlerpublic Button(String caption, IconType icon)
caption - the caption of the Buttonicon - the Icon on the caption's leftpublic Button(String caption, IconType icon, ClickHandler handler)
caption - the caption of the Buttonicon - the Icon on the caption's lefthandler - the ClickHandler of the Button.public void setType(ButtonType type)
Different types give the button a different look.
setType in interface HasType<ButtonType>type - the type of the Button.public void setSize(ButtonSize size)
size - the size of the Button.public boolean isEnabled()
A disabled widget cannot be used.
isEnabled in interface HasEnabledisEnabled in class IconAnchorfalse if the Button is disabled.public void setEnabled(boolean enabled)
A disabled widget cannot be used.
setEnabled in interface HasEnabledsetEnabled in class IconAnchorenabled - false if the Button should be disabled. Default:
truepublic void setToggle(boolean toggle)
toggle - true will enable this behavior.
false will disable it or do nothing if it never
was enabled.public boolean isToggle()
public boolean isToggled()
public void setLoadingText(String text)
text - Button.LoadingStateBehaviorpublic void setCompleteText(String text)
text - Button.LoadingStateBehaviorpublic Button.LoadingStateBehavior state()
public HandlerRegistration addClickHandler(ClickHandler handler)
addClickHandler in interface HasClickHandlersaddClickHandler in class IconAnchorpublic HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
addDoubleClickHandler in interface HasDoubleClickHandlerspublic HandlerRegistration addDragEndHandler(DragEndHandler handler)
addDragEndHandler in interface HasDragEndHandlerspublic HandlerRegistration addDragEnterHandler(DragEnterHandler handler)
addDragEnterHandler in interface HasDragEnterHandlerspublic HandlerRegistration addDragLeaveHandler(DragLeaveHandler handler)
addDragLeaveHandler in interface HasDragLeaveHandlerspublic HandlerRegistration addDragHandler(DragHandler handler)
addDragHandler in interface HasDragHandlerspublic HandlerRegistration addDragOverHandler(DragOverHandler handler)
addDragOverHandler in interface HasDragOverHandlerspublic HandlerRegistration addDragStartHandler(DragStartHandler handler)
addDragStartHandler in interface HasDragStartHandlerspublic HandlerRegistration addDropHandler(DropHandler handler)
addDropHandler in interface HasDropHandlerspublic HandlerRegistration addFocusHandler(FocusHandler handler)
addFocusHandler in interface HasFocusHandlerspublic HandlerRegistration addBlurHandler(BlurHandler handler)
addBlurHandler in interface HasBlurHandlerspublic HandlerRegistration addGestureStartHandler(GestureStartHandler handler)
addGestureStartHandler in interface HasGestureStartHandlerspublic HandlerRegistration addGestureChangeHandler(GestureChangeHandler handler)
addGestureChangeHandler in interface HasGestureChangeHandlerspublic HandlerRegistration addGestureEndHandler(GestureEndHandler handler)
addGestureEndHandler in interface HasGestureEndHandlerspublic HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
addKeyUpHandler in interface HasKeyUpHandlerspublic HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
addKeyDownHandler in interface HasKeyDownHandlerspublic HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
addKeyPressHandler in interface HasKeyPressHandlerspublic HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
addMouseDownHandler in interface HasMouseDownHandlersaddMouseDownHandler in class IconAnchorpublic HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
addMouseUpHandler in interface HasMouseUpHandlerspublic HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
addMouseOutHandler in interface HasMouseOutHandlerspublic HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
addMouseOverHandler in interface HasMouseOverHandlerspublic HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
addMouseMoveHandler in interface HasMouseMoveHandlerspublic HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
addMouseWheelHandler in interface HasMouseWheelHandlerspublic HandlerRegistration addTouchStartHandler(TouchStartHandler handler)
addTouchStartHandler in interface HasTouchStartHandlerspublic HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler)
addTouchMoveHandler in interface HasTouchMoveHandlerspublic HandlerRegistration addTouchEndHandler(TouchEndHandler handler)
addTouchEndHandler in interface HasTouchEndHandlerspublic HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler)
addTouchCancelHandler in interface HasTouchCancelHandlerspublic ButtonType getType()
public ButtonSize getSize()
public void setBlock(boolean block)
block - true:Block Level false:Defaultpublic void click()
public void setDismiss(DismissType type)
Modal or Alert.
UiBinder example:
<b:Modal>
<b:ModalFooter>
<b:Button text="Close" dismiss="MODAL"/>
</b:ModalFooter>
</b:Modal>
See Bootstrap documentation.type - Type of dismiss ("modal" or "alert")Copyright © 2012-2014 gwtbootstrap. All Rights Reserved.