1 package org.simantics.processeditor.handlers;
\r
3 import org.simantics.db.Graph;
\r
4 import org.simantics.db.Resource;
\r
5 import org.simantics.processeditor.Activator;
\r
6 import org.simantics.processeditor.ProcessResource;
\r
7 import org.simantics.proconf.ui.workbench.ResourceEditorInput;
\r
8 import org.simantics.proconf.ui.workbench.editor.SimpleEditorAdapter;
\r
9 import org.simantics.utils.ui.BundleUtils;
\r
10 import org.simantics.utils.ui.workbench.WorkbenchUtils;
\r
13 public class Plant3DEditorAdapter extends SimpleEditorAdapter {
\r
14 public Plant3DEditorAdapter() {
\r
15 super("PlantEditor",
\r
16 BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/factory.png"),
\r
21 public boolean canHandle(Graph g, Resource r) {
\r
22 if(ProcessResource.plant3Dresource == null) return false;
\r
23 if(ProcessResource.plant3Dresource.Plant == null) return false;
\r
24 return g.isInstanceOf(r, ProcessResource.plant3Dresource.Plant);
\r
29 public void openEditor(Resource r) throws Exception {
\r
30 WorkbenchUtils.openEditor("org.simantics.proconf.processeditor.planteditor", new ResourceEditorInput("org.simantics.proconf.processeditor.planteditor",r));
\r