import org.simantics.g2d.diagram.DiagramHints;
import org.simantics.layer0.Layer0;
import org.simantics.modeling.ComponentUtils;
+import org.simantics.modeling.ModelingResources;
import org.simantics.modeling.actions.NavigateToTarget;
import org.simantics.modeling.ui.Activator;
import org.simantics.structural.stubs.StructuralResource2;
super(Messages.OpenDiagramFromConfigurationAdapter_DiagramEditor, Activator.COMPOSITE_ICON);
}
- protected String getEditorId() {
- return EDITOR_ID;
+ protected String getEditorId(ReadGraph g, Resource composite) throws DatabaseException {
+ ModelingResources MOD = ModelingResources.getInstance(g);
+ String preferredEditorId = g.getPossibleRelatedValue(composite, MOD.PreferredDiagramEditorID);
+ if(preferredEditorId != null)
+ return preferredEditorId;
+ else
+ return EDITOR_ID;
}
@Override
Simantics.getSession().asyncRequest(new ReadRequest() {
@Override
public void run(ReadGraph g) throws DatabaseException {
- openEditor(g, r, getEditorId());
+ openEditor(g, r, getEditorId(g, r));
}
});
}