public class Button extends IconAnchor implements com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasDoubleClickHandlers, com.google.gwt.user.client.ui.HasEnabled, HasType<ButtonType>, com.google.gwt.event.dom.client.HasAllDragAndDropHandlers, com.google.gwt.event.dom.client.HasAllFocusHandlers, com.google.gwt.event.dom.client.HasAllGestureHandlers, com.google.gwt.event.dom.client.HasAllKeyHandlers, com.google.gwt.event.dom.client.HasAllMouseHandlers, com.google.gwt.event.dom.client.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.
|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabledicon| Constructor and Description |
|---|
Button()
Creates an empty Button.
|
Button(com.google.gwt.event.dom.client.ClickHandler handler)
Creates an Button with ClickHandler
|
Button(String caption)
Creates a Button with the given caption.
|
Button(String caption,
com.google.gwt.event.dom.client.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,
com.google.gwt.event.dom.client.ClickHandler handler)
Creates a Button with the given caption and icon and ClickHandler.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addBlurHandler(com.google.gwt.event.dom.client.BlurHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragEndHandler(com.google.gwt.event.dom.client.DragEndHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragEnterHandler(com.google.gwt.event.dom.client.DragEnterHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragHandler(com.google.gwt.event.dom.client.DragHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragLeaveHandler(com.google.gwt.event.dom.client.DragLeaveHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragOverHandler(com.google.gwt.event.dom.client.DragOverHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragStartHandler(com.google.gwt.event.dom.client.DragStartHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDropHandler(com.google.gwt.event.dom.client.DropHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addGestureChangeHandler(com.google.gwt.event.dom.client.GestureChangeHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addGestureEndHandler(com.google.gwt.event.dom.client.GestureEndHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addGestureStartHandler(com.google.gwt.event.dom.client.GestureStartHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addKeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addKeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addTouchCancelHandler(com.google.gwt.event.dom.client.TouchCancelHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addTouchEndHandler(com.google.gwt.event.dom.client.TouchEndHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addTouchMoveHandler(com.google.gwt.event.dom.client.TouchMoveHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addTouchStartHandler(com.google.gwt.event.dom.client.TouchStartHandler handler) |
void |
click()
Programmatic equivalent of the user clicking the button.
|
ButtonSize |
getSize()
Get Button Size
|
ButtonType |
getType()
Get Button Type
|
boolean |
isEnabled()
Whether the Button is enabled or disabled.
|
boolean |
isToggle()
Verify if the property "toggle" is set.
|
boolean |
isToggled()
Verify if the button is toggled.
|
void |
setBlock(boolean block)
Set element as a Block Level Button
|
void |
setCompleteText(String text)
Set a Loading Text to show when some action are completed with this
button.
|
void |
setDismiss(DismissType type)
|
void |
setEnabled(boolean enabled)
Sets whether the Button is enabled or disabled.
|
void |
setLoadingText(String text)
Set a Loading Text to show when some action are in work with this button.
|
void |
setSize(ButtonSize size)
Sets the size of the Button.
|
void |
setToggle(boolean toggle)
Enable ou disable the data-toggle behavior.
|
void |
setType(ButtonType type)
Sets the type of the Button.
|
Button.LoadingStateBehavior |
state()
A simple DSL to change the button state to loading, complete, or reset
it.
|
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, setParent, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventspublic Button()
public Button(com.google.gwt.event.dom.client.ClickHandler handler)
handler - Butotn ClickHandlerpublic Button(String caption)
caption - the caption of the Buttonpublic Button(String caption, com.google.gwt.event.dom.client.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 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 com.google.gwt.user.client.ui.HasEnabledisEnabled in class IconAnchorfalse if the Button is disabled.public void setEnabled(boolean enabled)
A disabled widget cannot be used.
setEnabled in interface com.google.gwt.user.client.ui.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 com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlersaddClickHandler in class IconAnchorpublic com.google.gwt.event.shared.HandlerRegistration addDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler handler)
addDoubleClickHandler in interface com.google.gwt.event.dom.client.HasDoubleClickHandlerspublic com.google.gwt.event.shared.HandlerRegistration addDragEndHandler(com.google.gwt.event.dom.client.DragEndHandler handler)
addDragEndHandler in interface com.google.gwt.event.dom.client.HasDragEndHandlerspublic com.google.gwt.event.shared.HandlerRegistration addDragEnterHandler(com.google.gwt.event.dom.client.DragEnterHandler handler)
addDragEnterHandler in interface com.google.gwt.event.dom.client.HasDragEnterHandlerspublic com.google.gwt.event.shared.HandlerRegistration addDragLeaveHandler(com.google.gwt.event.dom.client.DragLeaveHandler handler)
addDragLeaveHandler in interface com.google.gwt.event.dom.client.HasDragLeaveHandlerspublic com.google.gwt.event.shared.HandlerRegistration addDragHandler(com.google.gwt.event.dom.client.DragHandler handler)
addDragHandler in interface com.google.gwt.event.dom.client.HasDragHandlerspublic com.google.gwt.event.shared.HandlerRegistration addDragOverHandler(com.google.gwt.event.dom.client.DragOverHandler handler)
addDragOverHandler in interface com.google.gwt.event.dom.client.HasDragOverHandlerspublic com.google.gwt.event.shared.HandlerRegistration addDragStartHandler(com.google.gwt.event.dom.client.DragStartHandler handler)
addDragStartHandler in interface com.google.gwt.event.dom.client.HasDragStartHandlerspublic com.google.gwt.event.shared.HandlerRegistration addDropHandler(com.google.gwt.event.dom.client.DropHandler handler)
addDropHandler in interface com.google.gwt.event.dom.client.HasDropHandlerspublic com.google.gwt.event.shared.HandlerRegistration addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
addFocusHandler in interface com.google.gwt.event.dom.client.HasFocusHandlerspublic com.google.gwt.event.shared.HandlerRegistration addBlurHandler(com.google.gwt.event.dom.client.BlurHandler handler)
addBlurHandler in interface com.google.gwt.event.dom.client.HasBlurHandlerspublic com.google.gwt.event.shared.HandlerRegistration addGestureStartHandler(com.google.gwt.event.dom.client.GestureStartHandler handler)
addGestureStartHandler in interface com.google.gwt.event.dom.client.HasGestureStartHandlerspublic com.google.gwt.event.shared.HandlerRegistration addGestureChangeHandler(com.google.gwt.event.dom.client.GestureChangeHandler handler)
addGestureChangeHandler in interface com.google.gwt.event.dom.client.HasGestureChangeHandlerspublic com.google.gwt.event.shared.HandlerRegistration addGestureEndHandler(com.google.gwt.event.dom.client.GestureEndHandler handler)
addGestureEndHandler in interface com.google.gwt.event.dom.client.HasGestureEndHandlerspublic com.google.gwt.event.shared.HandlerRegistration addKeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler handler)
addKeyUpHandler in interface com.google.gwt.event.dom.client.HasKeyUpHandlerspublic com.google.gwt.event.shared.HandlerRegistration addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler handler)
addKeyDownHandler in interface com.google.gwt.event.dom.client.HasKeyDownHandlerspublic com.google.gwt.event.shared.HandlerRegistration addKeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler handler)
addKeyPressHandler in interface com.google.gwt.event.dom.client.HasKeyPressHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler)
addMouseDownHandler in interface com.google.gwt.event.dom.client.HasMouseDownHandlersaddMouseDownHandler in class IconAnchorpublic com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler handler)
addMouseUpHandler in interface com.google.gwt.event.dom.client.HasMouseUpHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler)
addMouseOutHandler in interface com.google.gwt.event.dom.client.HasMouseOutHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler)
addMouseOverHandler in interface com.google.gwt.event.dom.client.HasMouseOverHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler handler)
addMouseMoveHandler in interface com.google.gwt.event.dom.client.HasMouseMoveHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler handler)
addMouseWheelHandler in interface com.google.gwt.event.dom.client.HasMouseWheelHandlerspublic com.google.gwt.event.shared.HandlerRegistration addTouchStartHandler(com.google.gwt.event.dom.client.TouchStartHandler handler)
addTouchStartHandler in interface com.google.gwt.event.dom.client.HasTouchStartHandlerspublic com.google.gwt.event.shared.HandlerRegistration addTouchMoveHandler(com.google.gwt.event.dom.client.TouchMoveHandler handler)
addTouchMoveHandler in interface com.google.gwt.event.dom.client.HasTouchMoveHandlerspublic com.google.gwt.event.shared.HandlerRegistration addTouchEndHandler(com.google.gwt.event.dom.client.TouchEndHandler handler)
addTouchEndHandler in interface com.google.gwt.event.dom.client.HasTouchEndHandlerspublic com.google.gwt.event.shared.HandlerRegistration addTouchCancelHandler(com.google.gwt.event.dom.client.TouchCancelHandler handler)
addTouchCancelHandler in interface com.google.gwt.event.dom.client.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 © 2016. All rights reserved.