Class ControlUtil
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.controls.ControlUtil
-
public final class ControlUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
anchorFirmly(javafx.scene.Node node)
static void
bindLabelPropertyWithDefault(javafx.scene.control.Label label, java.lang.String defaultText, org.reactfx.value.Val<java.lang.String> boundProp)
When the [boundProp] is blank, display instead the [defaultText] as grayed.static void
copyToClipboardButton(javafx.scene.control.Button button, java.util.function.Supplier<java.lang.String> copiedText)
static <T> void
decorateCellFactory(javafx.scene.control.ListView<T> lv, java.util.function.Function<javafx.scene.control.ListCell<T>,javafx.scene.control.ListCell<T>> f)
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.static void
makeListViewFitToChildren(javafx.scene.control.ListView<?> view, double fixedCellHeight)
Make a list view fit precisely the height of its items.static <T> void
makeListViewNeverScrollHorizontal(javafx.scene.control.ListView<T> lv)
This is supported by some CSS.static void
makeTableViewFitToChildren(javafx.scene.control.TableView<?> view, double fixedCellHeight)
Make a list view fit precisely the height of its items.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.static org.reactfx.Subscription
registerDoubleClickListener(javafx.scene.Node node, java.lang.Runnable action)
static void
saveToFileButton(javafx.scene.control.Button button, javafx.stage.Stage popupStage, java.util.function.Supplier<java.lang.String> content, ApplicationComponent owner, java.util.function.Supplier<java.lang.String> initialFileName)
static javafx.scene.layout.Pane
spacerPane()
static void
subscribeOnSkin(javafx.scene.control.Control node, java.util.function.Function<javafx.scene.control.Skin<?>,org.reactfx.Subscription> hook)
Add a hook on the owner window.static void
subscribeOnWindow(javafx.scene.Node node, java.util.function.Function<javafx.stage.Window,org.reactfx.Subscription> hook)
Add a hook on the owner window.
-
-
-
Method Detail
-
anchorFirmly
public static void anchorFirmly(javafx.scene.Node node)
-
bindLabelPropertyWithDefault
public static void bindLabelPropertyWithDefault(javafx.scene.control.Label label, java.lang.String defaultText, org.reactfx.value.Val<java.lang.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 configurefixedCellHeight
- 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 configurefixedCellHeight
- 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, java.lang.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, java.util.function.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, java.util.function.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, java.util.function.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, java.util.function.Supplier<java.lang.String> copiedText)
-
saveToFileButton
public static void saveToFileButton(javafx.scene.control.Button button, javafx.stage.Stage popupStage, java.util.function.Supplier<java.lang.String> content, ApplicationComponent owner, java.util.function.Supplier<java.lang.String> initialFileName)
-
-