From 2575a47a650217a0e87b8fe55b8c2aa97f775ab3 Mon Sep 17 00:00:00 2001 From: Simon Barner <barner@fortiss.org> Date: Wed, 7 Nov 2018 14:22:17 +0100 Subject: [PATCH] Add observeVisible() * As replacement for the now deprecated SWTObservables.observeVisible() Issue-Ref: 3569 Issue-Url: https://af3-developer.fortiss.org/issues/3569 Signed-off-by: Simon Barner <barner@fortiss.org> --- .../src/org/fortiss/tooling/kernel/ui/util/.ratings | 2 +- .../tooling/kernel/ui/util/DataBindingUtils.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/.ratings index a941faf03..ed8161285 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/.ratings @@ -1,7 +1,7 @@ ActionUtils.java 4553e487264e3d1f86f4767da4a7400cce4b9a5d GREEN ConstraintsUIUtils.java 69d5e08bbf768baf2790380e36f1020ef826a33e GREEN CopyPasteUtils.java bbc5cf9c9dc03ebf8dc75d42c919fe6eb60b388e GREEN -DataBindingUtils.java 3a51d9b5681762dd40751e477aa4862baaed4052 YELLOW +DataBindingUtils.java 631c47881caa13fc567679a7e4416eb777af0713 YELLOW DragAndDropUtils.java 7aab91518aa12d76533a345bf6ed0be9ac7ff0e5 GREEN EObjectSelectionUtils.java 128cf8f96c6b9478171dff3deda662d5934f5f44 GREEN HierarchicalNameViewerComparator.java 199d82e392d4e437810cc65c0fc521dab52038e0 GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java index 3a51d9b56..631c47881 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/util/DataBindingUtils.java @@ -234,6 +234,19 @@ public final class DataBindingUtils { return WidgetProperties.selection().observe(widget); } + /** + * Returns an observable value tracking the visible state of the given + * {@link Control}. + * + * @param control + * the {@link Control} + * @return an observable value tracking the visible state of the given + * {@link Control}. + */ + public static ISWTObservableValue observeVisible(Control control) { + return WidgetProperties.visible().observe(control); + } + /** * Performs a complex binding of a cell editor control to a model element. The * validation is performed on modification (i.e. always), while model -- GitLab