From f045dba4f92ef0bf55069443b6386303bc869938 Mon Sep 17 00:00:00 2001 From: Miro Richard Eklund Date: Tue, 31 Jul 2018 13:39:19 +0300 Subject: [PATCH] Added static handler without event as input to AssignSymbolGroupsHandler This minor change is needed by sysdyn to be able to add Modules to symbol groups. gitlab #69 Change-Id: I7df2c397a299e1a49a7912809fa7773917e6cfe3 --- .../modeling/ui/actions/AssignSymbolGroupsHandler.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/AssignSymbolGroupsHandler.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/AssignSymbolGroupsHandler.java index 36b32e756..59e9d8c07 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/AssignSymbolGroupsHandler.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/AssignSymbolGroupsHandler.java @@ -22,6 +22,10 @@ import org.simantics.utils.ui.ISelectionUtils; */ public class AssignSymbolGroupsHandler extends AbstractHandler { + public static Object handleStatic(Collection res) throws ExecutionException { + return executeImpl(res); + } + @Override public Object execute(ExecutionEvent event) throws ExecutionException { ISelection s = HandlerUtil.getCurrentSelection(event); @@ -29,9 +33,12 @@ public class AssignSymbolGroupsHandler extends AbstractHandler { return null; Collection res = ISelectionUtils.getPossibleKeys(s, SelectionHints.KEY_MAIN, Resource.class); + return executeImpl(res); + } + + private static Object executeImpl(Collection res) throws ExecutionException { if (!res.isEmpty()) new AssignSymbolGroup().assignGroups(res); - return null; } -- 2.47.1