]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Add a "Properties" tab to selection view for pipeline components. 57/3457/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Wed, 6 Nov 2019 10:51:14 +0000 (12:51 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Wed, 6 Nov 2019 12:59:19 +0000 (14:59 +0200)
refs #49

Change-Id: Id61d4186f8a33e33308adaf0d262130c0e6c5ddd

org.simantics.plant3d/src/org/simantics/plant3d/property/P3DSelectionProcessor.java

index 4970d0e961c18e01389d7f874f8fde631e85ff1b..e48f33201a5c3cb120c946c4dca5925273640fe8 100644 (file)
@@ -70,7 +70,7 @@ public class P3DSelectionProcessor implements SelectionProcessor<Object, ReadGra
                                        throw new NullPointerException();
                                result.add(new ComparableTabContributor(new VTKPropertyTabContributor(SWTThread.getThreadAccess()), -2, prop, "VTK"));
                        }
-
+                       
                        if (resourceCollection.size() > 0) {
                                if (resourceCollection.size() > 1)
                                        result.add(new ComparableTabContributor(new MultiSelectionTabContibutor(),0, resourceCollection, "Graph"));
@@ -83,9 +83,18 @@ public class P3DSelectionProcessor implements SelectionProcessor<Object, ReadGra
                                                e.printStackTrace();
                                        }
                                }
-                       }  
+                       }
                }
 
+               if (resourceCollection.size() == 1){
+                       try {
+                               Resource r = resourceCollection.iterator().next();
+                               result.add(new ComparableTabContributor(new P3DBasicPropertyTab(!readOnly), 0, r, "Properties"));
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+               }
+               
                if(result.size() == 0) {
                        result.add(new ComparableTabContributor(new NoneSelectionTabContributor(),0, resourceCollection, "Empty"));
                }
@@ -99,6 +108,8 @@ public class P3DSelectionProcessor implements SelectionProcessor<Object, ReadGra
                public P3DBasicPropertyTab(boolean enabled) {
                        this.enabled = enabled;
                }
+               
+               
 
                @Override
                public void updatePartName(ISelection forSelection, Consumer<String> updateCallback) {