From 3768f6884477c56e08b83229fe35e3cefc248808 Mon Sep 17 00:00:00 2001 From: Abraham Wolk Date: Tue, 14 Nov 2023 14:33:35 +0100 Subject: [PATCH] Revert "CSSTUDIO-2070 Add class "TooltipHelper"." This reverts commit 8724b67d454a0dd1f18d781bb852c00829aa3bd0. --- .../java/org/phoebus/ui/TooltipHelper.java | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 core/ui/src/main/java/org/phoebus/ui/TooltipHelper.java diff --git a/core/ui/src/main/java/org/phoebus/ui/TooltipHelper.java b/core/ui/src/main/java/org/phoebus/ui/TooltipHelper.java deleted file mode 100644 index df1f9d52a1..0000000000 --- a/core/ui/src/main/java/org/phoebus/ui/TooltipHelper.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.phoebus.ui; - -import javafx.scene.Node; -import javafx.scene.control.Control; -import javafx.scene.control.Tooltip; -import javafx.stage.Window; -import org.phoebus.ui.docking.DockPane; - -public class TooltipHelper { - public static void installTooltip(Node node, Tooltip tooltip) { - Window window = DockPane.getActiveDockPane().getScene().getWindow(); - window.focusedProperty().addListener((property, oldValue, newValue) -> { - if (newValue) { - Tooltip.install(node, tooltip); - } - else { - Tooltip.uninstall(node, tooltip); - } - }); - - if (window.focusedProperty().get()) { - Tooltip.install(node, tooltip); - } - } - - public static void setTooltipOnControl(Control control, Tooltip tooltip) { - Window window = DockPane.getActiveDockPane().getScene().getWindow(); - window.focusedProperty().addListener((property, oldValue, newValue) -> { - if (newValue) { - control.setTooltip(tooltip); - } - else { - control.setTooltip(null); - } - }); - - if (window.focusedProperty().get()) { - control.setTooltip(tooltip); - } - } -}