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;
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;
});
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);
}
}
}
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