Class CheckboxGroup
- All Implemented Interfaces:
Serializable
CheckboxGroup — the AWT 1.0 radio-button
mutex. Grouping is what turns a Checkbox into a radio button, both
in behaviour and in glyph:
CheckboxGroup units = new CheckboxGroup();
Checkbox metric = new Checkbox("metric", true, units); // renders as a radio
Checkbox imperial = new Checkbox("imperial", false, units);
units.setSelectedCheckbox(imperial); // silent: no ItemEvent, either box
Nothing here fires events and nothing here throws: a box belonging to
another group is a documented silent no-op, and null legally
deselects everything (R_match_swing_errors).
Lives in :emulators rather than :surrogates because
there is nothing Vaadin-shaped for it to be — no element, no rendering, no
HasValue — and D_buttongroup_browser_click already settled the analogous question for
ButtonGroup: group mutex is an emulator-layer concern, and
SCheckbox carries no awareness of any group.
getSelectedCheckbox() returns a vaadinx.awt.Checkbox,
not the JDK type. Irreducible, and the same divergence D_buttongroup_cross_package
accepted for ButtonGroup: migrated code compiles unchanged
after the import swap.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.voidsetCurrent(Checkbox box) Deprecated.as of JDK 1.1, replaced bysetSelectedCheckbox(Checkbox)— but this is the implementation, not the wrappervoidtoString()
-
Constructor Details
-
CheckboxGroup
public CheckboxGroup()
-
-
Method Details
-
getSelectedCheckbox
-
getCurrent
Deprecated.as of JDK 1.1, replaced bygetSelectedCheckbox()— but this is the implementation, not the wrapper -
setSelectedCheckbox
-
setCurrent
Deprecated.as of JDK 1.1, replaced bysetSelectedCheckbox(Checkbox)— but this is the implementation, not the wrapperMoves the selection, forcing the outgoing box off and the incoming box on.The two directions deliberately use different setters, and the pointer moves before either. The outgoing box goes through the public
Checkbox.setState(boolean), which re-enters this group's check but finds the pointer already moved, so its cannot-deselect veto does not fire; the incoming box goes through the package-privatesetStateInternal, which skips group logic entirely. Using one setter for both directions either recurses or leaves a stale selection.- Parameters:
box- null deselects everything; a box belonging to a different group is ignored — silently, as AWT does, and deliberately not anIllegalArgumentException(R_match_swing_errors)
-
toString
-
getSelectedCheckbox()— but this is the implementation, not the wrapper