C
- the data type of the button's contentspublic class ButtonBase<C> extends CellWidget<C> implements HasEnabled, Focusable, IsCollapsible, HasAllFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasClickHandlers, HasAllKeyHandlers
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEBUG_ID_PREFIX
Modifier | Constructor and Description |
---|---|
protected |
ButtonBase(ButtonCellBase<C> cell)
Construct a new
ButtonBase with the specified cell and an initial
value of null . |
protected |
ButtonBase(ButtonCellBase<C> cell,
C initialValue)
Construct a new
ButtonBase with the specified cell and initial
value. |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addBlurHandler(BlurHandler handler)
Adds a
BlurEvent handler. |
HandlerRegistration |
addClickHandler(ClickHandler handler)
Adds a
ClickEvent handler. |
HandlerRegistration |
addFocusHandler(FocusHandler handler)
Adds a
FocusEvent handler. |
HandlerRegistration |
addKeyDownHandler(KeyDownHandler handler)
Adds a
KeyDownEvent handler. |
HandlerRegistration |
addKeyPressHandler(KeyPressHandler handler)
Adds a
KeyPressEvent handler. |
HandlerRegistration |
addKeyUpHandler(KeyUpHandler handler)
Adds a
KeyUpEvent handler. |
HandlerRegistration |
addMouseDownHandler(MouseDownHandler handler)
Adds a
MouseDownEvent handler. |
HandlerRegistration |
addMouseOutHandler(MouseOutHandler handler)
Adds a
MouseOutEvent handler. |
HandlerRegistration |
addMouseOverHandler(MouseOverHandler handler)
Adds a
MouseOverEvent handler. |
HandlerRegistration |
addMouseUpHandler(MouseUpHandler handler)
Adds a
MouseUpEvent handler. |
ButtonCellBase.Decoration |
getDecoration()
Get the decoration style of the button.
|
int |
getTabIndex()
Gets the widget's position in the tab index.
|
boolean |
isCollapseLeft()
Check whether or not the left-side of the UI component is collapsed
(sharing border with the component to its left).
|
boolean |
isCollapseRight()
right Check whether or not the left-side of the UI component is collapsed
(sharing border with the component to its left).
|
boolean |
isEnabled()
Returns true if the widget is enabled, false if not.
|
void |
setAccessKey(char key)
Sets the widget's 'access key'.
|
void |
setCollapseLeft(boolean isCollapsed)
Sets whether the left-side of the UI component is collapsed (sharing border
with the component to its left).
|
void |
setCollapseRight(boolean isCollapsed)
Sets whether the right-side of the UI component is collapsed (sharing
border with the component to its right).
|
void |
setDecoration(ButtonCellBase.Decoration decoration)
Set the
ButtonCellBase.Decoration of the button. |
void |
setEnabled(boolean enabled)
Sets whether this widget is enabled.
|
void |
setFocus(boolean focused)
Explicitly focus/unfocus this widget.
|
void |
setTabIndex(int index)
Sets the widget's position in the tab index.
|
addValueChangeHandler, asEditor, getCell, getKeyProvider, getValue, onBrowserEvent, redraw, setValue, setValue, setValue
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, 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
fireEvent
protected ButtonBase(ButtonCellBase<C> cell)
ButtonBase
with the specified cell and an initial
value of null
.cell
- the cell to wrapprotected ButtonBase(ButtonCellBase<C> cell, C initialValue)
ButtonBase
with the specified cell and initial
value.cell
- the cell to wrapinitialValue
- the initial value of the Cellpublic HandlerRegistration addBlurHandler(BlurHandler handler)
HasBlurHandlers
BlurEvent
handler.addBlurHandler
in interface HasBlurHandlers
handler
- the blur handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addClickHandler(ClickHandler handler)
HasClickHandlers
ClickEvent
handler.addClickHandler
in interface HasClickHandlers
handler
- the click handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addFocusHandler(FocusHandler handler)
HasFocusHandlers
FocusEvent
handler.addFocusHandler
in interface HasFocusHandlers
handler
- the focus handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
HasKeyDownHandlers
KeyDownEvent
handler.addKeyDownHandler
in interface HasKeyDownHandlers
handler
- the key down handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
HasKeyPressHandlers
KeyPressEvent
handler.addKeyPressHandler
in interface HasKeyPressHandlers
handler
- the key press handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
HasKeyUpHandlers
KeyUpEvent
handler.addKeyUpHandler
in interface HasKeyUpHandlers
handler
- the key up handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
HasMouseDownHandlers
MouseDownEvent
handler.addMouseDownHandler
in interface HasMouseDownHandlers
handler
- the mouse down handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
HasMouseOutHandlers
MouseOutEvent
handler.addMouseOutHandler
in interface HasMouseOutHandlers
handler
- the mouse out handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
HasMouseOverHandlers
MouseOverEvent
handler.addMouseOverHandler
in interface HasMouseOverHandlers
handler
- the mouse over handlerHandlerRegistration
used to remove this handlerpublic HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
HasMouseUpHandlers
MouseUpEvent
handler.addMouseUpHandler
in interface HasMouseUpHandlers
handler
- the mouse up handlerHandlerRegistration
used to remove this handlerpublic ButtonCellBase.Decoration getDecoration()
public int getTabIndex()
Focusable
getTabIndex
in interface Focusable
public boolean isCollapseLeft()
IsCollapsible
isCollapseLeft
in interface IsCollapsible
public boolean isCollapseRight()
IsCollapsible
isCollapseRight
in interface IsCollapsible
public boolean isEnabled()
HasEnabled
isEnabled
in interface HasEnabled
public void setAccessKey(char key)
Focusable
setAccessKey
in interface Focusable
key
- the widget's access keypublic void setCollapseLeft(boolean isCollapsed)
IsCollapsible
setCollapseLeft
in interface IsCollapsible
isCollapsed
- true if collapsed, false if notpublic void setCollapseRight(boolean isCollapsed)
IsCollapsible
setCollapseRight
in interface IsCollapsible
isCollapsed
- true if collapsed, false if notpublic void setDecoration(ButtonCellBase.Decoration decoration)
ButtonCellBase.Decoration
of the button.decoration
- the button decorationpublic void setEnabled(boolean enabled)
HasEnabled
setEnabled
in interface HasEnabled
enabled
- true
to enable the widget, false
to disable itpublic void setFocus(boolean focused)
Focusable
public void setTabIndex(int index)
Focusable
-1
will cause this widget to
be removed from the tab order.setTabIndex
in interface Focusable
index
- the widget's tab indexCopyright © 2018. All rights reserved.