X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram.profile%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fprofile%2Fview%2FProfileCheckContributor.java;h=544c394c52714373d7746b71d1e8b3f60d4667a8;hp=2bc9f320fc84b49dd911f906bd627a086be71758;hb=11532e91770beadd55d85037c4b5e00bbcace69f;hpb=d0f755ad31c06641f8e9a9010a79356f483340c5 diff --git a/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ProfileCheckContributor.java b/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ProfileCheckContributor.java index 2bc9f320f..544c394c5 100644 --- a/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ProfileCheckContributor.java +++ b/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ProfileCheckContributor.java @@ -35,22 +35,22 @@ public class ProfileCheckContributor implements CheckedStateRule { throws DatabaseException { ResourcePair entry = (ResourcePair)parent; + Resource activeProfile = entry.getFirst(); DiagramResource DIA = DiagramResource.getInstance(graph); SimulationResource SIMU = SimulationResource.getInstance(graph); if(graph.isInstanceOf(entry.getSecond(), DIA.Profile)) { - Resource list = graph.getPossibleObject(entry.getSecond(), DIA.HasEntries); - Collection activeEntries = graph.syncRequest( new ProfileActiveEntryResources(entry.getFirst(), list) ); + Collection activeEntries = graph.syncRequest( new ProfileActiveEntryResources(activeProfile, list) ); if (activeEntries.isEmpty()) { return CheckedState.NOT_CHECKED; } else { - Collection entries = graph.syncRequest( new ProfileEntryResources(entry.getFirst(), list) ); + Collection entries = graph.syncRequest( new ProfileEntryResources(activeProfile, list) ); return entries.equals(activeEntries) ? CheckedState.CHECKED : CheckedState.GRAYED; } } else if(graph.isInstanceOf(entry.getSecond(), DIA.ProfileEntry)) { - if(graph.hasStatement(entry.getFirst(), SIMU.IsActive, entry.getSecond())) return CheckedState.CHECKED; + if(graph.hasStatement(activeProfile, SIMU.IsActive, entry.getSecond())) return CheckedState.CHECKED; } return CheckedState.NOT_CHECKED;