- java.lang.Object
-
- com.iamsoft.util.ui.javafx.WindowUtil
-
public final class WindowUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javafx.beans.property.ReadOnlyProperty<javafx.stage.Window>
createCurrentWindowProperty(javafx.scene.Node pNode)
Creates a read-only property providing the current window of the specified node.static javafx.collections.ObservableList<javafx.beans.property.ReadOnlyProperty<javafx.scene.Parent>>
createParentPathObservableList(javafx.scene.Node pNode)
static javafx.beans.property.ReadOnlyProperty<Boolean>
createVisibleOnSceneNodeProperty(javafx.beans.value.ObservableValue<? extends javafx.scene.Node> pNode)
static javafx.beans.property.ReadOnlyProperty<Boolean>
createVisibleOnSceneNodeProperty(javafx.scene.Node pNode)
Creates a property which determines whether the specified node is visible on the scene.static javafx.beans.property.ReadOnlyProperty<Boolean>
createWindowShowingProperty(javafx.scene.Node pNode)
Creates a read-only property providing the 'showing' state of the current window of the specified node.static void
delay(double pMs, Runnable pRunnable)
Runs the specified runnable on the JavaFX thread after the specified time in milliseconds is elapsed.static void
fixDialogSizingBug(javafx.scene.control.Dialog<?> pDialog)
A workaround for a Linux specific sizing bug, which occurs when a dialog instance is reused for showing a dialog more than once - the dialog pane height is shrunk to zero.static javafx.stage.Window
getWindow(javafx.event.ActionEvent pActionEvent)
static <T> Optional<T>
showAndWait(javafx.scene.control.Dialog<T> pDialog, javafx.scene.control.MenuBar pMenuBar)
Used to prevent access to system menu on Mac OS when modal dialog is shown.static void
showTooltip(javafx.scene.control.Control pControl, int pDelay, int pShowingDuration)
Shows the tooltip of the specified component for the specified duration, after the specified delay.static void
showTooltip(javafx.scene.control.Control pControl, int pDelay, int pShowingDuration, javafx.geometry.Pos pPosition)
Shows the tooltip of the specified component for the specified duration, after the specified delay.
-
-
-
Method Detail
-
getWindow
public static javafx.stage.Window getWindow(javafx.event.ActionEvent pActionEvent)
-
fixDialogSizingBug
public static void fixDialogSizingBug(javafx.scene.control.Dialog<?> pDialog)
A workaround for a Linux specific sizing bug, which occurs when a dialog instance is reused for showing a dialog more than once - the dialog pane height is shrunk to zero. See bugs 517 and 518.
-
createCurrentWindowProperty
public static javafx.beans.property.ReadOnlyProperty<javafx.stage.Window> createCurrentWindowProperty(javafx.scene.Node pNode)
Creates a read-only property providing the current window of the specified node.
-
createWindowShowingProperty
public static javafx.beans.property.ReadOnlyProperty<Boolean> createWindowShowingProperty(javafx.scene.Node pNode)
Creates a read-only property providing the 'showing' state of the current window of the specified node.
-
createVisibleOnSceneNodeProperty
public static javafx.beans.property.ReadOnlyProperty<Boolean> createVisibleOnSceneNodeProperty(javafx.beans.value.ObservableValue<? extends javafx.scene.Node> pNode)
-
createVisibleOnSceneNodeProperty
public static javafx.beans.property.ReadOnlyProperty<Boolean> createVisibleOnSceneNodeProperty(javafx.scene.Node pNode)
Creates a property which determines whether the specified node is visible on the scene. A node is considered to be visible on the scene if the node and all parents are visible and the scene is non-null.
-
createParentPathObservableList
public static javafx.collections.ObservableList<javafx.beans.property.ReadOnlyProperty<javafx.scene.Parent>> createParentPathObservableList(javafx.scene.Node pNode)
-
showAndWait
public static <T> Optional<T> showAndWait(javafx.scene.control.Dialog<T> pDialog, javafx.scene.control.MenuBar pMenuBar)
Used to prevent access to system menu on Mac OS when modal dialog is shown.
-
showTooltip
public static void showTooltip(javafx.scene.control.Control pControl, int pDelay, int pShowingDuration)
Shows the tooltip of the specified component for the specified duration, after the specified delay. If the tooltip of the specified component is changed before it is shown, nothing happens.- Parameters:
pDelay
- Delay in milliseconds before showing the tooltip.pShowingDuration
- Duration in milliseconds for which the tooltip will be visible.
-
showTooltip
public static void showTooltip(javafx.scene.control.Control pControl, int pDelay, int pShowingDuration, javafx.geometry.Pos pPosition)
Shows the tooltip of the specified component for the specified duration, after the specified delay. If the tooltip of the specified component is changed before it is shown, nothing happens.- Parameters:
pDelay
- Delay in milliseconds before showing the tooltip.pShowingDuration
- Duration in milliseconds for which the tooltip will be visible.
-
delay
public static void delay(double pMs, Runnable pRunnable)
Runs the specified runnable on the JavaFX thread after the specified time in milliseconds is elapsed.
-
-