]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/expressions/SCLExpressionView.java
Minor cleanup for performing default actions
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / scl / expressions / SCLExpressionView.java
index d9bf77e47555210c64a31b0d46f89501bbd05c07..eeea9d586b895a5cd1f2af7a86b2001061605ded 100644 (file)
@@ -17,7 +17,6 @@ import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
 import org.eclipse.jface.viewers.ColumnWeightData;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -40,8 +39,7 @@ import org.simantics.Simantics;
 import org.simantics.db.Resource;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.modeling.ui.Activator;
-import org.simantics.ui.workbench.action.ChooseActionRequest;
-import org.simantics.utils.ui.workbench.WorkbenchUtils;
+import org.simantics.ui.workbench.action.DefaultActions;
 
 public class SCLExpressionView extends ViewPart {
 
@@ -169,14 +167,7 @@ public class SCLExpressionView extends ViewPart {
     }
 
     private static void openResource(Shell shell, Resource resource) {
-        try {
-            ISelection input = new StructuredSelection(resource);
-            String perspectiveId = WorkbenchUtils.getCurrentPerspectiveId();
-            // Try the doubleClick-extensions
-            Simantics.getSession().asyncRequest(new ChooseActionRequest(shell, input, perspectiveId, false, true));
-        } catch (NumberFormatException e) {
-            return;
-        }
+        DefaultActions.performDefaultAction(shell, new StructuredSelection(resource));
     }
 
     @Override