Author: koen.aers(a)jboss.com
Date: 2009-06-03 21:55:43 -0400 (Wed, 03 Jun 2009)
New Revision: 15695
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerDueDateSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerRepeatSection.java
Removed:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerTimerSection.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/EventListenerContainer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java
Log:
fix timer problem for event listeners
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-06-03 22:07:45 UTC (rev
15694)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-06-04 01:55:43 UTC (rev
15695)
@@ -473,7 +473,7 @@
</propertySection>
<propertySection
afterSection="org.jboss.tools.jpdl4.eventListenerContainer.eventType"
-
class="org.jboss.tools.flow.jpdl4.properties.EventListenerContainerTimerSection"
+
class="org.jboss.tools.flow.jpdl4.properties.EventListenerContainerDueDateSection"
id="org.jboss.tools.jpdl4.eventListenerContainer.timer"
tab="org.jboss.tools.jpdl4.general">
<input
type="org.jboss.tools.flow.jpdl4.model.EventListenerContainer"/>
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-06-03
22:07:45 UTC (rev 15694)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-06-04
01:55:43 UTC (rev 15695)
@@ -446,18 +446,14 @@
Wrapper result = null;
if (!(parent.getElement() instanceof EventListenerContainer)) return result;
if (node instanceof Element) {
- if ("timer".equals(node.getNodeName())) {
- String duedate = ((Element)node).getAttribute("duedate");
- if (duedate != null && !("".equals(duedate))) {
- ((EventListenerContainer)parent.getElement()).setTimer(duedate);
+ result = createWrapper((Element)node);
+ if (result != null) {
+ if (result.getElement() instanceof EventListener) {
+ parent.addChild(EventListenerContainer.LISTENERS, result);
+ } else if (result.getElement() instanceof Timer) {
+ parent.setPropertyValue(EventListenerContainer.DUE_DATE,
result.getPropertyValue(Timer.DUE_DATE));
+ parent.setPropertyValue(EventListenerContainer.REPEAT,
result.getPropertyValue(Timer.REPEAT));
}
- } else {
- result = createWrapper((Element)node);
- if (result != null) {
- if (result.getElement() instanceof EventListener) {
- parent.addChild(EventListenerContainer.LISTENERS, result);
- }
- }
}
}
return result;
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-06-03
22:07:45 UTC (rev 15694)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-06-04
01:55:43 UTC (rev 15695)
@@ -654,11 +654,19 @@
}
public void appendBody(StringBuffer buffer, Wrapper wrapper, int level) {
EventListenerContainer eventListenerContainer =
(EventListenerContainer)wrapper.getElement();
- String timer = eventListenerContainer.getTimer();
- if (timer != null && !"".equals(timer)) {
+ String dueDate = eventListenerContainer.getDueDate();
+ String repeat = eventListenerContainer.getRepeat();
+ if ((dueDate != null && !"".equals(dueDate)) || (repeat != null
&& !"".equals(repeat))) {
buffer.append("\n");
- appendPadding(buffer, level + 1);
- buffer.append("<timer duedate=\"" + timer +
"\"/>");
+ appendPadding(buffer, level);
+ buffer.append("<timer ");
+ if (dueDate != null && !"".equals(dueDate)) {
+ buffer.append("duedate=\"" + dueDate + "\"");
+ }
+ if (repeat != null && !"".equals(repeat)) {
+ buffer.append("repeat=\"" + repeat + "\"");
+ }
+ buffer.append("/>");
}
List<Element> eventListeners =
wrapper.getChildren(EventListenerContainer.LISTENERS);
if (eventListeners != null) {
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java 2009-06-03
22:07:45 UTC (rev 15694)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java 2009-06-04
01:55:43 UTC (rev 15695)
@@ -13,10 +13,12 @@
public static final String LISTENERS =
"org.jboss.tools.flow.jpdl4.model.eventListenerContainer.listeners";
public static final String EVENT_TYPE =
"org.jboss.tools.flow.jpdl4.model.eventListenerContainer.eventType";
- public static final String TIMER =
"org.jboss.tools.flow.jpdl4.model.eventListenerContainer.timer";
+ public static final String DUE_DATE =
"org.jboss.tools.flow.jpdl4.model.eventListenerContainer.duedate";
+ public static final String REPEAT =
"org.jboss.tools.flow.jpdl4.model.eventListenerContainer.repeat";
private String eventType;
- private String timer;
+ private String dueDate;
+ private String repeat;
private List<EventListener> listeners = new ArrayList<EventListener>();
public EventListenerContainer() {
@@ -31,14 +33,22 @@
this.eventType = eventType;
}
- public String getTimer() {
- return timer;
+ public String getDueDate() {
+ return dueDate;
}
- public void setTimer(String timer) {
- this.timer = timer;
+ public void setDueDate(String dueDate) {
+ this.dueDate = dueDate;
}
+ public String getRepeat() {
+ return repeat;
+ }
+
+ public void setRepeat(String repeat) {
+ this.repeat = repeat;
+ }
+
public List<EventListener> getListeners() {
return listeners;
}
@@ -70,8 +80,10 @@
return listeners;
} else if (EVENT_TYPE.equals(id)) {
return getEventType();
- } else if (TIMER.equals(id)) {
- return getTimer();
+ } else if (DUE_DATE.equals(id)) {
+ return getDueDate();
+ } else if (REPEAT.equals(id)) {
+ return getRepeat();
}
return null;
}
@@ -81,8 +93,10 @@
return true;
} else if (EVENT_TYPE.equals(id)) {
return getEventType() != null;
- } else if (TIMER.equals(id)) {
- return getTimer() != null;
+ } else if (DUE_DATE.equals(id)) {
+ return getDueDate() != null;
+ } else if (REPEAT.equals(id)) {
+ return getRepeat() != null;
}
return false;
}
@@ -93,8 +107,10 @@
public void setPropertyValue(Object id, Object value) {
if (EVENT_TYPE.equals(id)) {
setEventType((String)value);
- } else if (TIMER.equals(id)) {
- setTimer((String)value);
+ } else if (DUE_DATE.equals(id)) {
+ setDueDate((String)value);
+ } else if (REPEAT.equals(id)) {
+ setRepeat((String)value);
}
}
Copied:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerDueDateSection.java
(from rev 15586,
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerTimerSection.java)
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerDueDateSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerDueDateSection.java 2009-06-04
01:55:43 UTC (rev 15695)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
+
+public class EventListenerContainerDueDateSection extends TextFieldPropertySection {
+
+ public EventListenerContainerDueDateSection() {
+ super(EventListenerContainer.DUE_DATE, "Due Date");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerDueDateSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerRepeatSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerRepeatSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerRepeatSection.java 2009-06-04
01:55:43 UTC (rev 15695)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
+
+public class EventListenerContainerRepeatSection extends TextFieldPropertySection {
+
+ public EventListenerContainerRepeatSection() {
+ super(EventListenerContainer.REPEAT, "Repeat");
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerRepeatSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerTimerSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerTimerSection.java 2009-06-03
22:07:45 UTC (rev 15694)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/EventListenerContainerTimerSection.java 2009-06-04
01:55:43 UTC (rev 15695)
@@ -1,11 +0,0 @@
-package org.jboss.tools.flow.jpdl4.properties;
-
-import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
-
-public class EventListenerContainerTimerSection extends TextFieldPropertySection {
-
- public EventListenerContainerTimerSection() {
- super(EventListenerContainer.TIMER, "Timer");
- }
-
-}
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-06-03
22:07:45 UTC (rev 15694)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java 2009-06-04
01:55:43 UTC (rev 15695)
@@ -50,7 +50,7 @@
private void createDueDateLabel(Composite parent) {
- dueDateLabel = getWidgetFactory().createCLabel(parent, "Due Date (e.g. '3
business hours') ");
+ dueDateLabel = getWidgetFactory().createCLabel(parent, "Due Date");
FormData data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(0, 5);
@@ -67,7 +67,7 @@
}
private void createRepeatLabel(Composite parent) {
- repeatLabel = getWidgetFactory().createCLabel(parent, "Repeat (e.g. '30
minutes')");
+ repeatLabel = getWidgetFactory().createCLabel(parent, "Repeat");
FormData data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(dueDateText, 5);
@@ -84,7 +84,7 @@
}
private void createDueDateTimeLabel(Composite parent) {
- dueDateTimeLabel = getWidgetFactory().createCLabel(parent, "Due Date-time (e.g.
'HH:mm dd/MM/yyyy')");
+ dueDateTimeLabel = getWidgetFactory().createCLabel(parent, "Due Date-time");
FormData data = new FormData();
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(repeatText, 5);