- java.lang.Object
-
- javafx.scene.control.ToggleGroup
-
public class ToggleGroup extends Object
A class which contains a reference to allToggles
whoseselected
variables should be managed such that only a single
within theToggle
ToggleGroup
may be selected at any one time.Generally
ToggleGroups
are managed automatically simply by specifying the name of aToggleGroup
on the
, but in some situations it is desirable to explicitly manage whichToggle
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
All Methods Instance Methods Concrete Methods 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 Detail
-
selectedToggle
public final ReadOnlyObjectProperty<Toggle> selectedToggleProperty
The selected toggle.- See Also:
getSelectedToggle()
-
-
Method Detail
-
getToggles
public final ObservableList<Toggle> getToggles()
The list of toggles within the ToggleGroup.- Returns:
- the list of toggles within the ToggleGroup
-
selectToggle
public final void selectToggle(Toggle value)
Selects the toggle.- Parameters:
value
- TheToggle
that is to be selected.
-
getSelectedToggle
public final Toggle getSelectedToggle()
Gets the selectedToggle
.- Returns:
- Toggle The selected toggle.
-
selectedToggleProperty
public final ReadOnlyObjectProperty<Toggle> selectedToggleProperty()
The selected toggle.- See Also:
getSelectedToggle()
-
getProperties
public final ObservableMap<Object,Object> 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
public void setUserData(Object value)
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
public Object 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
-
-