Class ButtonUtils

java.lang.Object
de.edgesoft.edgeutils.javafx.ButtonUtils

public class ButtonUtils
extends java.lang.Object
Utilities for Button.

When trying Kotlin, all static methods are candidates for extending the button class.

Legal stuff

Copyright 2010-2020 Ekkart Kleinod ekleinod@edgesoft.de

This file is part of edgeutils.

edgeutils is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

edgeutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with edgeutils. If not, see http://www.gnu.org/licenses/.

Since:
0.10.0
Author:
Ekkart Kleinod
  • Constructor Summary

    Constructors 
    Constructor Description
    ButtonUtils()  
  • Method Summary

    Modifier and Type Method Description
    static void adaptButton​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.MenuItem theMenuItem)
    Adapts button to match menu item.
    static void adaptButtonWithAction​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.MenuItem theMenuItem)
    Adapts button to match menu item including action.
    static void bindDisable​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.ComboBox<?> theComboBox)
    Binds button disable property to selection of combo box.
    static void bindDisable​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.Labeled theLabeled)
    Binds button disable property to emptyness of labeled item.
    static void bindDisable​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.ListView<?> theListView)
    Binds button disable property to selection of list view.
    static void fillSplitMenuButton​(javafx.scene.control.SplitMenuButton theSplitButton, javafx.scene.control.MenuItem... theMenuItems)
    Fills a SplitMenuButton with the given MenuItems, using the first for the split button.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • adaptButton

      public static void adaptButton​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.MenuItem theMenuItem)
      Adapts button to match menu item.
      Parameters:
      theButton - button to adapt
      theMenuItem - menu item to adapt from
    • adaptButtonWithAction

      public static void adaptButtonWithAction​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.MenuItem theMenuItem)
      Adapts button to match menu item including action.
      Parameters:
      theButton - button to adapt
      theMenuItem - menu item to adapt from
    • bindDisable

      public static void bindDisable​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.ListView<?> theListView)
      Binds button disable property to selection of list view.
      Parameters:
      theButton - button to disable
      theListView - list view with items
      Since:
      0.10.1
    • bindDisable

      public static void bindDisable​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.ComboBox<?> theComboBox)
      Binds button disable property to selection of combo box.
      Parameters:
      theButton - button to disable
      theComboBox - combo box with items
      Since:
      0.10.1
    • bindDisable

      public static void bindDisable​(javafx.scene.control.ButtonBase theButton, javafx.scene.control.Labeled theLabeled)
      Binds button disable property to emptyness of labeled item.
      Parameters:
      theButton - button to disable
      theLabeled - labeled item
      Since:
      0.12.0
    • fillSplitMenuButton

      public static void fillSplitMenuButton​(javafx.scene.control.SplitMenuButton theSplitButton, javafx.scene.control.MenuItem... theMenuItems)
      Fills a SplitMenuButton with the given MenuItems, using the first for the split button.
      Parameters:
      theSplitButton - split button to fill
      theMenuItems - menu items (first will be used for split button itself)
      Since:
      0.12.0