1 package fi.vtt.simantics.processeditor.handlers;
\r
3 import org.simantics.db.Graph;
\r
4 import org.simantics.db.Resource;
\r
5 import org.simantics.proconf.ui.workbench.ResourceEditorInput;
\r
6 import org.simantics.proconf.ui.workbench.editor.SimpleEditorAdapter;
\r
7 import org.simantics.utils.ui.BundleUtils;
\r
8 import org.simantics.utils.ui.workbench.WorkbenchUtils;
\r
10 import fi.vtt.simantics.processeditor.Activator;
\r
11 import fi.vtt.simantics.processeditor.ProcessResource;
\r
14 * EditorAdapter for EquipmentEditor
\r
16 * @author Marko Luukkainen <Marko.Luukkainen@vtt.fi>
\r
19 public class EquipmentEditorAdapter extends SimpleEditorAdapter {
\r
20 public EquipmentEditorAdapter() {
\r
21 super("Equipment Editor",
\r
22 BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/tank.png"),
\r
27 public boolean canHandle(Graph g, Resource r) {
\r
28 if(ProcessResource.plant3Dresource == null) return false;
\r
29 if(ProcessResource.plant3Dresource.Plant == null) return false;
\r
30 if(!g.isInstanceOf(r, ProcessResource.plant3Dresource.Equipment)) return false;
\r
36 public void openEditor(Resource r) throws Exception {
\r
37 WorkbenchUtils.openEditor("org.simantics.proconf.processeditor.equipmenteditor", new ResourceEditorInput("org.simantics.proconf.processeditor.equipmenteditor",r));
\r