Author: koen.aers(a)jboss.com
Date: 2009-05-28 16:08:34 -0400 (Thu, 28 May 2009)
New Revision: 15588
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskClassSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskMethodSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskVarSection.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/JavaTask.java
Log:
JavaTask attributes: class, method, var
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-28 19:39:25 UTC (rev
15587)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-28 20:08:34 UTC (rev
15588)
@@ -437,6 +437,27 @@
tab="org.jboss.tools.jpdl4.general">
<input
type="org.jboss.tools.flow.jpdl4.model.SequenceFlow"/>
</propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.name"
+
class="org.jboss.tools.flow.jpdl4.properties.JavaTaskClassSection"
+ id="org.jboss.tools.jpdl4.javaTask.class"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.JavaTask"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.javaTask.class"
+
class="org.jboss.tools.flow.jpdl4.properties.JavaTaskMethodSection"
+ id="org.jboss.tools.jpdl4.javaTask.method"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.JavaTask"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.javaTask.method"
+
class="org.jboss.tools.flow.jpdl4.properties.JavaTaskVarSection"
+ id="org.jboss.tools.jpdl4.javaTask.var"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.JavaTask"/>
+ </propertySection>
</propertySections>
</extension>
<extension
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-05-28
19:39:25 UTC (rev 15587)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-05-28
20:08:34 UTC (rev 15588)
@@ -23,6 +23,7 @@
import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
import org.jboss.tools.flow.jpdl4.model.ExclusiveGateway;
import org.jboss.tools.flow.jpdl4.model.HumanTask;
+import org.jboss.tools.flow.jpdl4.model.JavaTask;
import org.jboss.tools.flow.jpdl4.model.Process;
import org.jboss.tools.flow.jpdl4.model.SequenceFlow;
import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
@@ -101,6 +102,15 @@
}
}
+ class JavaTaskAttributeHandler extends NodeAttributeHandler {
+ public void deserializeAttributes(Wrapper wrapper, Element element) {
+ super.deserializeAttributes(wrapper, element);
+ wrapper.setPropertyValue(JavaTask.CLASS, element.getAttribute("class"));
+ wrapper.setPropertyValue(JavaTask.METHOD, element.getAttribute("method"));
+ wrapper.setPropertyValue(JavaTask.VAR, element.getAttribute("var"));
+ }
+ }
+
class TerminateEndEventAttributeHandler extends NodeAttributeHandler {
public void deserializeAttributes(Wrapper wrapper, Element element) {
super.deserializeAttributes(wrapper, element);
@@ -465,6 +475,8 @@
return new ExclusiveGatewayAttributeHandler();
} else if (element instanceof TerminateEndEvent) {
return new TerminateEndEventAttributeHandler();
+ } else if (element instanceof JavaTask) {
+ return new JavaTaskAttributeHandler();
} else {
return new NodeAttributeHandler();
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-28
19:39:25 UTC (rev 15587)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-28
20:08:34 UTC (rev 15588)
@@ -362,6 +362,26 @@
}
}
+ class JavaTaskWrapperSerializer extends ProcessNodeWrapperSerializer {
+ protected List<String> getAttributesToSave() {
+ List<String> result = super.getAttributesToSave();
+ result.add("class");
+ result.add("method");
+ result.add("var");
+ return result;
+ }
+ protected String getPropertyName(String attributeName) {
+ if ("class".equals(attributeName)) {
+ return JavaTask.CLASS;
+ } else if ("method".equals(attributeName)) {
+ return JavaTask.METHOD;
+ } else if ("var".equals(attributeName)) {
+ return JavaTask.VAR;
+ }
+ return super.getPropertyName(attributeName);
+ }
+ }
+
class HumanTaskWrapperSerializer extends ProcessNodeWrapperSerializer {
protected List<String> getAttributesToSave() {
List<String> result = super.getAttributesToSave();
@@ -637,7 +657,7 @@
} else if (element instanceof SqlTask) {
new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof JavaTask) {
- new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+ new JavaTaskWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof ScriptTask) {
new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
} else if (element instanceof MailTask) {
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/JavaTask.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/JavaTask.java 2009-05-28
19:39:25 UTC (rev 15587)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/JavaTask.java 2009-05-28
20:08:34 UTC (rev 15588)
@@ -1,10 +1,95 @@
package org.jboss.tools.flow.jpdl4.model;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+
public class JavaTask extends Task {
+ public static final String CLASS =
"org.jboss.tools.flow.jpdl4.model.javaTask.class";
+ public static final String METHOD =
"org.jboss.tools.flow.jpdl4.model.javaTask.method";
+ public static final String VAR =
"org.jboss.tools.flow.jpdl4.model.javaTask.var";
+
+ private String className;
+ private String methodName;
+ private String variableName;
+
+ public JavaTask() {
+ setMetaData("propertySource", new PropertySource());
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public void setClassName(String className) {
+ this.className = className;
+ }
+
+ public String getMethodName() {
+ return methodName;
+ }
+
+ public void setMethodName(String methodName) {
+ this.methodName = methodName;
+ }
+
+ public String getVariableName() {
+ return variableName;
+ }
+
+ public void setVariableName(String variableName) {
+ this.variableName = variableName;
+ }
+
protected boolean isPropagationExclusive() {
return true;
}
+ private class PropertySource implements IPropertySource {
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (CLASS.equals(id)) {
+ return getClassName();
+ } else if (METHOD.equals(id)) {
+ return getMethodName();
+ } else if (VAR.equals(id)) {
+ return getVariableName();
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (CLASS.equals(id)) {
+ return getClassName() != null;
+ } else if (METHOD.equals(id)) {
+ return getMethodName() != null;
+ } else if (VAR.equals(id)) {
+ return getVariableName() != null;
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (CLASS.equals(id)) {
+ setClassName((String)value);
+ } else if (METHOD.equals(id)) {
+ setMethodName((String)value);
+ } else if (VAR.equals(id)) {
+ setVariableName((String)value);
+ }
+ }
+
+ }
}
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskClassSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskClassSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskClassSection.java 2009-05-28
20:08:34 UTC (rev 15588)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.JavaTask;
+
+public class JavaTaskClassSection extends TextFieldPropertySection {
+
+ public JavaTaskClassSection() {
+ super(JavaTask.CLASS, "Class Name");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskClassSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskMethodSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskMethodSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskMethodSection.java 2009-05-28
20:08:34 UTC (rev 15588)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.JavaTask;
+
+public class JavaTaskMethodSection extends TextFieldPropertySection {
+
+ public JavaTaskMethodSection() {
+ super(JavaTask.METHOD, "Method Name");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskMethodSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskVarSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskVarSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskVarSection.java 2009-05-28
20:08:34 UTC (rev 15588)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.JavaTask;
+
+public class JavaTaskVarSection extends TextFieldPropertySection {
+
+ public JavaTaskVarSection() {
+ super(JavaTask.VAR, "Variable Name");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskVarSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain