From dc102769bb96829eb953cd21917b8adb42a0729c 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 --- .../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 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(); -- 2.47.1