From: Miro Richard Eklund Date: Tue, 31 Jul 2018 10:39:19 +0000 (+0300) Subject: Added static handler without event as input to AssignSymbolGroupsHandler X-Git-Tag: v1.43.0~136^2~427 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=f045dba4f92ef0bf55069443b6386303bc869938;p=simantics%2Fplatform.git 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 --- 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; }