From: Reino Ruusu Date: Wed, 6 Mar 2019 13:41:59 +0000 (+0200) Subject: Remove empty submenu when no component is specified. X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F2753%2F1;p=simantics%2Fdistrict.git Remove empty submenu when no component is specified. gitlab #34 Change-Id: I2861a8d6217e785e31852dd1f5a5b785becd79fd --- diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/NetworkElementActionMenuContribution.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/NetworkElementActionMenuContribution.java index b3cc0891..ec03ab87 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/NetworkElementActionMenuContribution.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/NetworkElementActionMenuContribution.java @@ -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 children = subMenu.getChildren();