Author: koen.aers(a)jboss.com
Date: 2009-04-28 17:42:43 -0400 (Tue, 28 Apr 2009)
New Revision: 14952
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Assignment.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java
Log:
configuration for timers
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Assignment.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Assignment.java 2009-04-28
19:50:22 UTC (rev 14951)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Assignment.java 2009-04-28
21:42:43 UTC (rev 14952)
@@ -4,9 +4,9 @@
public final String ASSIGNMENT_LABEL = "Assignment";
- public final String ASSIGNMENT_TYPE =
"org.jboss.tools.flow.jpdl4.model.task.assignment.type";
- public final String ASSIGNMENT_EXPRESSION =
"org.jboss.tools.flow.jpdl4.model.task.assignment.expression";
- public final String ASSIGNMENT_EXPRESSION_LANGUAGE =
"org.jboss.tools.flow.jpdl4.model.task.assignment.expression.language";
+ public final String ASSIGNMENT_TYPE =
"org.jboss.tools.flow.jpdl4.model.assignment.type";
+ public final String ASSIGNMENT_EXPRESSION =
"org.jboss.tools.flow.jpdl4.model.assignment.expression";
+ public final String ASSIGNMENT_EXPRESSION_LANGUAGE =
"org.jboss.tools.flow.jpdl4.model.assignment.expression.language";
public final String ASSIGNEE = "assignee";
public final String CANDIDATE_GROUPS = "candidate-groups";
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java 2009-04-28
19:50:22 UTC (rev 14951)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java 2009-04-28
21:42:43 UTC (rev 14952)
@@ -1,7 +1,119 @@
package org.jboss.tools.flow.jpdl4.model;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
import org.jboss.tools.flow.common.model.DefaultElement;
+import org.jboss.tools.flow.common.properties.IPropertyId;
public class Timer extends DefaultElement {
+
+ public static final String DUE_DATE =
"org.jboss.tools.flow.jpdl4.model.timer.dueDate";
+ public static final String REPEAT =
"org.jboss.tools.flow.jpdl4.model.timer.repeat";
+ public static final String DUE_DATETIME =
"org.jboss.tools.flow.jpdl4.model.timer.dueDateTime";
+
+ private String dueDate;
+ private String repeat;
+ private String dueDateTime;
+
+ public Timer() {
+ setMetaData("propertySource", new PropertySource());
+ }
+
+ public String getDueDate() {
+ return dueDate;
+ }
+ public void setDueDate(String dueDate) {
+ this.dueDate = dueDate;
+ }
+
+ public String getRepeat() {
+ return repeat;
+ }
+
+ public void setRepeat(String repeat) {
+ this.repeat = repeat;
+ }
+
+ public String getDueDateTime() {
+ return dueDateTime;
+ }
+
+ public void setDueDateTime(String dueDateTime) {
+ this.dueDateTime = dueDateTime;
+ }
+
+
+
+ private class PropertySource implements IPropertySource, IPropertyId {
+
+ private IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(DUE_DATE, "Due Date") {
+ public String getCategory() {
+ return "General";
+ }
+ },
+ new TextPropertyDescriptor(REPEAT, "Repeat") {
+ public String getCategory() {
+ return "General";
+ }
+ },
+ new TextPropertyDescriptor(DUE_DATETIME, "Due Date-time") {
+ public String getCategory() {
+ return "General";
+ }
+ }
+ };
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (DUE_DATE.equals(id)) {
+ return getDueDate() != null ? getDueDate() : "";
+ } else if (REPEAT.equals(id)) {
+ return getRepeat() != null ? getRepeat() : "";
+ } else if (DUE_DATETIME.equals(id)) {
+ return getDueDateTime() != null ? getDueDateTime() : "";
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (DUE_DATE.equals(id)) {
+ return getDueDate() != null;
+ } else if (REPEAT.equals(id)) {
+ return getRepeat() != null;
+ } else if (DUE_DATETIME.equals(id)) {
+ return getDueDateTime() != null;
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (DUE_DATE.equals(id)) {
+ if (value instanceof String) {
+ setDueDate((String)value);
+ }
+ } else if (REPEAT.equals(id)) {
+ if (value instanceof String) {
+ setRepeat((String)value);
+ }
+ } else if (DUE_DATETIME.equals(id)) {
+ if (value instanceof String) {
+ setDueDateTime((String)value);
+ }
+ }
+ }
+
+ }
}
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-04-28
19:50:22 UTC (rev 14951)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java 2009-04-28
21:42:43 UTC (rev 14952)
@@ -11,6 +11,7 @@
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.Timer;
public class TimerSection extends JpdlPropertySection {
@@ -27,11 +28,11 @@
CommandStack commandStack = getCommandStack();
if (input == null || commandStack == null) return;
if (dueDateText == event.getSource()) {
- changeProperty("dueDate", getValueNullsAllowed(dueDateText.getText()));
+ changeProperty(Timer.DUE_DATE, getValueNullsAllowed(dueDateText.getText()));
} else if (repeatText == event.getSource()) {
- changeProperty("repeat", getValueNullsAllowed(repeatText.getText()));
+ changeProperty(Timer.REPEAT, getValueNullsAllowed(repeatText.getText()));
} else if (dueDateTimeText == event.getSource()) {
- changeProperty("dueDateTime",
getValueNullsAllowed(dueDateTimeText.getText()));
+ changeProperty(Timer.DUE_DATETIME, getValueNullsAllowed(dueDateTimeText.getText()));
}
}
};
@@ -115,9 +116,9 @@
protected void updateValues() {
IPropertySource input = getInput();
if (input != null) {
- dueDateText.setText(getValueNotNull((String)input.getPropertyValue("dueDate")));
- repeatText.setText(getValueNotNull((String)input.getPropertyValue("repeat")));
- dueDateTimeText.setText(getValueNotNull((String)input.getPropertyValue("dueDateTime")));
+ dueDateText.setText(getValueNotNull((String)input.getPropertyValue(Timer.DUE_DATE)));
+ repeatText.setText(getValueNotNull((String)input.getPropertyValue(Timer.REPEAT)));
+ dueDateTimeText.setText(getValueNotNull((String)input.getPropertyValue(Timer.DUE_DATETIME)));
} else {
dueDateText.setText("");
repeatText.setText("");