Package javafx.scene.control
Class ToggleGroup
java.lang.Object
javafx.scene.control.ToggleGroup
A class which contains a reference to all
Toggles
whose
selected
variables should be managed such that only a single
Toggle
within the ToggleGroup
may be selected at
any one time.
Generally ToggleGroups
are managed automatically simply by specifying
the name of a ToggleGroup
on the
, but in
some situations it is desirable to explicitly manage which
Toggle
ToggleGroup
is used by
.
Toggles
- Since:
- JavaFX 2.0
-
Property Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal ObservableMap<Object,
Object> Returns an observable map of properties on this node for use primarily by application developers.final Toggle
Gets the selectedToggle
.final ObservableList<Toggle>
The list of toggles within the ToggleGroup.Returns a previously set Object property, or null if no such property has been set using thesetUserData(java.lang.Object)
method.boolean
Tests if ToggleGroup has properties.final ReadOnlyObjectProperty<Toggle>
The selected toggle.final void
selectToggle
(Toggle value) Selects the toggle.void
setUserData
(Object value) Convenience method for setting a single Object property that can be retrieved at a later date.
-
Property Details
-
selectedToggle
The selected toggle.- See Also:
-
-
Constructor Details
-
ToggleGroup
public ToggleGroup()Creates a default ToggleGroup instance.
-
-
Method Details
-
getToggles
The list of toggles within the ToggleGroup. -
selectToggle
Selects the toggle.- Parameters:
value
- TheToggle
that is to be selected.
-
getSelectedToggle
Gets the selectedToggle
.- Returns:
- Toggle The selected toggle.
-
selectedToggleProperty
The selected toggle.- Returns:
- the
selectedToggle
property - See Also:
-
getProperties
Returns an observable map of properties on this node for use primarily by application developers.- Returns:
- an observable map of properties on this node for use primarily by application developers
- Since:
- JavaFX 8u40
-
hasProperties
public boolean hasProperties()Tests if ToggleGroup has properties.- Returns:
- true if node has properties.
- Since:
- JavaFX 8u40
-
setUserData
Convenience method for setting a single Object property that can be retrieved at a later date. This is functionally equivalent to calling the getProperties().put(Object key, Object value) method. This can later be retrieved by callinggetUserData()
.- Parameters:
value
- The value to be stored - this can later be retrieved by callinggetUserData()
.- Since:
- JavaFX 8u40
-
getUserData
Returns a previously set Object property, or null if no such property has been set using thesetUserData(java.lang.Object)
method.- Returns:
- The Object that was previously set, or null if no property has been set or if null was set.
- Since:
- JavaFX 8u40
-