public class Button extends com.google.gwt.user.client.ui.Button implements HasRipple, IUpgrade
Button
can take many shapes. Its appearance is controlled
by a handful of properties but not all are available at the same time. For
example a Fab button can't have all the colors available for a Raised button.
Thereby, a button should not be setup using its constructor. Instead a
builder was implemented to assist in setting up the appropriate options for
the button.Constructor and Description |
---|
Button()
Setup an instance by applying the basic properties shared by all material
buttons.
|
Modifier and Type | Method and Description |
---|---|
static Button |
createFab(ButtonColor color,
Ripple ripple,
String icon)
Setup a fab material button.
|
static Button |
createFlat(ButtonColor color,
Ripple ripple,
String text)
A flat button is very similar to a raised button.
|
static Button |
createIcon(ButtonColor color,
Ripple ripple,
String icon)
Setup an icon material button.
|
static Button |
createMiniFab(ButtonColor color,
Ripple ripple,
String icon)
Setup a mini fab material button.
|
static Button |
createRaised(ButtonColor color,
Ripple ripple,
String text)
Setup a raised material button.
A raised button is a rectangular and elevated button that has a text for content. |
ButtonColor |
getColor() |
Ripple |
getRipple()
Returns whether this component have a ripple.
|
String |
getText() |
ButtonType |
getType() |
boolean |
isUpgraded() |
void |
setColor(ButtonColor inputColor) |
void |
setIcon(String icon) |
void |
setRipple(Ripple inputRipple)
indicate whether this component should have a ripple.
|
void |
setText(String text) |
void |
setType(ButtonType inputType) |
void |
upgrade()
Causes the component to be upgraded.
|
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, 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
public Button()
public static Button createRaised(ButtonColor color, Ripple ripple, String text)
color
- the background color, should be one of the options provided by
ButtonColor
ripple
- determines whether the button has a ripple, should be one of the
options provided by Ripple
text
- a text for the buttonpublic static Button createFlat(ButtonColor color, Ripple ripple, String text)
color
- The text color should be one of the options provided by
ButtonColor
ripple
- determines whether the button has a ripple, should be one of the
options provided by Ripple
text
- a text for the buttonpublic static Button createFab(ButtonColor color, Ripple ripple, String icon)
color
- the background color, should be one of the options provided by
ButtonColor
ripple
- determines whether the button has a ripple, one of the options
provided by Ripple
icon
- a material icon font codepublic static Button createIcon(ButtonColor color, Ripple ripple, String icon)
color
- the icon color. Should be one of the options provided by
ButtonColor
ripple
- determines whether the button has a ripple, one of the options
provided by Ripple
icon
- a material icon font codepublic static Button createMiniFab(ButtonColor color, Ripple ripple, String icon)
color
- the background color, should be one of the options provided by
ButtonColor
ripple
- determines whether the button has a ripple, one of the options
provided by Ripple
icon
- a material icon font codepublic final void setIcon(String icon)
icon
- a material icon font codeButtonBase.setIcon(String)
public final ButtonType getType()
ButtonType
ButtonBase.getType()
public final void setType(ButtonType inputType)
inputType
- one of the options provided by ButtonType
ButtonBase.setType(ButtonType)
public final ButtonColor getColor()
ButtonColor
ButtonBase.getColor()
public final void setColor(ButtonColor inputColor)
inputColor
- one of the options provided by ButtonColor
ButtonBase.setColor(ButtonColor)
public final Ripple getRipple()
HasRipple
getRipple
in interface HasRipple
Ripple
ButtonBase.getRipple()
public final void setRipple(Ripple inputRipple)
HasRipple
setRipple
in interface HasRipple
inputRipple
- one of the options provided by Ripple
ButtonBase.setRipple(Ripple)
public final void setText(String text)
setText
in interface com.google.gwt.user.client.ui.HasText
setText
in class com.google.gwt.user.client.ui.ButtonBase
text
- the text to be set for the buttonButtonBase.setText(String)
public final String getText()
getText
in interface com.google.gwt.user.client.ui.HasText
getText
in class com.google.gwt.user.client.ui.ButtonBase
ButtonBase.getText()
public final void upgrade()
IUpgrade
public boolean isUpgraded()
isUpgraded
in interface IUpgrade
Copyright © 2016 com.github.ilyes4j. All rights reserved.