Interface Toggle
All Known Implementing Classes:
public interface Toggle
ToggleGroup, which manages all assigned Toggles such that only a single Toggle within the ToggleGroup may be selected at any one time.Since:
JavaFX 2.0
-
Property Summary
All MethodsInstance MethodsAbstract Methods Type Property and Description BooleanPropertyselectedThe selected state for thisToggle.ObjectProperty<ToggleGroup>toggleGroupTheToggleGroupto which thisTogglebelongs.
-
Method Summary
All MethodsInstance MethodsAbstract Methods Modifier and Type Method and Description ObservableMap<Object,Object>getProperties()Returns an observable map of properties on this toggle for use primarily by application developers.ToggleGroupgetToggleGroup()Returns TheToggleGroupto which thisTogglebelongs.ObjectgetUserData()Returns a previously set Object property, or null if no such property has been set using theNode.setUserData(java.lang.Object)method.booleanisSelected()Indicates whether thisToggleis selected.BooleanPropertyselectedProperty()The selected state for thisToggle.voidsetSelected(boolean selected)Sets thisToggleas selected or unselected.voidsetToggleGroup(ToggleGroup toggleGroup)Sets theToggleGroupto which thisTogglebelongs.voidsetUserData(Object value)Convenience method for setting a single Object property that can be retrieved at a later date.ObjectProperty<ToggleGroup>toggleGroupProperty()TheToggleGroupto which thisTogglebelongs.
-
Property Detail
-
toggleGroup
ObjectProperty<ToggleGroup> toggleGroupProperty
TheToggleGroupto which thisTogglebelongs.See Also:
-
selected
BooleanProperty selectedProperty
The selected state for thisToggle.See Also:
-
-
Method Detail
-
getToggleGroup
ToggleGroup getToggleGroup()
Returns TheToggleGroupto which thisTogglebelongs.Returns:
The
ToggleGroupto which thisTogglebelongs.
-
setToggleGroup
void setToggleGroup(ToggleGroup toggleGroup)
Sets theToggleGroupto which thisTogglebelongs.Parameters:
toggleGroup- The newToggleGroup.
-
toggleGroupProperty
ObjectProperty<ToggleGroup> toggleGroupProperty()
TheToggleGroupto which thisTogglebelongs.See Also:
-
isSelected
boolean isSelected()
Indicates whether thisToggleis selected.Returns:
trueif thisToggleis selected.
-
setSelected
void setSelected(boolean selected)
Sets thisToggleas selected or unselected.Parameters:
selected-trueto make thisToggleselected.
-
selectedProperty
BooleanProperty selectedProperty()
The selected state for thisToggle.See Also:
-
getUserData
Object getUserData()
Returns a previously set Object property, or null if no such property has been set using theNode.setUserData(java.lang.Object)method.Returns:
The Object that was previously set, or null if no property has been set or if null was set.
-
setUserData
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 callingNode.getUserData().Parameters:
value- The value to be stored - this can later be retrieved by callingNode.getUserData().
-
getProperties
ObservableMap<Object,Object> getProperties()
Returns an observable map of properties on this toggle for use primarily by application developers.Returns:
An observable map of properties on this toggle for use primarily by application developers
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.