Package eu.webtoolkit.jwt
Class WRadioButton
java.lang.Object
public class WRadioButton extends WAbstractToggleButton
A user control that represents a radio button.
Use a WButtonGroup
to group together radio buttons that reflect options that are
mutually exclusive.
Usage example:
enum Vote { Republican, Democrate, NoVote };
// use a group box as widget container for 3 radio buttons, with a title
WGroupBox container = new WGroupBox("USA elections vote");
// use a button group to logically group the 3 options
WButtonGroup group = new WButtonGroup(this);
WRadioButton button;
button = new WRadioButton("I voted Republican", container);
new WBreak(container);
group.addButton(button, Vote.Republican.ordinal());
button = new WRadioButton("I voted Democrat", container);
new WBreak(container);
group.addButton(button, Vote.Democrate.ordinal());
button = new WRadioButton("I didn't vote", container);
new WBreak(container);
group.addButton(button, Vote.NoVote.ordinal());
group.setCheckedButton(group.button(Vote.NoVote.ordinal()));
WRadioButton is an inline
widget.
CSS
This widget corresponds to the HTML <input type="radio">
tag.
When a label is specified, the input element is nested in a <label>
.
This widget does not provide styling, and can be styled using inline or external CSS as appropriate.
- See Also:
WAbstractToggleButton
,WButtonGroup
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Field Summary
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_
-
Constructor Summary
Constructors Constructor Description WRadioButton()
Creates an unchecked radio button with empty label and optional parent.WRadioButton(WContainerWidget parent)
Creates an unchecked radio button with empty label and optional parent.WRadioButton(java.lang.CharSequence text)
Creates an unchecked radio button with given text and optional parent.WRadioButton(java.lang.CharSequence text, WContainerWidget parent)
Creates an unchecked radio button with given text and optional parent. -
Method Summary
Modifier and Type Method Description WButtonGroup
getGroup()
Returns the button group.void
remove()
Destructor.protected void
setFormData(WObject.FormData formData)
Methods inherited from class eu.webtoolkit.jwt.WAbstractToggleButton
checked, getText, getTextFormat, getValueText, isChecked, isWordWrap, refresh, setChecked, setChecked, setText, setTextFormat, setUnChecked, setValueText, setWordWrap, unChecked
Methods inherited from class eu.webtoolkit.jwt.WFormWidget
changed, enableAjax, getEmptyText, getLabel, getPlaceholderText, getTabIndex, getValidator, isCanReceiveFocus, isReadOnly, propagateSetEnabled, render, selected, setEmptyText, setEnabled, setHidden, setPlaceholderText, setReadOnly, 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, setPopup, touchEnded, touchMoved, touchStarted, unsetDraggable
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getDomChanges, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, jsStringLiteral, jsStringLiteral, parentResized, parentResized, propagateSetVisible, removeScript, removeStyleClass, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFloatSide, setFocus, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setOffsets, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setVerticalAlignment, updateSignalConnection, voidEventSignal
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, removeChild, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setObjectName, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getObjectName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WRadioButton
Creates an unchecked radio button with empty label and optional parent. -
WRadioButton
public WRadioButton()Creates an unchecked radio button with empty label and optional parent. -
WRadioButton
Creates an unchecked radio button with given text and optional parent. -
WRadioButton
public WRadioButton(java.lang.CharSequence text)Creates an unchecked radio button with given text and optional parent.
-
-
Method Details
-
remove
public void remove()Destructor.- Overrides:
remove
in classWAbstractToggleButton
- See Also:
WContainerWidget.removeWidget(WWidget widget)
-
getGroup
Returns the button group.Returns the button group to which this button belongs.
-
setFormData
- Overrides:
setFormData
in classWAbstractToggleButton
-