X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=eclipse%2Fplugins%2Fruntime%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fcommands%2FProcessDetailsDisplayHandler.java;fp=eclipse%2Fplugins%2Fruntime%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fcommands%2FProcessDetailsDisplayHandler.java;h=cdc28812b33e561b6cf6702e2060b15f18df3c16;hb=5e5b06fe0c831e66bc048d8bf8da40b32f79a5c9;hp=0000000000000000000000000000000000000000;hpb=09787bd2df473bd311af94f1af22c7f802257751;p=gpl%2Fargeo-slc.git diff --git a/eclipse/plugins/runtime/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/ProcessDetailsDisplayHandler.java b/eclipse/plugins/runtime/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/ProcessDetailsDisplayHandler.java new file mode 100644 index 000000000..cdc28812b --- /dev/null +++ b/eclipse/plugins/runtime/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/commands/ProcessDetailsDisplayHandler.java @@ -0,0 +1,43 @@ +package org.argeo.slc.client.ui.commands; + +import org.argeo.slc.client.ui.views.ProcessDetailView; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * Command handler to set visible or create a ProcessDetailView. UUID of the + * process is passed via command parameters. + * + * @author bsinou + * + */ + +public class ProcessDetailsDisplayHandler extends AbstractHandler { + // private static final Log log = LogFactory + // .getLog(ProcessDetailsDisplayHandler.class); + + public Object execute(ExecutionEvent event) throws ExecutionException { + + // We pass the UUID of the process we want to display via command + // parameters. + String uuid = event + .getParameter("org.argeo.slc.client.commands.processUuid"); + + // mode = 1 : VIEW_ACTIVATE, Show view mode that indicates the view + // should be made visible and activated. Use of this mode has the same + // effect as calling showView. + try { + ProcessDetailView pView = (ProcessDetailView) HandlerUtil + .getActiveWorkbenchWindow(event).getActivePage() + .showView(ProcessDetailView.ID, "UUID-" + uuid, 1); + pView.setUuid(uuid); + pView.retrieveResults(); + } catch (Exception e) { + e.printStackTrace(); + } + + return null; + } +}