-package org.simantics.modeling.ui.actions;\r
-\r
-import java.util.Collection;\r
-\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.jface.viewers.ISelection;\r
-import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.eclipse.ui.handlers.HandlerUtil;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.layer0.SelectionHints;\r
-import org.simantics.db.layer0.adapter.ActionFactory;\r
-import org.simantics.utils.ui.ISelectionUtils;\r
-\r
-/**\r
- * This class exists as a org.eclipse.ui.handler extension point counterpart for\r
- * AssignSymbolGroup ActionFactory due to lack of multi-selection support in the\r
- * modeled {@link ActionFactory} contributions.\r
- * \r
- * @author Tuukka Lehtonen <tuukka.lehtonen@semantum.fi>\r
- */\r
-public class AssignSymbolGroupsHandler extends AbstractHandler {\r
-\r
- @Override\r
- public Object execute(ExecutionEvent event) throws ExecutionException {\r
- ISelection s = HandlerUtil.getCurrentSelection(event);\r
- if (!(s instanceof IStructuredSelection))\r
- return null;\r
-\r
- Collection<Resource> res = ISelectionUtils.getPossibleKeys(s, SelectionHints.KEY_MAIN, Resource.class);\r
- if (!res.isEmpty())\r
- new AssignSymbolGroup().assignGroups(res);\r
-\r
- return null;\r
- }\r
-\r
-}\r
+package org.simantics.modeling.ui.actions;
+
+import java.util.Collection;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.simantics.db.Resource;
+import org.simantics.db.layer0.SelectionHints;
+import org.simantics.db.layer0.adapter.ActionFactory;
+import org.simantics.utils.ui.ISelectionUtils;
+
+/**
+ * This class exists as a org.eclipse.ui.handler extension point counterpart for
+ * AssignSymbolGroup ActionFactory due to lack of multi-selection support in the
+ * modeled {@link ActionFactory} contributions.
+ *
+ * @author Tuukka Lehtonen <tuukka.lehtonen@semantum.fi>
+ */
+public class AssignSymbolGroupsHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection s = HandlerUtil.getCurrentSelection(event);
+ if (!(s instanceof IStructuredSelection))
+ return null;
+
+ Collection<Resource> res = ISelectionUtils.getPossibleKeys(s, SelectionHints.KEY_MAIN, Resource.class);
+ if (!res.isEmpty())
+ new AssignSymbolGroup().assignGroups(res);
+
+ return null;
+ }
+
+}