[jbpm-cvs] jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/properties ...
Koen Aers <kaers <at> jboss.com>
2008-04-22 13:04:59 GMT
User: kaers
Date: 08/04/22 09:04:59
Modified: designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/properties
EsbConfigurationComposite.java
EsbGeneralConfigurationComposite.java
EsbInputOutputConfigurationComposite.java
Log:
GPD-202 & GPD-203
Revision Changes Path
1.4 +92 -22 jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/properties/EsbConfigurationComposite.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EsbConfigurationComposite.java
===================================================================
RCS file: /cvsroot/jbpm/jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/properties/EsbConfigurationComposite.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- EsbConfigurationComposite.java 28 Dec 2007 23:40:14 -0000 1.3
+++ EsbConfigurationComposite.java 22 Apr 2008 13:04:59 -0000 1.4
<at> <at> -3,13 +3,17 <at> <at>
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.jbpm.gd.common.model.GenericElement;
import org.jbpm.gd.jpdl.model.EsbNode;
-public class EsbConfigurationComposite {
+public class EsbConfigurationComposite implements SelectionListener {
public static EsbConfigurationComposite create(TabbedPropertySheetWidgetFactory
widgetFactory, Composite parent) {
EsbConfigurationComposite result = new EsbConfigurationComposite();
<at> <at> -22,8 +26,12 <at> <at>
private TabbedPropertySheetWidgetFactory widgetFactory;
private Composite parent;
private EsbNode esbNode;
+ private GenericElement[] savedEsbToJbpmMappings;
+ private Button oneWayButton;
private CTabFolder actionTabFolder;
+ private CTabItem outputTabItem;
+ private Composite outputTabControl;
private EsbGeneralConfigurationComposite esbGeneralConfigurationComposite;
private EsbInputOutputConfigurationComposite esbInputConfigurationComposite;
private EsbInputOutputConfigurationComposite esbOutputConfigurationComposite;
<at> <at> -44,27 +52,41 <at> <at>
return esbNode;
}
- private void unhookListeners() {}
- private void hookListeners() {}
+ private void unhookListeners() {
+ oneWayButton.removeSelectionListener(this);
+ }
+
+ private void hookListeners() {
+ oneWayButton.addSelectionListener(this);
+ }
private void clearControls() {
+ oneWayButton.setSelection(false);
esbGeneralConfigurationComposite.setEsbNode(null);
esbInputConfigurationComposite.setEsbNode(null);
+ if (outputTabItem != null) {
esbOutputConfigurationComposite.setEsbNode(null);
+ outputTabItem.dispose();
+ }
}
private void updateControls() {
+ oneWayButton.setSelection(esbNode.isOneWay());
esbGeneralConfigurationComposite.setEsbNode(esbNode);
esbInputConfigurationComposite.setEsbNode(esbNode);
+ if (!esbNode.isOneWay()) {
+ createOutputTabItem();
esbOutputConfigurationComposite.setEsbNode(esbNode);
}
+ }
private void create() {
+ oneWayButton = widgetFactory.createButton(parent, "One Way", SWT.CHECK);
+ oneWayButton.setLayoutData(createOneWayButtonLayoutData());
actionTabFolder = widgetFactory.createTabFolder(parent, SWT.TOP | SWT.BORDER);
actionTabFolder.setLayoutData(createEsbNodeTabFolderLayoutData());
createGeneralTabItem();
createInputTabItem();
- createOutputTabItem();
actionTabFolder.setSelection(0);
}
<at> <at> -78,36 +100,84 <at> <at>
}
private void createInputTabItem() {
- CTabItem detailsTabItem = widgetFactory.createTabItem(actionTabFolder, SWT.NORMAL);
- detailsTabItem.setText("Input");
- Composite detailsTabControl = widgetFactory.createFlatFormComposite(actionTabFolder);
+ CTabItem inputTabItem = widgetFactory.createTabItem(actionTabFolder, SWT.NORMAL);
+ inputTabItem.setText("Input");
+ Composite inputTabControl = widgetFactory.createFlatFormComposite(actionTabFolder);
esbInputConfigurationComposite =
EsbInputOutputConfigurationComposite.create(
widgetFactory,
- detailsTabControl,
+ inputTabControl,
EsbInputOutputConfigurationComposite.INPUT_CONFIGURATION);
- detailsTabItem.setControl(detailsTabControl);
+ inputTabItem.setControl(inputTabControl);
}
private void createOutputTabItem() {
- CTabItem advancedTabItem = widgetFactory.createTabItem(actionTabFolder, SWT.NORMAL);
- advancedTabItem.setText("Output");
- Composite advancedTabControl = widgetFactory.createFlatFormComposite(actionTabFolder);
+ outputTabItem = widgetFactory.createTabItem(actionTabFolder, SWT.NORMAL);
+ outputTabItem.setText("Output");
+ if (outputTabControl == null) {
+ outputTabControl = widgetFactory.createFlatFormComposite(actionTabFolder);
esbOutputConfigurationComposite =
EsbInputOutputConfigurationComposite.create(
widgetFactory,
- advancedTabControl,
+ outputTabControl,
EsbInputOutputConfigurationComposite.OUTPUT_CONFIGURATION);
- advancedTabItem.setControl(advancedTabControl);
+ }
+ outputTabItem.setControl(outputTabControl);
}
- private FormData createEsbNodeTabFolderLayoutData() {
+ private FormData createOneWayButtonLayoutData() {
FormData result = new FormData();
result.left = new FormAttachment(0, 0);
result.right = new FormAttachment(100, 0);
result.top = new FormAttachment(0, 0);
+ return result;
+ }
+
+ private FormData createEsbNodeTabFolderLayoutData() {
+ FormData result = new FormData();
+ result.left = new FormAttachment(0, 0);
+ result.right = new FormAttachment(100, 0);
+ result.top = new FormAttachment(oneWayButton, 5);
result.bottom = new FormAttachment(100, 0);
return result;
}
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ if (e.widget == oneWayButton) {
+ handleOneWayButtonSelected();
+ }
+ }
+
+ private void handleOneWayButtonSelected() {
+ if (oneWayButton.getSelection()) {
+ esbOutputConfigurationComposite.setEsbNode(null);
+ outputTabItem.dispose();
+ saveEsbToJbpmMappings();
+ } else {
+ createOutputTabItem();
+ restoreEsbToJbpmMappings();
+ esbOutputConfigurationComposite.setEsbNode(esbNode);
+ }
+ esbNode.setOneWay(oneWayButton.getSelection());
+ }
+
+ private void restoreEsbToJbpmMappings() {
+ if (savedEsbToJbpmMappings == null) return;
+ for (int i = 0; i < savedEsbToJbpmMappings.length; i++) {
+ esbNode.addEsbToJbpmMapping(savedEsbToJbpmMappings[i]);
+ }
+ }
+
+ private void saveEsbToJbpmMappings() {
+ GenericElement[] esbToJbpmMappings = esbNode.getEsbToJbpmMappings();
+ savedEsbToJbpmMappings = new GenericElement[esbToJbpmMappings.length];
+ for (int i = 0; i < esbToJbpmMappings.length; i++) {
+ savedEsbToJbpmMappings[i] = esbToJbpmMappings[i];
+ esbNode.removeEsbToJbpmMapping(esbToJbpmMappings[i]);
+ }
+ }
+
}
1.3 +0 -1 jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/properties/EsbGeneralConfigurationComposite.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EsbGeneralConfigurationComposite.java
===================================================================
RCS file: /cvsroot/jbpm/jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/properties/EsbGeneralConfigurationComposite.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- EsbGeneralConfigurationComposite.java 28 Dec 2007 00:07:30 -0000 1.2
+++ EsbGeneralConfigurationComposite.java 22 Apr 2008 13:04:59 -0000 1.3
<at> <at> -23,7 +23,6 <at> <at>
private TabbedPropertySheetWidgetFactory widgetFactory;
private Composite parent;
-
private Label serviceNameLabel;
private Text serviceNameText;
private Label categoryNameLabel;
1.3 +4 -4 jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/properties/EsbInputOutputConfigurationComposite.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EsbInputOutputConfigurationComposite.java
===================================================================
RCS file: /cvsroot/jbpm/jbpm.3/designer/jpdl/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/properties/EsbInputOutputConfigurationComposite.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- EsbInputOutputConfigurationComposite.java 28 Dec 2007 23:40:14 -0000 1.2
+++ EsbInputOutputConfigurationComposite.java 22 Apr 2008 13:04:59 -0000 1.3
<at> <at> -89,7 +89,7 <at> <at>
for (int i = 0; i < elements.length; i++) {
TableItem item = new TableItem(table, SWT.NONE);
item.setData(elements[i]);
- item.setText(jbpmColumnIndex(), getAttribute("jbpm", elements[i]));
+ item.setText(jbpmColumnIndex(), getAttribute("bpm", elements[i]));
item.setText(esbColumnIndex(), getAttribute("esb", elements[i]));
}
}
<at> <at> -177,9 +177,9 <at> <at>
element.setName("mapping");
addElement(element);
TableItem item = new TableItem(table, SWT.NONE);
- item.setText(jbpmColumnIndex(), getNextName("jbpm", jbpmColumnIndex()));
+ item.setText(jbpmColumnIndex(), getNextName("bpm", jbpmColumnIndex()));
item.setText(esbColumnIndex(), getNextName("esb", esbColumnIndex()));
- element.addGenericAttribute("jbpm", item.getText(jbpmColumnIndex()));
+ element.addGenericAttribute("bpm", item.getText(jbpmColumnIndex()));
element.addGenericAttribute("esb", item.getText(esbColumnIndex()));
item.setData(element);
table.setSelection(item);
<at> <at> -231,7 +231,7 <at> <at>
item.setText(selectedColumn, text.getText());
GenericElement element = (GenericElement)item.getData();
if (element == null) return;
- element.addGenericAttribute("jbpm", item.getText(jbpmColumnIndex()));
+ element.addGenericAttribute("bpm", item.getText(jbpmColumnIndex()));
element.addGenericAttribute("esb", item.getText(esbColumnIndex()));
}
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone