]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Remove empty submenu when no component is specified. 11/3211/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Wed, 6 Mar 2019 13:41:59 +0000 (15:41 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 6 Sep 2019 08:18:52 +0000 (08:18 +0000)
gitlab #34

Change-Id: I2861a8d6217e785e31852dd1f5a5b785becd79fd
(cherry picked from commit dc102769bb96829eb953cd21917b8adb42a0729c)

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

index cca371728d8dcb13a95feb81ca26589f0f5bd009..e29d11a22e2f0ec919d9c5e397b6b78c606344c8 100644 (file)
@@ -62,6 +62,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();