- All Known Implementing Classes:
- RadioButton,- RadioMenuItem,- ToggleButton
public interface Toggle
Represents a control that can be toggled between selected and non-selected
 states. In addition, a Toggle can be assigned a
 
ToggleGroupToggleGroup- Since:
- JavaFX 2.0
- 
Property SummaryPropertiesTypePropertyDescriptionThe selected state for thisToggle.TheToggleGroupto which thisTogglebelongs.
- 
Method SummaryModifier and TypeMethodDescriptionReturns an observable map of properties on this toggle for use primarily by application developers.Returns TheToggleGroupto which thisTogglebelongs.Returns a previously set Object property, or null if no such property has been set using theNode.setUserData(java.lang.Object)method.booleanIndicates whether thisToggleis selected.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.TheToggleGroupto which thisTogglebelongs.
- 
Property Details- 
toggleGroupObjectProperty<ToggleGroup> toggleGroupPropertyTheToggleGroupto which thisTogglebelongs.- See Also:
 
- 
selectedBooleanProperty selectedPropertyThe selected state for thisToggle.- See Also:
 
 
- 
- 
Method Details- 
getToggleGroupToggleGroup getToggleGroup()Returns TheToggleGroupto which thisTogglebelongs.- Returns:
- The ToggleGroupto which thisTogglebelongs.
 
- 
setToggleGroupSets theToggleGroupto which thisTogglebelongs.- Parameters:
- toggleGroup- The new- ToggleGroup.
 
- 
toggleGroupPropertyObjectProperty<ToggleGroup> toggleGroupProperty()TheToggleGroupto which thisTogglebelongs.- See Also:
 
- 
isSelectedboolean isSelected()Indicates whether thisToggleis selected.- Returns:
- trueif this- Toggleis selected.
 
- 
setSelectedvoid setSelected(boolean selected) Sets thisToggleas selected or unselected.- Parameters:
- selected-- trueto make this- Toggleselected.
 
- 
selectedPropertyBooleanProperty selectedProperty()The selected state for thisToggle.- See Also:
 
- 
getUserDataObject 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.
 
- 
setUserDataConvenience 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 calling- Node.getUserData().
 
- 
getPropertiesObservableMap<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
 
 
-