Author: koen.aers(a)jboss.com
Date: 2009-05-19 18:45:42 -0400 (Tue, 19 May 2009)
New Revision: 15356
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessDescriptionSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessKeySection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessVersionSection.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/Process.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JpdlPropertySection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/NameSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SubprocessSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TextFieldPropertySection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java
Log:
support process attributes: key, version, description (GPD-324)
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-19 20:03:51 UTC (rev
15355)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-19 22:45:42 UTC (rev
15356)
@@ -366,7 +366,28 @@
tab="org.jboss.tools.jpdl4.assignment">
<input type="org.jboss.tools.flow.jpdl4.model.HumanTask"/>
<input type="org.jboss.tools.flow.jpdl4.model.Swimlane"/>
- </propertySection>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.name"
+
class="org.jboss.tools.flow.jpdl4.properties.ProcessKeySection"
+ id="org.jboss.tools.jpdl4.processKey"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.Process"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.processKey"
+
class="org.jboss.tools.flow.jpdl4.properties.ProcessVersionSection"
+ id="org.jboss.tools.jpdl4.processVersion"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.Process"/>
+ </propertySection>
+ <propertySection
+ afterSection="org.jboss.tools.jpdl4.processVersion"
+
class="org.jboss.tools.flow.jpdl4.properties.ProcessDescriptionSection"
+ id="org.jboss.tools.jpdl4.processDescription"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.Process"/>
+ </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-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -9,7 +9,6 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
-import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.properties.IPropertyId;
import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
@@ -23,6 +22,7 @@
import org.jboss.tools.flow.jpdl4.model.EventListener;
import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
import org.jboss.tools.flow.jpdl4.model.HumanTask;
+import org.jboss.tools.flow.jpdl4.model.Process;
import org.jboss.tools.flow.jpdl4.model.SubprocessTask;
import org.jboss.tools.flow.jpdl4.model.Swimlane;
import org.jboss.tools.flow.jpdl4.model.Timer;
@@ -69,9 +69,12 @@
class ProcessAttributeHandler extends DefaultAttributeDeserializer {
public void deserializeAttributes(Wrapper wrapper, Element element) {
super.deserializeAttributes(wrapper, element);
- if (!(wrapper instanceof FlowWrapper)) return;
- FlowWrapper flowWrapper = (FlowWrapper)wrapper;
- ((Flow)flowWrapper.getElement()).setName(element.getAttribute("name"));
+ if (!(wrapper.getElement() instanceof Process)) return;
+ Process process = (Process)wrapper.getElement();
+ process.setName(element.getAttribute("name"));
+ process.setKey(element.getAttribute("key"));
+ process.setVersion(element.getAttribute("version"));
+ process.setDescription(element.getAttribute("description"));
}
}
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-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -456,19 +456,28 @@
result.add("xmlns");
result.add("name");
result.add("initial");
+ result.add("key");
+ result.add("version");
+ result.add("description");
return result;
}
protected void appendAttributeToSave(String attributeName, StringBuffer buffer,
Wrapper wrapper) {
if (!(wrapper instanceof FlowWrapper)) return;
Element element = wrapper.getElement();
if (element == null || !(element instanceof Process)) return;
- if ("xmlns".equals(attributeName)) {
- buffer.append("
xmlns=\"http://jbpm.org/4/jpdl\"");
- } else if ("name".equals(attributeName)) {
+ if ("name".equals(attributeName)) {
appendName(buffer, (Process)element);
+ } else if ("key".equals(attributeName)) {
+ appendKey(buffer, (Process)element);
+ } else if ("version".equals(attributeName)) {
+ appendVersion(buffer, (Process)element);
+ } else if ("description".equals(attributeName)) {
+ appendDescription(buffer, (Process)element);
} else if ("initial".equals(attributeName)) {
appendInitial(buffer, (Process)element);
- }
+ } else if ("xmlns".equals(attributeName)) {
+ buffer.append("
xmlns=\"http://jbpm.org/4/jpdl\"");
+ }
}
protected void appendName(StringBuffer buffer, Process process) {
String value = process.getName();
@@ -481,6 +490,24 @@
if (value == null || "".equals(value)) return;
buffer.append(" initial=\"" + value + "\"");
}
+ protected void appendKey(StringBuffer buffer, Process process) {
+ if (process.getKey() == null) return;
+ String value = process.getKey();
+ if (value == null || "".equals(value)) return;
+ buffer.append(" key=\"" + value + "\"");
+ }
+ protected void appendVersion(StringBuffer buffer, Process process) {
+ if (process.getVersion() == null) return;
+ String value = process.getVersion();
+ if (value == null || "".equals(value)) return;
+ buffer.append(" version=\"" + value + "\"");
+ }
+ protected void appendDescription(StringBuffer buffer, Process process) {
+ if (process.getDescription() == null) return;
+ String value = process.getDescription();
+ if (value == null || "".equals(value)) return;
+ buffer.append(" description=\"" + value + "\"");
+ }
}
private void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -12,7 +12,14 @@
public class Process extends DefaultFlow {
+ public static final String KEY = "key";
+ public static final String VERSION = "version";
+ public static final String DESCRIPTION = "description";
+
private Node initial = null;
+ private String key;
+ private String version;
+ private String description;
private List<Swimlane> swimlanes = new ArrayList<Swimlane>();
private List<Timer> timers = new ArrayList<Timer>();
@@ -40,6 +47,30 @@
initial = node;
}
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
public void removeNode(Node node) {
Jpdl4Helper.mergeLeadingNodes(node);
super.removeNode(node);
@@ -62,6 +93,12 @@
return timers;
} else if ("eventListener".equals(id)) {
return eventlisteners;
+ } else if (KEY.equals(id)) {
+ return getKey();
+ } else if (VERSION.equals(id)) {
+ return getVersion();
+ } else if (DESCRIPTION.equals(id)) {
+ return getDescription();
}
return null;
}
@@ -73,6 +110,12 @@
return true;
} else if ("eventListener".equals(id)) {
return true;
+ } else if (KEY.equals(id)) {
+ return getKey() != null;
+ } else if (VERSION.equals(id)) {
+ return getVersion() != null;
+ } else if (DESCRIPTION.equals(id)) {
+ return getDescription() != null;
}
return false;
}
@@ -81,6 +124,13 @@
}
public void setPropertyValue(Object id, Object value) {
+ if (KEY.equals(id)) {
+ setKey((String)value);
+ } else if (VERSION.equals(id)) {
+ setVersion((String)value);
+ } else if (DESCRIPTION.equals(id)) {
+ setDescription((String)value);
+ }
}
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -60,7 +60,7 @@
typeCombo.setItems(HumanTask.ASSIGNMENT_TYPES);
FormData data = new FormData();
data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(0, 85);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
typeCombo.setLayoutData(data);
}
@@ -77,7 +77,7 @@
FormData data = new FormData();
data.top = new FormAttachment(typeCombo, 2);
data.right = new FormAttachment(100, 0);
- data.left = new FormAttachment(0, 80);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
expressionText.setLayoutData(data);
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ClassNameSection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -1,69 +1,11 @@
package org.jboss.tools.flow.jpdl4.properties;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.jboss.tools.flow.jpdl4.model.EventListener;
-public class ClassNameSection extends JpdlPropertySection {
-
- private Text classNameText;
- private CLabel classNameLabel;
+public class ClassNameSection extends TextFieldPropertySection {
- private ModifyListener textModifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent arg0) {
- changeProperty(EventListener.CLASS_NAME,
getValueNullsAllowed(classNameText.getText()));
- }
- };
-
- public void createControls(Composite parent,
- TabbedPropertySheetPage aTabbedPropertySheetPage) {
- super.createControls(parent, aTabbedPropertySheetPage);
- Composite composite = getFlatFormComposite();
- createEventTypeLabel(composite);
- createEventTypeText(composite);
+ public ClassNameSection() {
+ super(EventListener.CLASS_NAME, "Class");
}
-
-
- private void createEventTypeLabel(Composite parent) {
- classNameLabel = getWidgetFactory().createCLabel(parent, "Class");
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 5);
- classNameLabel.setLayoutData(data);
- }
-
- private void createEventTypeText(Composite parent) {
- classNameText = getWidgetFactory().createText(parent, "");
- FormData data = new FormData();
- data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(classNameLabel, 0, SWT.RIGHT);
- data.right = new FormAttachment(100, 0);
- classNameText.setLayoutData(data);
- }
- protected void hookListeners() {
- classNameText.addModifyListener(textModifyListener);
- }
-
- protected void unhookListeners() {
- classNameText.removeModifyListener(textModifyListener);
- }
-
- protected void updateValues() {
- IPropertySource input = getInput();
- if (input != null) {
- classNameText.setText(getValueNotNull((String)input.getPropertyValue(EventListener.CLASS_NAME)));
- } else {
- classNameText.setText("");
- }
- }
-
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventTypeSection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -1,69 +1,11 @@
package org.jboss.tools.flow.jpdl4.properties;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
-public class EventTypeSection extends JpdlPropertySection {
-
- private Text eventTypeText;
- private CLabel eventTypeLabel;
+public class EventTypeSection extends TextFieldPropertySection {
- private ModifyListener textModifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent arg0) {
- changeProperty(EventListenerContainer.EVENT_TYPE,
getValueNullsAllowed(eventTypeText.getText()));
- }
- };
-
- public void createControls(Composite parent,
- TabbedPropertySheetPage aTabbedPropertySheetPage) {
- super.createControls(parent, aTabbedPropertySheetPage);
- Composite composite = getFlatFormComposite();
- createEventTypeLabel(composite);
- createEventTypeText(composite);
+ public EventTypeSection() {
+ super(EventListenerContainer.EVENT_TYPE, "Event Type");
}
-
-
- private void createEventTypeLabel(Composite parent) {
- eventTypeLabel = getWidgetFactory().createCLabel(parent, "Event Type");
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 5);
- eventTypeLabel.setLayoutData(data);
- }
-
- private void createEventTypeText(Composite parent) {
- eventTypeText = getWidgetFactory().createText(parent, "");
- FormData data = new FormData();
- data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(eventTypeLabel, 0, SWT.RIGHT);
- data.right = new FormAttachment(100, 0);
- eventTypeText.setLayoutData(data);
- }
- protected void hookListeners() {
- eventTypeText.addModifyListener(textModifyListener);
- }
-
- protected void unhookListeners() {
- eventTypeText.removeModifyListener(textModifyListener);
- }
-
- protected void updateValues() {
- IPropertySource input = getInput();
- if (input != null) {
- eventTypeText.setText(getValueNotNull((String)input.getPropertyValue(EventListenerContainer.EVENT_TYPE)));
- } else {
- eventTypeText.setText("");
- }
- }
-
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JpdlPropertySection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JpdlPropertySection.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JpdlPropertySection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -12,6 +12,8 @@
import org.jboss.tools.flow.jpdl4.command.ChangePropertyCommand;
public abstract class JpdlPropertySection extends AbstractPropertySection {
+
+ public static final int SECOND_COLUMN_LEFT_LIMIT = 30;
private CommandStack commandStack;
private Composite flatFormComposite;
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/NameSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/NameSection.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/NameSection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -3,7 +3,6 @@
import java.util.EventObject;
import org.eclipse.gef.commands.CommandStackListener;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -68,7 +67,7 @@
nameText = getWidgetFactory().createText(parent, "");
FormData data = new FormData();
data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(nameLabel, 0, SWT.RIGHT);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
data.right = new FormAttachment(100, 0);
nameText.setLayoutData(data);
}
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessDescriptionSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessDescriptionSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessDescriptionSection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.Process;
+
+public class ProcessDescriptionSection extends TextFieldPropertySection {
+
+ public ProcessDescriptionSection() {
+ super(Process.DESCRIPTION, "Description");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessDescriptionSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessKeySection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessKeySection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessKeySection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.Process;
+
+public class ProcessKeySection extends TextFieldPropertySection {
+
+ public ProcessKeySection() {
+ super(Process.KEY, "Key");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessKeySection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessVersionSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessVersionSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessVersionSection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.Process;
+
+public class ProcessVersionSection extends TextFieldPropertySection {
+
+ public ProcessVersionSection() {
+ super(Process.VERSION, "Version");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/ProcessVersionSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SubprocessSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SubprocessSection.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/SubprocessSection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -1,7 +1,6 @@
package org.jboss.tools.flow.jpdl4.properties;
import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -62,7 +61,7 @@
idText = getWidgetFactory().createText(parent, "");
FormData data = new FormData();
data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(idLabel, 0, SWT.RIGHT);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
data.right = new FormAttachment(100, 0);
idText.setLayoutData(data);
}
@@ -79,7 +78,7 @@
keyText = getWidgetFactory().createText(parent, "");
FormData data = new FormData();
data.top = new FormAttachment(idText, 0);
- data.left = new FormAttachment(idLabel, 0, SWT.RIGHT);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
data.right = new FormAttachment(100, 0);
keyText.setLayoutData(data);
}
@@ -96,7 +95,7 @@
outcomeText = getWidgetFactory().createText(parent, "");
FormData data = new FormData();
data.top = new FormAttachment(keyText, 0);
- data.left = new FormAttachment(idLabel, 0, SWT.RIGHT);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
data.right = new FormAttachment(100, 0);
outcomeText.setLayoutData(data);
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TextFieldPropertySection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TextFieldPropertySection.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TextFieldPropertySection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -1,6 +1,5 @@
package org.jboss.tools.flow.jpdl4.properties;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -10,16 +9,23 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.jboss.tools.flow.jpdl4.model.EventListener;
public class TextFieldPropertySection extends JpdlPropertySection {
- private Text classNameText;
- private CLabel classNameLabel;
+ private Text propertyText;
+ private CLabel propertyLabel;
+ private String name;
+ private String label;
+
+ public TextFieldPropertySection(String name, String label) {
+ this.name = name;
+ this.label = label;
+ }
+
private ModifyListener textModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent arg0) {
- changeProperty(EventListener.CLASS_NAME,
getValueNullsAllowed(classNameText.getText()));
+ changeProperty(name, getValueNullsAllowed(propertyText.getText()));
}
};
@@ -27,42 +33,42 @@
TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
Composite composite = getFlatFormComposite();
- createEventTypeLabel(composite);
- createEventTypeText(composite);
+ createPropertyLabel(composite);
+ createPropertyText(composite);
}
- private void createEventTypeLabel(Composite parent) {
- classNameLabel = getWidgetFactory().createCLabel(parent, "Class");
+ private void createPropertyLabel(Composite parent) {
+ propertyLabel = getWidgetFactory().createCLabel(parent, label);
FormData data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(0, 5);
- classNameLabel.setLayoutData(data);
+ propertyLabel.setLayoutData(data);
}
- private void createEventTypeText(Composite parent) {
- classNameText = getWidgetFactory().createText(parent, "");
+ private void createPropertyText(Composite parent) {
+ propertyText = getWidgetFactory().createText(parent, "");
FormData data = new FormData();
data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(classNameLabel, 0, SWT.RIGHT);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
data.right = new FormAttachment(100, 0);
- classNameText.setLayoutData(data);
+ propertyText.setLayoutData(data);
}
protected void hookListeners() {
- classNameText.addModifyListener(textModifyListener);
+ propertyText.addModifyListener(textModifyListener);
}
protected void unhookListeners() {
- classNameText.removeModifyListener(textModifyListener);
+ propertyText.removeModifyListener(textModifyListener);
}
protected void updateValues() {
IPropertySource input = getInput();
if (input != null) {
- classNameText.setText(getValueNotNull((String)input.getPropertyValue(EventListener.CLASS_NAME)));
+ propertyText.setText(getValueNotNull((String)input.getPropertyValue(name)));
} else {
- classNameText.setText("");
+ propertyText.setText("");
}
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java 2009-05-19
20:03:51 UTC (rev 15355)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java 2009-05-19
22:45:42 UTC (rev 15356)
@@ -1,7 +1,6 @@
package org.jboss.tools.flow.jpdl4.properties;
import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -62,7 +61,7 @@
dueDateText = getWidgetFactory().createText(parent, "");
FormData data = new FormData();
data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(dueDateLabel, 0, SWT.RIGHT);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
data.right = new FormAttachment(100, 0);
dueDateText.setLayoutData(data);
}
@@ -79,7 +78,7 @@
repeatText = getWidgetFactory().createText(parent, "");
FormData data = new FormData();
data.top = new FormAttachment(dueDateText, 0);
- data.left = new FormAttachment(dueDateLabel, 0, SWT.RIGHT);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
data.right = new FormAttachment(100, 0);
repeatText.setLayoutData(data);
}
@@ -96,7 +95,7 @@
dueDateTimeText = getWidgetFactory().createText(parent, "");
FormData data = new FormData();
data.top = new FormAttachment(repeatText, 0);
- data.left = new FormAttachment(dueDateLabel, 0, SWT.RIGHT);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
data.right = new FormAttachment(100, 0);
dueDateTimeText.setLayoutData(data);
}