Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbvosburgh2012-02-18 00:04:48 +0000
committerbvosburgh2012-02-18 00:04:48 +0000
commit81ef74a4b98c5c261a62d238044e3f02a962c17d (patch)
tree8bb0c87b470ca5ef3136302692fc091fffdeb2d3 /common/plugins
parentd5211463c954c3df2234e0f82ba01a650c1d0242 (diff)
downloadwebtools.dali-81ef74a4b98c5c261a62d238044e3f02a962c17d.tar.gz
webtools.dali-81ef74a4b98c5c261a62d238044e3f02a962c17d.tar.xz
webtools.dali-81ef74a4b98c5c261a62d238044e3f02a962c17d.zip
reselect attribute after its mapping is changed via the UI
Diffstat (limited to 'common/plugins')
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java
index 743d8745e4..accfe6bd28 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/util/SWTUtil.java
@@ -10,6 +10,7 @@
package org.eclipse.jpt.common.ui.internal.util;
import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.OpenStrategy;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
@@ -38,6 +39,7 @@ public class SWTUtil {
/**
* @see Display#asyncExec(Runnable)
* @see #syncExec(Runnable)
+ * @see #timerExec(int, Runnable)
* @see #execute(Runnable)
*/
public static void asyncExec(Runnable runnable) {
@@ -47,6 +49,7 @@ public class SWTUtil {
/**
* @see Display#syncExec(Runnable)
* @see #asyncExec(Runnable)
+ * @see #timerExec(int, Runnable)
* @see #execute(Runnable)
*/
public static void syncExec(Runnable runnable) {
@@ -54,6 +57,25 @@ public class SWTUtil {
}
/**
+ * Use the standard delay.
+ * @see OpenStrategy#getPostSelectionDelay()
+ * @see #timerExec(int, Runnable)
+ */
+ public static void delayedExec(Runnable runnable) {
+ timerExec(OpenStrategy.getPostSelectionDelay(), runnable);
+ }
+
+ /**
+ * @see Display#timerExec(int, Runnable)
+ * @see #asyncExec(Runnable)
+ * @see #syncExec(Runnable)
+ * @see #execute(Runnable)
+ */
+ public static void timerExec(int milliseconds, Runnable runnable) {
+ getStandardDisplay().timerExec(milliseconds, runnable);
+ }
+
+ /**
* Execute the specified runnable if the current thread is the UI thread;
* otherwise asynchrounously dispatch the runnable to the UI thread,
* returning immediately. This is useful for event handlers when it is not
@@ -62,6 +84,7 @@ public class SWTUtil {
* @see Display#asyncExec(Runnable)
* @see #asyncExec(Runnable)
* @see #syncExec(Runnable)
+ * @see #timerExec(int, Runnable)
*/
public static void execute(Runnable runnable) {
Display display = Display.getCurrent();
@@ -84,6 +107,7 @@ public class SWTUtil {
* @see Display#asyncExec(Runnable)
* @see #asyncExec(Runnable)
* @see #syncExec(Runnable)
+ * @see #timerExec(int, Runnable)
*/
public static void execute(Viewer viewer, Runnable runnable) {
execute(viewer.getControl(), runnable);
@@ -100,6 +124,7 @@ public class SWTUtil {
* @see Display#asyncExec(Runnable)
* @see #asyncExec(Runnable)
* @see #syncExec(Runnable)
+ * @see #timerExec(int, Runnable)
*/
public static void execute(Control control, Runnable runnable) {
execute(control.getDisplay(), runnable);
@@ -116,6 +141,7 @@ public class SWTUtil {
* @see Display#asyncExec(Runnable)
* @see #asyncExec(Runnable)
* @see #syncExec(Runnable)
+ * @see #timerExec(int, Runnable)
*/
public static void execute(Display display, Runnable runnable) {
if (display.getThread() == Thread.currentThread()) {

Back to the top