|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WWebWidget
eu.webtoolkit.jwt.WInteractWidget
eu.webtoolkit.jwt.WFormWidget
eu.webtoolkit.jwt.WPushButton
public class WPushButton
A widget that represents a push button.
To act on a button click, connect a slot to the
WInteractWidget#clicked() signal.
WPushButton is an inline widget.
The widget corresponds to the HTML <button> tag and has
the Wt-btn style. It may be styled through the current theme, or
you can override the style using internal or external CSS as appropriate.
| Constructor Summary | |
|---|---|
WPushButton()
Creates a push button. |
|
WPushButton(java.lang.CharSequence text)
Creates a push button with given label text. |
|
WPushButton(java.lang.CharSequence text,
WContainerWidget parent)
Creates a push button with given label text. |
|
WPushButton(WContainerWidget parent)
Creates a push button. |
|
| Method Summary | |
|---|---|
WLink |
getIcon()
Returns the icon. |
WLink |
getLink()
Returns the destination link. |
AnchorTarget |
getLinkTarget()
Returns the location where the linked content should be displayed. |
java.lang.String |
getRef()
Deprecated. Use getLink() instead. |
WResource |
getResource()
Deprecated. Use getLink() instead. |
WString |
getText()
Returns the button text. |
java.lang.String |
getValueText()
Returns the current value. |
void |
refresh()
Refresh the widget. |
void |
remove()
Destructor. |
void |
setIcon(WLink link)
Sets an icon. |
void |
setLink(WLink link)
Sets a destination link. |
void |
setLinkTarget(AnchorTarget target)
Sets the link target. |
void |
setRef(java.lang.String url)
Deprecated. Use setLink()
insteadd. |
void |
setResource(WResource resource)
Deprecated. Use setLink()
instead. |
void |
setText(java.lang.CharSequence text)
Sets the button text. |
void |
setValueText(java.lang.String value)
Sets the current value. |
| Methods inherited from class eu.webtoolkit.jwt.WFormWidget |
|---|
blurred, changed, enableAjax, focussed, getEmptyText, getLabel, getTabIndex, getValidator, hasFocus, isReadOnly, propagateSetEnabled, render, selected, setEmptyText, setEnabled, setFocus, setFocus, setHidden, setReadOnly, setTabIndex, setValidator, validate, validated |
| Methods inherited from class eu.webtoolkit.jwt.WInteractWidget |
|---|
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, touchEnded, touchMoved, touchStarted |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WPushButton(WContainerWidget parent)
public WPushButton()
Calls this((WContainerWidget)null)
public WPushButton(java.lang.CharSequence text,
WContainerWidget parent)
public WPushButton(java.lang.CharSequence text)
Calls this(text, (WContainerWidget)null)
| Method Detail |
|---|
public void remove()
WFormWidget
If a label was associated with the widget, its buddy is reset to
null.
remove in class WFormWidgetWContainerWidget.removeWidget(WWidget widget)public void setText(java.lang.CharSequence text)
public WString getText()
setText(CharSequence text)public void setIcon(WLink link)
The icon is placed to the left of the text.
public WLink getIcon()
setIcon(WLink link)public void setLink(WLink link)
This method can be used to make the button behave like a WAnchor
(or conversely, an anchor look like a button) and redirect to another URL
when clicked.
The link may be to a URL, a resource, or an internal path.
By default, a button does not link to an URL and you should listen to the
WInteractWidget#clicked() signal to
react to a click event.
public WLink getLink()
setLink(WLink link)public void setRef(java.lang.String url)
setLink()
insteadd.
public java.lang.String getRef()
getLink() instead.
When the button refers to a resource, the current resource URL is
returned. Otherwise, the URL is returned that was set using
setRef().
setRef(String url),
WResource.getUrl()public void setResource(WResource resource)
setLink()
instead.
This method can be used to make the button behave like a WAnchor
(or conversely, an anchor look like a button) and redirect to another
resource when clicked.
A resource specifies application-dependent content, which may be generated by your application on demand.
This sets the resource as the destination of the button, and
is an alternative to setRef(). The
resource may be cleared by passing resource =
null.
The button does not assume ownership of the resource.
setRef(String url)public WResource getResource()
getLink() instead.
Returns null if no resource has been set.
setResource(WResource resource)public java.lang.String getValueText()
Returns an empty string, since a button has no value.
getValueText in class WFormWidgetpublic void setValueText(java.lang.String value)
Has no effect, since a button has not value.
setValueText in class WFormWidgetpublic void setLinkTarget(AnchorTarget target)
This sets the target where the linked contents should be displayed. The default target is TargetSelf.
public AnchorTarget getLinkTarget()
setLinkTarget(AnchorTarget target)public void refresh()
WWidget
The refresh method is invoked when the locale is changed using
WApplication#setLocale() or
when the user hit the refresh button.
The widget must actualize its contents in response.
refresh in class WFormWidget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||