]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/AssignSymbolGroupsHandler.java
Added static handler without event as input to AssignSymbolGroupsHandler
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / actions / AssignSymbolGroupsHandler.java
index 36b32e756ed4a87c08e313b5cedc351442037e65..59e9d8c0701ab4ebad0a5209bb784ad2dcb01a8f 100644 (file)
@@ -22,6 +22,10 @@ import org.simantics.utils.ui.ISelectionUtils;
  */
 public class AssignSymbolGroupsHandler extends AbstractHandler {
 
+       public static Object handleStatic(Collection<Resource> 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<Resource> res = ISelectionUtils.getPossibleKeys(s, SelectionHints.KEY_MAIN, Resource.class);
+               return executeImpl(res);
+       }
+       
+       private static Object executeImpl(Collection<Resource> res) throws ExecutionException {
                if (!res.isEmpty())
                        new AssignSymbolGroup().assignGroups(res);
-
                return null;
        }