com.maryanovsky.gwtutils.client.ui
Class ToggleImageButton
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
com.maryanovsky.gwtutils.client.ui.ImageButton
com.maryanovsky.gwtutils.client.ui.ToggleImageButton
- All Implemented Interfaces:
- HasClickHandlers, HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsRenderable, IsWidget
public class ToggleImageButton
- extends ImageButton
A toggle button based on the ImageButton
class.
The primary style name for this widget is
"gwtutils-ToggleImageButton"
. Toggled buttons
have a dependent style name of "toggled"
.
- Author:
- Maryanovsky Alexander
Constructor Summary |
ToggleImageButton(AbstractImagePrototype image)
Creates a new ToggleImageButton with the specified image
prototype, which will be used for all button states (normal, rollover,
selected, disabled). |
ToggleImageButton(AbstractImagePrototype normal,
AbstractImagePrototype rollover,
AbstractImagePrototype selected,
AbstractImagePrototype disabled)
Creates an ImageButton with images retrieved from the specified
image prototypes. |
ToggleImageButton(String image)
Creates a ToggleImageButton with the specified image URL, which
will be used for all button states (normal, rollover, selected, disabled). |
ToggleImageButton(String normal,
String rollover,
String selected,
String disabled)
Creates a ToggleImageButton with images retrieved from the
specified URLs. |
Method Summary |
boolean |
isToggled()
Returns whether this button is currently toggled. |
void |
setToggled(boolean isToggled)
Sets this button's toggled state. |
Methods inherited from class com.google.gwt.user.client.ui.Composite |
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onDetach, render, render, resolvePotentialElement, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
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, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
ToggleImageButton
public ToggleImageButton(String image)
- Creates a
ToggleImageButton
with the specified image URL, which
will be used for all button states (normal, rollover, selected, disabled).
ToggleImageButton
public ToggleImageButton(AbstractImagePrototype image)
- Creates a new
ToggleImageButton
with the specified image
prototype, which will be used for all button states (normal, rollover,
selected, disabled).
ToggleImageButton
public ToggleImageButton(String normal,
String rollover,
String selected,
String disabled)
- Creates a
ToggleImageButton
with images retrieved from the
specified URLs.
- Parameters:
normal
- The location of the normal image.rollover
- The location of the image to display when the mouse
is over the widget. If null
, defaults to the normal image.selected
- The location of the image to display when the button
is pressed. If null
, defaults to the rollover image.disabled
- The location of the image to display when disabled.
If null
, defaults to the normal image.
ToggleImageButton
public ToggleImageButton(AbstractImagePrototype normal,
AbstractImagePrototype rollover,
AbstractImagePrototype selected,
AbstractImagePrototype disabled)
- Creates an
ImageButton
with images retrieved from the specified
image prototypes.
- Parameters:
normal
- The prototype of the normal image.rollover
- The prototype of the image to display when the mouse
is over the widget. If null
, defaults to the normal image.selected
- The prototype of the image to display when the button
is pressed. If null
, defaults to the rollover image.disabled
- The prototype of the image to display when disabled.
If null
, defaults to the normal image.
setToggled
public void setToggled(boolean isToggled)
- Sets this button's toggled state.
isToggled
public boolean isToggled()
- Returns whether this button is currently toggled.