import org.simantics.db.exception.DatabaseException;
import org.simantics.db.management.ISessionContext;
import org.simantics.db.procedure.Procedure;
+import org.simantics.diagram.runtime.RuntimeDiagramManager;
import org.simantics.diagram.stubs.DiagramResource;
import org.simantics.utils.ObjectUtils;
import org.simantics.utils.ui.SWTUtils;
}
protected void editorActivated(IEditorPart part) {
- Resource resource = part.getAdapter(Resource.class);
+ RuntimeDiagramManager rdm = part.getAdapter(RuntimeDiagramManager.class);
+ Resource resource = null;
+ if (rdm != null)
+ resource = rdm.getRuntimeDiagram();
+ if (resource == null)
+ resource = part.getAdapter(Resource.class);
lastInputResource = resource;
if (ownerIsVisible) {
testAndChangeInput(resource);
Resource composite = graph.getPossibleObject(diagram, ModelingResources.getInstance(graph).DiagramToComposite);
if (composite != null) {
variable = Variables.getPossibleVariable(graph, composite);
+ } else {
+ variable = Variables.getPossibleVariable(graph, diagram);
}
}
private static final String DECORATION_NODE_NAME = "issueDecorations"; //$NON-NLS-1$
- private List<Resource> getContexts(ReadGraph graph, Resource element) throws DatabaseException {
+ protected List<Resource> getContexts(ReadGraph graph, Resource element) throws DatabaseException {
ModelingResources MOD = ModelingResources.getInstance(graph);
List<Resource> result = new ArrayList<Resource>(3);