java.lang.Object
javafx.scene.control.ToggleGroup
public class ToggleGroup extends Object
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
Properties Type Property Description ReadOnlyObjectProperty<Toggle>
selectedToggle
The selected toggle. -
Constructor Summary
Constructors Constructor Description ToggleGroup()
Creates a default ToggleGroup instance. -
Method Summary
Modifier and Type Method Description ObservableMap<Object,Object>
getProperties()
Returns an observable map of properties on this node for use primarily by application developers.Toggle
getSelectedToggle()
Gets the selectedToggle
.ObservableList<Toggle>
getToggles()
The list of toggles within the ToggleGroup.Object
getUserData()
Returns a previously set Object property, or null if no such property has been set using thesetUserData(java.lang.Object)
method.boolean
hasProperties()
Tests if ToggleGroup has properties.ReadOnlyObjectProperty<Toggle>
selectedToggleProperty()
The selected toggle.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:
getSelectedToggle()
-
-
Constructor Details
-
ToggleGroup
public ToggleGroup()Creates a default ToggleGroup instance.
-
-
Method Details
-
getToggles
The list of toggles within the ToggleGroup.- Returns:
- 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.- See Also:
getSelectedToggle()
-
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
-