Class ToggleGroupUtil

java.lang.Object
com.iamsoft.util.ui.javafx.ToggleGroupUtil

public final class ToggleGroupUtil extends Object
Utility classes for ToggleGroup.
  • Method Summary

    Modifier and Type
    Method
    Description
    static javafx.scene.control.ToggleGroup
    Creates a toggle group which disallows empty selection.
    static <S, T extends javafx.scene.control.Toggle>
    void
    manageSelection(javafx.collections.ObservableList<? extends S> pSelection, Function<S,T> pToggleExtractor, BiConsumer<List<? extends S>,? super T> pToggleApplier, Function<T,javafx.beans.property.BooleanProperty> pToggleDisabledExtractor, javafx.scene.control.ToggleGroup pToggleGroup)
    Manage toggle state for a mutating list of items.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • manageSelection

      public static <S, T extends javafx.scene.control.Toggle> void manageSelection(javafx.collections.ObservableList<? extends S> pSelection, Function<S,T> pToggleExtractor, BiConsumer<List<? extends S>,? super T> pToggleApplier, Function<T,javafx.beans.property.BooleanProperty> pToggleDisabledExtractor, javafx.scene.control.ToggleGroup pToggleGroup)
      Manage toggle state for a mutating list of items. Typically used if toggle group is applicable to each member in a list of items. If selection is heterogeneous, toggle group should have no selection. Currently, this method expects ToggleGroup.getToggles() to return consistent values but that could be changed.
      Parameters:
      pSelection - Selected table rows.
      pToggleExtractor - Get toggle from list element.
      pToggleApplier - Set active toggle to selected items.
      pToggleDisabledExtractor - Return toggle's 'disabled' property.
      pToggleGroup - Group containing all available toggles.
    • createPersistentToggleGroup

      public static javafx.scene.control.ToggleGroup createPersistentToggleGroup()
      Creates a toggle group which disallows empty selection.