Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Brodt2014-07-14 10:51:24 -0400
committerBob Brodt2014-07-14 10:51:24 -0400
commit20be67db3b99457bd02c3de280fccdbc31f87d88 (patch)
tree90c60b476530f551ddb929e583ae20cc3d03055f
parent9c749b7c8aa9ef772faad5f6f99ef520dc83c870 (diff)
downloadorg.eclipse.bpmn2-modeler-20be67db3b99457bd02c3de280fccdbc31f87d88.tar.gz
org.eclipse.bpmn2-modeler-20be67db3b99457bd02c3de280fccdbc31f87d88.tar.xz
org.eclipse.bpmn2-modeler-20be67db3b99457bd02c3de280fccdbc31f87d88.zip
Make DataInput/Output name generation consistent
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java14
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java16
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java4
3 files changed, 21 insertions, 13 deletions
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java
index ab1eac84..2240171a 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataInputPropertiesAdapter.java
@@ -86,7 +86,14 @@ public class DataInputPropertiesAdapter extends ItemAwareElementPropertiesAdapte
}
public static DataInput createDataInput(Resource resource, List<DataInput> dataInputs) {
+ DataInput dataInput = Bpmn2ModelerFactory.create(resource,DataInput.class);
+ dataInput.setName( generateName(dataInputs) );
+ dataInputs.add(dataInput);
+ return dataInput;
+ }
+
+ public static String generateName(List<DataInput> dataInputs) {
String base = "input"; //$NON-NLS-1$
int suffix = 1;
String name = base + suffix;
@@ -102,11 +109,6 @@ public class DataInputPropertiesAdapter extends ItemAwareElementPropertiesAdapte
break;
name = base + ++suffix;
}
- DataInput dataInput = Bpmn2ModelerFactory.create(resource,DataInput.class);
- dataInput.setName(name);
- dataInputs.add(dataInput);
-
- return dataInput;
+ return name;
}
-
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java
index 46198aa2..a5dbdab7 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/adapters/properties/DataOutputPropertiesAdapter.java
@@ -16,6 +16,7 @@ package org.eclipse.bpmn2.modeler.ui.adapters.properties;
import java.util.List;
import org.eclipse.bpmn2.Bpmn2Package;
+import org.eclipse.bpmn2.DataInput;
import org.eclipse.bpmn2.DataOutput;
import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesProvider;
import org.eclipse.bpmn2.modeler.core.adapters.FeatureDescriptor;
@@ -86,7 +87,14 @@ public class DataOutputPropertiesAdapter extends ItemAwareElementPropertiesAdapt
}
public static DataOutput createDataOutput(Resource resource, List<DataOutput> dataOutputs) {
+ DataOutput dataOutput = Bpmn2ModelerFactory.create(resource,DataOutput.class);
+ dataOutput.setName( generateName(dataOutputs) );
+ dataOutputs.add(dataOutput);
+ return dataOutput;
+ }
+
+ public static String generateName(List<DataOutput> dataOutputs) {
String base = "output"; //$NON-NLS-1$
int suffix = 1;
String name = base + suffix;
@@ -102,12 +110,6 @@ public class DataOutputPropertiesAdapter extends ItemAwareElementPropertiesAdapt
break;
name = base + ++suffix;
}
-
- DataOutput dataOutput = Bpmn2ModelerFactory.create(resource,DataOutput.class);
- dataOutput.setName(name);
- dataOutputs.add(dataOutput);
-
- return dataOutput;
+ return name;
}
-
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java
index 38b37a16..6eb24934 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java
@@ -50,6 +50,8 @@ import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ComboObjectEditor;
import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor;
import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil;
+import org.eclipse.bpmn2.modeler.ui.adapters.properties.DataInputPropertiesAdapter;
+import org.eclipse.bpmn2.modeler.ui.adapters.properties.DataOutputPropertiesAdapter;
import org.eclipse.bpmn2.modeler.ui.property.editors.ServiceImplementationObjectEditor;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
@@ -503,6 +505,7 @@ public class ActivityDetailComposite extends DefaultDetailComposite {
}
else {
input = Bpmn2ModelerFactory.create(resource, DataInput.class);
+ input.setName( DataInputPropertiesAdapter.generateName(ioSpec.getDataInputs()) );
newInput = true;
}
if (operationChanged || messageChanged) {
@@ -534,6 +537,7 @@ public class ActivityDetailComposite extends DefaultDetailComposite {
}
else {
output = Bpmn2ModelerFactory.create(resource, DataOutput.class);
+ output.setName( DataOutputPropertiesAdapter.generateName(ioSpec.getDataOutputs()) );
newOutput = true;
}
if (operationChanged || messageChanged) {

Back to the top