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=af092562f09e54fb506a59c6c64faec4d35681ce;p=simantics%2Fdistrict.git Remove empty submenu when no component is specified. gitlab #34 Change-Id: I2861a8d6217e785e31852dd1f5a5b785becd79fd (cherry picked from commit dc102769bb96829eb953cd21917b8adb42a0729c) --- 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 cca37172..e29d11a2 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 @@ -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 children = subMenu.getChildren();