Package eu.webtoolkit.jwt
Class WRadioButton
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:
-
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
ConstructorDescriptionCreates an unchecked radio button with empty label and optional parent.WRadioButton
(WContainerWidget parentContainer) Creates an unchecked radio button with empty label and optional parent.WRadioButton
(CharSequence text) Creates an unchecked radio button with given text and optional parent.WRadioButton
(CharSequence text, WContainerWidget parentContainer) Creates an unchecked radio button with given text and optional parent. -
Method Summary
Modifier and TypeMethodDescriptiongetGroup()
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, getLabel, getPlaceholderText, getTabIndex, getValidator, isCanReceiveFocus, isReadOnly, propagateSetEnabled, render, setEnabled, setHidden, setPlaceholderText, setReadOnly, setToolTip, setValidator, validate, validated, validatorChanged
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, beingDeleted, 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, iterateChildren, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, removeScript, removeStyleClass, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setVerticalAlignment, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemoved
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, isGlobalWidget, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, 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
getObjectName
-
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
Creates an unchecked radio button with given text and optional parent.
-
-
Method Details
-
remove
public void remove()Destructor.- Overrides:
remove
in classWAbstractToggleButton
- See Also:
-
getGroup
Returns the button group.Returns the button group to which this button belongs.
-
setFormData
- Overrides:
setFormData
in classWAbstractToggleButton
-