<extension
point="org.eclipse.ui.perspectives">
<perspective
- name="Perspective"
+ name="Slc Execution"
class="org.argeo.slc.client.ui.perspectives.SlcExecution"
- id="org.argeo.slc.client.ui.perspectives.slcExecution">
+ id="org.argeo.slc.client.ui.perspectives.slcExecution"
+ icon="icons/slc_execution_perspective.gif">
</perspective>
</extension>
<extension
<bean id="org.argeo.slc.client.ui.clearBatch" class="org.argeo.slc.client.ui.commands.ClearBatchHandler"
scope="prototype">
</bean>
- <bean id="org.argeo.slc.client.ui.editRealizedFlowDetails"
- class="org.argeo.slc.client.ui.commands.EditRealizedFlowDetailsHandler"
- scope="prototype">
- <property name="oxmBean" ref="oxmBean" />
- </bean>
</beans>
<extension
point="org.eclipse.ui.views">
<view
- id="org.argeo.slc.client.ui.executionModulesView"
class="org.argeo.eclipse.spring.SpringExtensionFactory"
+ icon="icons/execution_module.gif"
+ id="org.argeo.slc.client.ui.executionModulesView"
name="Execution Modules"
restorable="true">
</view>
<view
- id="org.argeo.slc.client.ui.resultListView"
class="org.argeo.eclipse.spring.SpringExtensionFactory"
+ icon="icons/results.gif"
+ id="org.argeo.slc.client.ui.resultListView"
name="Results"
restorable="true">
</view>
<view
- id="org.argeo.slc.client.ui.resultDetailView"
- class="org.argeo.eclipse.spring.SpringExtensionFactory"
- name="Result Detail"
allowMultiple="true"
+ class="org.argeo.eclipse.spring.SpringExtensionFactory"
+ icon="icons/result_details.gif"
+ id="org.argeo.slc.client.ui.resultDetailView"
+ name="Result details"
restorable="true">
</view>
<view
id="org.argeo.slc.client.ui.processListView"
class="org.argeo.eclipse.spring.SpringExtensionFactory"
- name="Process List"
+ name="Processes"
+ icon="icons/processes.gif"
restorable="true">
</view>
<view
- id="org.argeo.slc.client.ui.processDetailView"
- class="org.argeo.eclipse.spring.SpringExtensionFactory"
- name="Process Details"
allowMultiple="true"
+ class="org.argeo.eclipse.spring.SpringExtensionFactory"
+ icon="icons/process_details.gif"
+ id="org.argeo.slc.client.ui.processDetailView"
+ name="Process details"
restorable="true">
</view>
<view
- id="org.argeo.slc.client.ui.processParametersView"
class="org.argeo.eclipse.spring.SpringExtensionFactory"
+ icon="icons/edit_parameters.gif"
+ id="org.argeo.slc.client.ui.processParametersView"
name="Process Parameters"
restorable="true">
</view>
<view
- id="org.argeo.slc.client.ui.processBuilderView"
class="org.argeo.eclipse.spring.SpringExtensionFactory"
- name="Process Builder"
+ icon="icons/batch.gif"
+ id="org.argeo.slc.client.ui.processBuilderView"
+ name="Batch"
restorable="true">
</view>
</extension>
name="Result UUID">
</commandParameter>
</command>
- <command
- defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
- id="org.argeo.slc.client.ui.editRealizedFlowDetails"
- name="EditRealizedFlowDetails">
- <commandParameter
- id="org.argeo.slc.client.commands.realizedFlowAsXml"
- name="RealizedFlowAsXml">
- </commandParameter>
- <commandParameter
- id="org.argeo.slc.client.commands.realizedFlowIndex"
- name="realizedFlowIndex">
- </commandParameter>
- </command>
</extension>
<extension
point="org.eclipse.ui.bindings">
locationURI="toolbar:org.argeo.slc.client.ui.processBuilderView">
<command
commandId="org.argeo.slc.client.ui.launchBatch"
+ icon="icons/launch.gif"
label="Launch Batch"
tooltip="Launch the batch built in the process builder view.">
</command>
<command
commandId="org.argeo.slc.client.ui.clearBatch"
label="Clear Batch"
+ icon="icons/clear_batch.gif"
tooltip="Clear the batch built in the process builder view.">
</command>
<command
commandId="org.argeo.slc.client.ui.removeSelectedFromBatch"
+ icon="icons/remove_one.gif"
label="Remove Selected From Batch"
tooltip="Remove selected process from process builder view.">
</command>
reg.put("agent", getImageDescriptor("icons/computer.png"));
reg.put("executionModule", getImageDescriptor("icons/archive.png"));
reg.put("folder", getImageDescriptor("icons/folder.png"));
- // reg.put("flow", getImageDescriptor("icons/slc-launch.gif"));
reg.put("flow", getImageDescriptor("icons/system.png"));
- reg.put("passedTest", getImageDescriptor("icons/OK.png"));
- reg.put("failedTest", getImageDescriptor("icons/error.png"));
+ reg.put("processes", getImageDescriptor("icons/processes.gif"));
+ reg.put("passedTest", getImageDescriptor("icons/passed.gif"));
+ reg.put("failedTest", getImageDescriptor("icons/error.gif"));
}
public BundleContext getBundleContext() {
+++ /dev/null
-package org.argeo.slc.client.ui.commands;
-
-import org.argeo.slc.client.oxm.OxmInterface;
-import org.argeo.slc.client.ui.views.ProcessParametersView;
-import org.argeo.slc.process.RealizedFlow;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- *
- * @author bsinou
- *
- * Command handler to display and edit the attributes of a given
- * Realizedflow. The corresponding RealizedFlow is passed via command
- * parameters and unmarshalled with the oxmBean which is injected by
- * Spring.
- *
- * Note thet passing an index of -1 will cause the reset of the View
- * (used among others when removing processes from the batch).
- */
-
-public class EditRealizedFlowDetailsHandler extends AbstractHandler {
-
- // IoC
- private OxmInterface oxmBean;
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- // We pass Realized flow through command parameters as XML
- String rfAsXml = event
- .getParameter("org.argeo.slc.client.commands.realizedFlowAsXml");
- int index = new Integer(
- event.getParameter("org.argeo.slc.client.commands.realizedFlowIndex"))
- .intValue();
- try {
- ProcessParametersView ppView = (ProcessParametersView) HandlerUtil
- .getActiveWorkbenchWindow(event).getActivePage()
- .showView(ProcessParametersView.ID);
-
- if (index == -1)
- ppView.setRealizedFlow(-1, null);
- else {
- RealizedFlow rf = (RealizedFlow) oxmBean.unmarshal(rfAsXml);
- ppView.setRealizedFlow(index, rf);
-
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- // IoC
- public void setOxmBean(OxmInterface oxmBean) {
- this.oxmBean = oxmBean;
- }
-
-}
layout.setEditorAreaVisible(false);
layout.setFixed(false);
- IFolderLayout topLeft = layout.createFolder("topLeft",
- IPageLayout.LEFT, 0.7f, editorArea);
- topLeft.addView("org.argeo.slc.client.ui.executionModulesView");
+ // Create the main ui layout
+
+ // For a vertical split, the part on top gets the specified ratio of the
+ // current space and the part on bottom gets the rest. Likewise, for a
+ // horizontal split, the part at left gets the specified ratio of the
+ // current space.
+ IFolderLayout main = layout.createFolder("main", IPageLayout.RIGHT,
+ 0.3f, editorArea);
+ IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
+ 0.3f, editorArea);
+
+ IFolderLayout bottom = layout.createFolder("bottom",
+ IPageLayout.BOTTOM, 0.65f, "main");
IFolderLayout topRight = layout.createFolder("topRight",
- IPageLayout.RIGHT, 0.3f, editorArea);
- topRight.addView("org.argeo.slc.client.ui.resultListView");
- topRight.addPlaceholder("org.argeo.slc.client.ui.resultDetailView:UUID-*");
-
- IFolderLayout bottomRight = layout.createFolder("bottomRight",
- IPageLayout.BOTTOM, 0.6f, "topRight");
- bottomRight.addView("org.argeo.slc.client.ui.processListView");
- bottomRight
- .addPlaceholder("org.argeo.slc.client.ui.processDetailView:UUID-*");
-
- IFolderLayout bottomLeft = layout.createFolder("bottomLeft",
- IPageLayout.BOTTOM, 0.6f, "topLeft");
- bottomLeft.addView("org.argeo.slc.client.ui.processBuilderView");
- IFolderLayout paramsEditor = layout.createFolder("paramsEditor",
- IPageLayout.RIGHT, 0.6f, "bottomLeft");
- paramsEditor.addView("org.argeo.slc.client.ui.processParametersView");
+ IPageLayout.RIGHT, 0.6f, "main");
+
+ // add the views to the corresponding place holder
+ left.addView("org.argeo.slc.client.ui.executionModulesView");
+ left.addView("org.argeo.slc.client.ui.resultListView");
+
+ main.addView("org.argeo.slc.client.ui.processBuilderView");
+ main.addPlaceholder("org.argeo.slc.client.ui.resultDetailView:UUID-*");
+ main.addPlaceholder("org.argeo.slc.client.ui.processDetailView:UUID-*");
+
+ bottom.addView("org.argeo.slc.client.ui.processListView");
+ topRight.addView("org.argeo.slc.client.ui.processParametersView");
}
}
/**
*
- * @author bsinou
*
- * This class implements the ability to edit and save various type of
+ * Implements the ability to edit and save various type of
* parameter of a given process. Parameter values are directly saved as
* soon as the focus on a given field is lost.
*
*
- * Note that this EditingSupport is tightly coupled with both
+ * Note that EditingSupport is tightly coupled with both
* ProcessParametersView and ProcessBuilderView; it cannot serve as a
* generic EditingSupport as is. Note also that it assumes that the
* processes in ProcessBuilderView as stored as an ordered list.
+
+ @author bsinou
+ *
*/
public class ProcessParametersEditingSupport extends EditingSupport {
import org.argeo.slc.process.RealizedFlow;
import org.argeo.slc.process.SlcExecution;
import org.argeo.slc.runtime.SlcAgent;
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.IParameter;
-import org.eclipse.core.commands.Parameterization;
-import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.ViewPart;
/**
// we clear the list
realizedFlows = new ArrayList<RealizedFlow>();
curSelectedRow = -1;
- refreshParameterview(null);
+ refreshParameterview();
viewer.refresh();
}
else
realizedFlows.remove(curSelectedRow);
curSelectedRow = -1;
- refreshParameterview(null);
+ refreshParameterview();
viewer.refresh();
}
// calling this method with index =-1 will cause the reset of the view.
- private void refreshParameterview(RealizedFlow rf) {
- IWorkbench iw = ClientUiPlugin.getDefault().getWorkbench();
- IHandlerService handlerService = (IHandlerService) iw
- .getService(IHandlerService.class);
+ private void refreshParameterview() {
+ // We choose to directly access the view rather than going through
+ // commands.
+ ProcessParametersView ppView;
try {
- // get the command from plugin.xml
- IWorkbenchWindow window = iw.getActiveWorkbenchWindow();
- ICommandService cmdService = (ICommandService) window
- .getService(ICommandService.class);
- Command cmd = cmdService.getCommand(EDIT_CMD);
-
- ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
-
- IParameter iparam;
- Parameterization params;
-
- // The current index to be able to records changes on
- // parameters
- iparam = cmd.getParameter(INDEX_PARAM);
- params = new Parameterization(iparam,
- (new Integer(curSelectedRow)).toString());
- parameters.add(params);
-
- if (curSelectedRow != -1) {
- // The current Realized flow marshalled as XML
- String result = oxmBean.marshal(rf);
- iparam = cmd.getParameter(FLOWASXML_PARAM);
- params = new Parameterization(iparam, result);
- parameters.add(params);
- }
- // build the parameterized command
- ParameterizedCommand pc = new ParameterizedCommand(cmd,
- parameters.toArray(new Parameterization[parameters.size()]));
-
- // execute the command
- handlerService = (IHandlerService) window
- .getService(IHandlerService.class);
- handlerService.executeCommand(pc, null);
-
- } catch (Exception e) {
- e.printStackTrace();
- throw new SlcException("Problem while rendering result. "
- + e.getMessage());
+ ppView = (ProcessParametersView) ClientUiPlugin.getDefault()
+ .getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .showView(ProcessParametersView.ID);
+
+ if (curSelectedRow == -1)
+ ppView.setRealizedFlow(-1, null);
+ else
+ ppView.setRealizedFlow(curSelectedRow,
+ realizedFlows.get(curSelectedRow));
+ } catch (PartInitException e) {
+ throw new SlcException(
+ "Cannot Retrieve ProcessParameterView to edit parameters of selected process",
+ e);
}
-
}
// Return the list of the processes to execute.
if (obj instanceof RealizedFlow) {
RealizedFlow rf = (RealizedFlow) obj;
curSelectedRow = realizedFlows.indexOf(rf);
- refreshParameterview(rf);
+ refreshParameterview();
}
}
}
return false;
RealizedFlow rf = (RealizedFlow) oxmBean.unmarshal(fdXml);
realizedFlows.add(rf);
-
+ curSelectedRow = realizedFlows.indexOf(rf);
+ refreshParameterview();
getViewer().refresh();
return true;
}