]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/expressions/SCLExpressionView.java
Ctrl+Shift+G support for finding also expressions from properties
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / scl / expressions / SCLExpressionView.java
index d9bf77e47555210c64a31b0d46f89501bbd05c07..245796c551ad76d629566772195b27edd2a5136c 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,11 +39,16 @@ 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.scl.db.SCLExpressionTableEntry;
+import org.simantics.scl.db.UsedSCLExpressionsRequest;
+import org.simantics.ui.workbench.action.DefaultActions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SCLExpressionView extends ViewPart {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(SCLExpressionView.class);
+
     private TableViewer tableViewer;
     private TableViewerColumn expressionColumn;
     private TableViewerColumn locationColumn;
@@ -160,7 +164,7 @@ public class SCLExpressionView extends ViewPart {
                     });
                     return Status.OK_STATUS;
                 } catch (DatabaseException e) {
-                    e.printStackTrace();
+                    LOGGER.error("Could not update SCL expressions", e);
                     return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not update SCL expressions", e);
                 }
             }
@@ -169,14 +173,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