org.gwtbootstrap3.client.ui.base.button
Class AbstractButton

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.user.client.ui.ComplexPanel
                  extended by org.gwtbootstrap3.client.ui.base.ComplexWidget
                      extended by org.gwtbootstrap3.client.ui.base.button.AbstractButton
All Implemented Interfaces:
HasAllMouseHandlers, HasClickHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasAttachHandlers, HasHandlers, EventListener, Focusable, HasEnabled, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, Iterable<Widget>, HasActive, HasDataTarget, HasId, HasInlineStyle, HasPull, HasResponsiveness, HasSize<ButtonSize>, HasType<ButtonType>
Direct Known Subclasses:
AbstractIconButton, CloseButton

public abstract class AbstractButton
extends ComplexWidget
implements HasEnabled, HasActive, HasType<ButtonType>, HasSize<ButtonSize>, HasDataTarget, HasClickHandlers, Focusable, HasAllMouseHandlers

Abstract base class for different kinds of buttons.

Author:
Sven Jacobs, Joshua Godi

Nested Class Summary
 class AbstractButton.ButtonStateHandler
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
protected AbstractButton()
          Creates button with DEFAULT type.
protected AbstractButton(ButtonType type)
           
 
Method Summary
 HandlerRegistration addClickHandler(ClickHandler handler)
           
 HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
           
 HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
           
 HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
           
 HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
           
 HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
           
 HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
           
 void click()
           
protected abstract  Element createElement()
           
 String getDataTarget()
          Gets the data target of the widget
 ButtonSize getSize()
          Get the size of the widget
 int getTabIndex()
           
 ButtonType getType()
          Gets the type of the widget
 boolean isActive()
          Gets whether or not the widget has the active styles
 boolean isEnabled()
           
 void setAccessKey(char key)
           
 void setActive(boolean active)
          Sets the widget with the active styles or not
 void setBlock(boolean block)
          Makes button a block level element that spawns full width of parent.
 void setDataDismiss(ButtonDismiss dismiss)
          Sets dismiss type of button.
 void setDataLoadingText(String loadingText)
           
 void setDataTarget(String dataTarget)
          Sets the data target for the widget
 void setDataTargetWidget(Widget widget)
           
 void setDataTargetWidgets(List<Widget> widgets)
           
 void setEnabled(boolean enabled)
           
 void setFocus(boolean focused)
           
 void setSize(ButtonSize size)
          Sets size of button.
 void setTabIndex(int index)
           
 void setType(ButtonType type)
          Sets type of button.
 AbstractButton.ButtonStateHandler state()
           
 void toggle()
           
 
Methods inherited from class org.gwtbootstrap3.client.ui.base.ComplexWidget
add, getId, getPull, insert, setColor, setHiddenOn, setId, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPull, setVisibleOn
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

AbstractButton

protected AbstractButton()
Creates button with DEFAULT type.


AbstractButton

protected AbstractButton(ButtonType type)
Method Detail

isActive

public boolean isActive()
Description copied from interface: HasActive
Gets whether or not the widget has the active styles

Specified by:
isActive in interface HasActive
Returns:
true=has active styles, false=does not have active styles

setActive

public void setActive(boolean active)
Description copied from interface: HasActive
Sets the widget with the active styles or not

Specified by:
setActive in interface HasActive
Parameters:
active - true=gets active styles, false=removes active styles

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface HasEnabled

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface HasEnabled

addClickHandler

public HandlerRegistration addClickHandler(ClickHandler handler)
Specified by:
addClickHandler in interface HasClickHandlers

setType

public void setType(ButtonType type)
Sets type of button.

Specified by:
setType in interface HasType<ButtonType>
Parameters:
type - Type of button

getType

public ButtonType getType()
Description copied from interface: HasType
Gets the type of the widget

Specified by:
getType in interface HasType<ButtonType>
Returns:
type of the widget

setSize

public void setSize(ButtonSize size)
Sets size of button.

Specified by:
setSize in interface HasSize<ButtonSize>
Parameters:
size - Size of button

getSize

public ButtonSize getSize()
Description copied from interface: HasSize
Get the size of the widget

Specified by:
getSize in interface HasSize<ButtonSize>
Returns:
T size of the widget

setDataTargetWidgets

public void setDataTargetWidgets(List<Widget> widgets)
Specified by:
setDataTargetWidgets in interface HasDataTarget

setDataTargetWidget

public void setDataTargetWidget(Widget widget)
Specified by:
setDataTargetWidget in interface HasDataTarget

setDataTarget

public void setDataTarget(String dataTarget)
Description copied from interface: HasDataTarget
Sets the data target for the widget

Specified by:
setDataTarget in interface HasDataTarget
Parameters:
dataTarget - data target string

getDataTarget

public String getDataTarget()
Description copied from interface: HasDataTarget
Gets the data target of the widget

Specified by:
getDataTarget in interface HasDataTarget
Returns:
data target

getTabIndex

public int getTabIndex()
Specified by:
getTabIndex in interface Focusable

setAccessKey

public void setAccessKey(char key)
Specified by:
setAccessKey in interface Focusable

setFocus

public void setFocus(boolean focused)
Specified by:
setFocus in interface Focusable

setTabIndex

public void setTabIndex(int index)
Specified by:
setTabIndex in interface Focusable

addMouseDownHandler

public HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
Specified by:
addMouseDownHandler in interface HasMouseDownHandlers

addMouseMoveHandler

public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
Specified by:
addMouseMoveHandler in interface HasMouseMoveHandlers

addMouseOutHandler

public HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
Specified by:
addMouseOutHandler in interface HasMouseOutHandlers

addMouseOverHandler

public HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
Specified by:
addMouseOverHandler in interface HasMouseOverHandlers

addMouseUpHandler

public HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
Specified by:
addMouseUpHandler in interface HasMouseUpHandlers

addMouseWheelHandler

public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
Specified by:
addMouseWheelHandler in interface HasMouseWheelHandlers

setBlock

public void setBlock(boolean block)
Makes button a block level element that spawns full width of parent.

Parameters:
block - True for block level element

setDataDismiss

public void setDataDismiss(ButtonDismiss dismiss)
Sets dismiss type of button.

If button is inside a Modal and dismiss type is MODAL the button will act as the dismiss (close) button for this Modal. Same goes for Alert and dismiss type ALERT.

Parameters:
dismiss - Dismiss type of button
See Also:
Modal, Alert

setDataLoadingText

public void setDataLoadingText(String loadingText)

toggle

public void toggle()

state

public AbstractButton.ButtonStateHandler state()

click

public void click()

createElement

protected abstract Element createElement()


Copyright © 2015. All rights reserved.