|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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
public class ImageButton
An button widget with an image (with rollover and selection effects) and an
optional label. The primary style name of this widget is
"gwtutils-ImageButton"
. The dependent style names of the widget
are "rollover"
, "selected"
and
"disabled"
. The primary style name of the image is
"gwtutils-ImageButtonImage"
and the primary style name of the
label is "gwtutils-ImageButtonLabel"
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
ImageButton(AbstractImagePrototype image)
Creates an ImageButton with the specified image prototype, which
will be used for all button states (normal, rollover, selected,
disabled). |
|
ImageButton(AbstractImagePrototype normal,
AbstractImagePrototype rollover,
AbstractImagePrototype selected,
AbstractImagePrototype disabled)
Creates an ImageButton with images retrieved from the specified
image prototypes. |
|
ImageButton(ImageResource image)
Creates a new ImageButton with the specified image resource,
which will be used for all button states (normal, rollover, selected,
disabled). |
|
ImageButton(ImageResource normal,
ImageResource rollover,
ImageResource selected,
ImageResource disabled)
|
|
ImageButton(String image)
Creates an ImageButton with the specified image URL, which will
be used for all button states (normal, rollover, selected, disabled). |
|
ImageButton(String normal,
String rollover,
String selected,
String disabled)
Creates an ImageButton with images retrieved from the
specified URLs. |
Method Summary | |
---|---|
HandlerRegistration |
addClickHandler(ClickHandler handler)
Registers a handler for ClickEvent s. |
String |
getText()
Returns the text of the button. |
boolean |
isEnabled()
Returns the enabled state of the button. |
void |
onBrowserEvent(Event evt)
Prevent click events from being fired if the button is disabled. |
void |
setEnabled(boolean isEnabled)
Sets the enabled state of the button. |
void |
setText(String text)
Sets the text of the button. |
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 |
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 |
---|
public ImageButton(String image)
ImageButton
with the specified image URL, which will
be used for all button states (normal, rollover, selected, disabled).
public ImageButton(ImageResource image)
ImageButton
with the specified image resource,
which will be used for all button states (normal, rollover, selected,
disabled).
public ImageButton(AbstractImagePrototype image)
ImageButton
with the specified image prototype, which
will be used for all button states (normal, rollover, selected,
disabled).
public ImageButton(String normal, String rollover, String selected, String disabled)
ImageButton
with images retrieved from the
specified URLs.
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.public ImageButton(ImageResource normal, ImageResource rollover, ImageResource selected, ImageResource disabled)
public ImageButton(AbstractImagePrototype normal, AbstractImagePrototype rollover, AbstractImagePrototype selected, AbstractImagePrototype disabled)
ImageButton
with images retrieved from the specified
image prototypes.
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.Method Detail |
---|
public void setText(String text)
public String getText()
public void setEnabled(boolean isEnabled)
public boolean isEnabled()
public HandlerRegistration addClickHandler(ClickHandler handler)
ClickEvent
s.
addClickHandler
in interface HasClickHandlers
public void onBrowserEvent(Event evt)
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Composite
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |