]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.ui/src/org/simantics/ui/workbench/action/DefaultActions.java
Minor cleanup for performing default actions
[simantics/platform.git] / bundles / org.simantics.ui / src / org / simantics / ui / workbench / action / DefaultActions.java
index 9f5bba95dea73c8ee01621365f8e3f05d9e29334..12995f177faa88e3c408d482ace38451af1b9678 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.ui.workbench.action;
 
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
@@ -62,4 +63,15 @@ public final class DefaultActions {
         session.asyncRequest(new ChooseActionRequest(shell, null, input, WorkbenchUtils.getCurrentPerspectiveId(), rememberAction, alwaysAsk, neverPromptForAction));
     }
 
+    /**
+     * Perform a default workbench action on the specified input object using
+     * {@link ChooseActionRequest} from the current thread. The current thread
+     * must be the SWT UI thread.
+     * 
+     * @param control the control contained
+     */
+    public static void performDefaultAction(Control control, Object input) {
+        new PerformDefaultAction("Perform Default Action", control, input).run();
+    }
+
 }