|
||||||||||
| 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 (with some
exceptions in the bootstrap theme).
| Field Summary |
|---|
| Fields inherited from class eu.webtoolkit.jwt.WWidget |
|---|
WT_GETPS_JS |
| 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 | |
|---|---|
EventSignal |
checked()
Signal emitted when the button gets checked. |
WLink |
getIcon()
Returns the icon. |
WLink |
getLink()
Returns the destination link. |
AnchorTarget |
getLinkTarget()
Returns the location where the linked content should be displayed. |
WPopupMenu |
getMenu()
|
java.lang.String |
getRef()
Deprecated. Use getLink() instead. |
WResource |
getResource()
Deprecated. Use getLink() instead. |
WString |
getText()
Returns the button text. |
TextFormat |
getTextFormat()
Returns the text format. |
java.lang.String |
getValueText()
Returns the current value. |
boolean |
isCheckable()
Returns whether a button is checkable. |
boolean |
isChecked()
Returns the button state. |
boolean |
isDefault()
Returns whether the button is a default button. |
void |
refresh()
Refresh the widget. |
void |
remove()
Destructor. |
void |
setCheckable(boolean checkable)
Sets whether the button is checkable. |
void |
setChecked()
Checks the button. |
void |
setChecked(boolean checked)
Sets the button state. |
void |
setDefault(boolean enabled)
Sets the default property. |
void |
setIcon(WLink link)
Sets an icon. |
void |
setLink(WLink link)
Sets a destination link. |
void |
setLinkTarget(AnchorTarget target)
Sets the link target. |
void |
setMenu(WPopupMenu popupMenu)
|
void |
setRef(java.lang.String url)
Deprecated. Use setLink()
insteadd. |
void |
setResource(WResource resource)
Deprecated. Use setLink()
instead. |
boolean |
setText(java.lang.CharSequence text)
Sets the button text. |
boolean |
setTextFormat(TextFormat textFormat)
Sets the text format. |
void |
setUnChecked()
Unchecks the button. |
void |
setValueText(java.lang.String value)
Sets the current value. |
EventSignal |
unChecked()
Signal emitted when the button gets unchecked. |
| 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, setToolTip, setValidator, validate, validated |
| Methods inherited from class eu.webtoolkit.jwt.WInteractWidget |
|---|
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, touchEnded, touchMoved, touchStarted |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isExposed, isLayoutSizeAware, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, scheduleRender, scheduleRerender, 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)
The default text format is PlainText.
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 setDefault(boolean enabled)
The only effect of a default button is that it is may be rendered in a different style, depending on the theme.
public boolean isDefault()
setDefault(boolean enabled)public void setCheckable(boolean checkable)
A checkable button can be checked and unchecked, and clicking will toggle between these two states.
setChecked(boolean checked)public boolean isCheckable()
setCheckable(boolean checkable)public void setChecked(boolean checked)
This is ignored for a button which is not checkable.
This method does not emit one of the checked() or unChecked() signals.
setCheckable(boolean checkable),
setChecked(),
setUnChecked()public void setChecked()
Does not emit the checked() signal.
setChecked(boolean checked)public void setUnChecked()
Does not emit the unChecked() signal.
setChecked(boolean checked)public boolean isChecked()
setChecked()public boolean setText(java.lang.CharSequence text)
The default text format is TextFormat.PlainText.
When the current text format is TextFormat.XHTMLText, and
text is literal (not created using ), it is parsed
using an XML parser which discards malicious tags and attributes
silently. When the parser encounters an XML parse error, the textFormat
is changed to TextFormat.PlainText.
Returns whether the text could be set using the current textFormat. A
return value of false indicates that the text format was
changed in order to be able to accept the new text.
setTextFormat(TextFormat textFormat)public WString getText()
setText(CharSequence text)public boolean setTextFormat(TextFormat textFormat)
The textFormat controls how the string should be interpreted: either as plain text, which is displayed literally, or as XHTML-markup.
When changing the textFormat to TextFormat.XHTMLText, and the
current text is literal (not created using ), the current text is
parsed using an XML parser which discards malicious tags and attributes
silently. When the parser encounters an XML parse error, the textFormat
is left unchanged, and this method returns false.
Returns whether the textFormat could be set for the current text.
The default format is TextFormat.PlainText.
public TextFormat getTextFormat()
setTextFormat(TextFormat textFormat)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 setMenu(WPopupMenu popupMenu)
public WPopupMenu getMenu()
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 WFormWidgetpublic EventSignal checked()
This signal is emitted when the user checks the button.
You can use the WInteractWidget#clicked() signal to react to any change of the button
state.
setCheckable(boolean checkable)public EventSignal unChecked()
This signal is emitted when the user unchecks the button.
You can use the WInteractWidget#clicked() signal to react to any change of the button
state.
setCheckable(boolean checkable)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||