]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ProfileSelectionProcessor.java
Better support for ontological profiles
[simantics/platform.git] / bundles / org.simantics.diagram.profile / src / org / simantics / diagram / profile / view / ProfileSelectionProcessor.java
index 118d46f8e7c9edba9c88782b1730e0d5b9dbbe6e..c060f067ae22cd02ffd19becde47358d63cb8a19 100644 (file)
@@ -25,7 +25,7 @@ public class ProfileSelectionProcessor implements SelectionProcessor<Object, Rea
     public Collection<?> process(Object selection, ReadGraph g) {
         try {
             Resource object = ISelectionUtils.getSinglePossibleKey(selection, SelectionHints.KEY_MAIN, Resource.class);
-            ResourcePair object2 = ISelectionUtils.getSinglePossibleKey(selection, SelectionHints.KEY_MAIN, ResourcePair.class);
+            ProfileTuple object2 = ISelectionUtils.getSinglePossibleKey(selection, SelectionHints.KEY_MAIN, ProfileTuple.class);
 
             return processInternal(g, object, object2, selection);
                
@@ -36,7 +36,7 @@ public class ProfileSelectionProcessor implements SelectionProcessor<Object, Rea
         return Collections.emptyList();
     }
 
-    private Collection<?> processInternal(ReadGraph g, Resource object, ResourcePair pair, Object selection) throws DatabaseException {
+    private Collection<?> processInternal(ReadGraph g, Resource object, ProfileTuple pair, Object selection) throws DatabaseException {
 
        Collection<Object> inputs = new ArrayList<Object>();
        
@@ -59,11 +59,11 @@ public class ProfileSelectionProcessor implements SelectionProcessor<Object, Rea
         return result;
     }
 
-    private void parseResourceInput(ReadGraph g, Resource part, ResourcePair pair, Collection<Object> inputs) throws DatabaseException {
+    private void parseResourceInput(ReadGraph g, Resource part, ProfileTuple pair, Collection<Object> inputs) throws DatabaseException {
         getGroups(g, part, pair, inputs);
     }
 
-    void getGroups(ReadGraph g, Resource r, ResourcePair p, Collection<Object> result) throws DatabaseException {
+    void getGroups(ReadGraph g, Resource r, ProfileTuple p, Collection<Object> result) throws DatabaseException {
         DiagramResource dr = DiagramResource.getInstance(g);
         if (r != null && g.isInstanceOf(r, dr.SCLGroup)) {
             result.add(new SCLInput(r, 1, "SCL Group"));
@@ -71,12 +71,12 @@ public class ProfileSelectionProcessor implements SelectionProcessor<Object, Rea
         if (r != null && g.isInstanceOf(r, dr.SCLTextStyle)) {
             result.add(new SCLInput(r, 2, "SCL Text Style"));
         }
-        if (p != null && g.isInstanceOf(p.getSecond(), dr.GroupStyleProfileEntry)) {
-               Resource group = g.getPossibleObject(p.getSecond(), dr.ProfileEntry_HasGroup);
+        if (p != null && g.isInstanceOf(p.getEntry(), dr.GroupStyleProfileEntry)) {
+               Resource group = g.getPossibleObject(p.getEntry(), dr.ProfileEntry_HasGroup);
                        if (group != null && g.isInstanceOf(group, dr.SCLGroup)) {
                 result.add(new SCLInput(group, 1, "SCL Group"));
             }
-               Resource style = g.getPossibleObject(p.getSecond(), dr.ProfileEntry_HasStyle);
+               Resource style = g.getPossibleObject(p.getEntry(), dr.ProfileEntry_HasStyle);
                        if (style != null && g.isInstanceOf(style, dr.SCLTextStyle)) {
                 result.add(new SCLInput(style, 2, "SCL Text Style"));
             }