From af092562f09e54fb506a59c6c64faec4d35681ce Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Wed, 6 Mar 2019 15:41:59 +0200 Subject: [PATCH] Remove empty submenu when no component is specified. gitlab #34 Change-Id: I2861a8d6217e785e31852dd1f5a5b785becd79fd (cherry picked from commit dc102769bb96829eb953cd21917b8adb42a0729c) --- .../ui/contributions/NetworkElementActionMenuContribution.java | 3 +++ 1 file changed, 3 insertions(+) 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(); -- 2.47.1