X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=eclipse%2Fplugins%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fcommands%2FRunSlcFlow.java;fp=eclipse%2Fplugins%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fcommands%2FRunSlcFlow.java;h=0000000000000000000000000000000000000000;hb=651d33e13bfa9a7b46464be412023ee747e612e8;hp=00f989d62127c4869751cbaf07404b4133c3d343;hpb=868102c0f0220e12eca836b6ec9b3a2b9a3441e4;p=gpl%2Fargeo-slc.git diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/RunSlcFlow.java b/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/RunSlcFlow.java deleted file mode 100644 index 00f989d62..000000000 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/RunSlcFlow.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.argeo.slc.client.ui.commands; - -import java.util.HashMap; -import java.util.Map; - -import org.argeo.slc.SlcException; -import org.argeo.slc.execution.ExecutionFlowDescriptor; -import org.argeo.slc.execution.ExecutionModulesManager; -import org.argeo.slc.process.RealizedFlow; -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IParameter; - -public class RunSlcFlow extends AbstractHandler { - private ExecutionModulesManager modulesManager; - - public Object execute(ExecutionEvent event) throws ExecutionException { - try { - Command command = event.getCommand(); - String name = command.getName(); - String module = name.substring(0, name.indexOf(':')); - String flowName = name.substring(name.indexOf(':') + 1); - - final RealizedFlow realizedFlow = new RealizedFlow(); - realizedFlow.setModuleName(module); - // FIXME deal with version - String version = "0.0.0"; - realizedFlow.setModuleVersion(version); - ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor(); - efd.setName(flowName); - - Map values = new HashMap(); - if (command.getParameters() != null) { - for (IParameter param : command.getParameters()) { - String argName = param.getId(); - // FIXME make it safer - Object value = param.getValues().getParameterValues() - .values().iterator().next(); - values.put(argName, value); - } - efd.setValues(values); - } - realizedFlow.setFlowDescriptor(efd); - // new Thread("SLC Flow " + name + " from Eclipse command " - // + command.getId()) { - // public void run() { - modulesManager.start(realizedFlow.getModuleNameVersion()); - modulesManager.execute(realizedFlow); - // } - // }.start(); - return null; - } catch (Exception e) { - throw new SlcException("Could not execute command " - + event.getCommand() + " as SLC flow", e); - } - } - - public void setModulesManager( - ExecutionModulesManager executionModulesManager) { - this.modulesManager = executionModulesManager; - } - -}