]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Remove empty submenu when no component is specified. 53/2753/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Wed, 6 Mar 2019 13:41:59 +0000 (15:41 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Wed, 6 Mar 2019 13:48:37 +0000 (15:48 +0200)
gitlab #34

Change-Id: I2861a8d6217e785e31852dd1f5a5b785becd79fd

org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/NetworkElementActionMenuContribution.java

index b3cc0891daf05e03d54d519a1cbe64f883368fa5..ec03ab87ffe5020c22d6106640ec53a204137025 100644 (file)
@@ -59,6 +59,9 @@ public class NetworkElementActionMenuContribution {
             return;
         }
         
+        if (actions == null || actions.isEmpty())
+            return;
+        
         items.add(MMenuFactory.INSTANCE.createMenuSeparator());
         MMenu subMenu = MMenuFactory.INSTANCE.createMenu();
         List<MMenuElement> children = subMenu.getChildren();