Class ControlUtil


  • public final class ControlUtil
    extends Object
    • Method Detail

      • anchorFirmly

        public static void anchorFirmly​(javafx.scene.Node node)
      • bindLabelPropertyWithDefault

        public static void bindLabelPropertyWithDefault​(javafx.scene.control.Label label,
                                                        String defaultText,
                                                        org.reactfx.value.Val<String> boundProp)
        When the [boundProp] is blank, display instead the [defaultText] as grayed.
      • makeListViewFitToChildren

        public static void makeListViewFitToChildren​(javafx.scene.control.ListView<?> view,
                                                     double fixedCellHeight)
        Make a list view fit precisely the height of its items.
        Parameters:
        view - The listview to configure
        fixedCellHeight - The cell height to use, a good default is 24
      • makeTableViewFitToChildren

        public static void makeTableViewFitToChildren​(javafx.scene.control.TableView<?> view,
                                                      double fixedCellHeight)
        Make a list view fit precisely the height of its items.
        Parameters:
        view - The listview to configure
        fixedCellHeight - The cell height to use, a good default is 24
      • makeTextFieldShowPromptEvenIfFocused

        public static void makeTextFieldShowPromptEvenIfFocused​(javafx.scene.control.TextField field)
        By default text fields don't show the prompt when the caret is inside the field, even if the text is empty.
      • spacerPane

        public static javafx.scene.layout.Pane spacerPane()
      • registerDoubleClickListener

        public static org.reactfx.Subscription registerDoubleClickListener​(javafx.scene.Node node,
                                                                           Runnable action)
      • makeListCellFitListViewWidth

        public static <T> javafx.scene.control.ListCell<T> makeListCellFitListViewWidth​(javafx.scene.control.ListCell<T> cell)
        Make a list cell never overflow the width of its container, to avoid having a horizontal scroll bar showing up. This defers resizing constraints to the contents of the cell.
        Returns:
        The given cell
      • decorateCellFactory

        public static <T> void decorateCellFactory​(javafx.scene.control.ListView<T> lv,
                                                   Function<javafx.scene.control.ListCell<T>,​javafx.scene.control.ListCell<T>> f)
      • makeListViewNeverScrollHorizontal

        public static <T> void makeListViewNeverScrollHorizontal​(javafx.scene.control.ListView<T> lv)
        This is supported by some CSS. Hides the horizontal scroll, and alters the padding when the vertical scrollbar is shown so that the whole contents of the list cell are shown.
        Parameters:
        lv - List view to alter
      • subscribeOnWindow

        public static void subscribeOnWindow​(javafx.scene.Node node,
                                             Function<javafx.stage.Window,​org.reactfx.Subscription> hook)
        Add a hook on the owner window. It's not possible to do this statically, since at construction time the window might not be set.
      • subscribeOnSkin

        public static void subscribeOnSkin​(javafx.scene.control.Control node,
                                           Function<javafx.scene.control.Skin<?>,​org.reactfx.Subscription> hook)
        Add a hook on the owner window. It's not possible to do this statically, since at construction time the window might not be set.
      • copyToClipboardButton

        public static void copyToClipboardButton​(javafx.scene.control.Button button,
                                                 Supplier<String> copiedText)