JBoss Tools SVN: r14954 - trunk/vpe/plugins/org.jboss.tools.vpe/templates.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-04-29 03:58:47 -0400 (Wed, 29 Apr 2009)
New Revision: 14954
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/templates/empty-vpe-templates-auto.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4131 - Test commit (JIRA issue URL only)
- the space has been removed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/empty-vpe-templates-auto.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/empty-vpe-templates-auto.xml 2009-04-29 07:57:44 UTC (rev 14953)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/empty-vpe-templates-auto.xml 2009-04-29 07:58:47 UTC (rev 14954)
@@ -1,3 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<vpe:templates/>
-
\ No newline at end of file
15 years, 8 months
JBoss Tools SVN: r14953 - trunk/vpe/plugins/org.jboss.tools.vpe/templates.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-04-29 03:57:44 -0400 (Wed, 29 Apr 2009)
New Revision: 14953
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/templates/empty-vpe-templates-auto.xml
Log:
JBIDE-3819 - Test commit (JIRA issue ID only)
- a space has been added
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/empty-vpe-templates-auto.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/empty-vpe-templates-auto.xml 2009-04-28 21:42:43 UTC (rev 14952)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/empty-vpe-templates-auto.xml 2009-04-29 07:57:44 UTC (rev 14953)
@@ -1,2 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<vpe:templates/>
+
\ No newline at end of file
15 years, 8 months
JBoss Tools SVN: r14952 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4: properties and 1 other directory.
by jbosstools-commits@lists.jboss.org
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("");
15 years, 8 months
JBoss Tools SVN: r14951 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/editor and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-28 15:50:22 -0400 (Tue, 28 Apr 2009)
New Revision: 14951
Added:
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/AssignmentPropertySource.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/TimerSection.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/editpart/JpdlTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/NoDetailsTreeRootEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HumanTask.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.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/NameSection.java
Log:
assigment properties and name property for swimlanes
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-28 19:50:22 UTC (rev 14951)
@@ -281,12 +281,20 @@
<input type="org.jboss.tools.flow.jpdl4.model.SequenceFlow"/>
<input type="org.jboss.tools.flow.jpdl4.model.ProcessNode"/>
<input type="org.jboss.tools.flow.jpdl4.model.Process"/>
- </propertySection>
+ <input type="org.jboss.tools.flow.jpdl4.model.Swimlane"/>
+ </propertySection>
<propertySection
+ class="org.jboss.tools.flow.jpdl4.properties.TimerSection"
+ id="org.jboss.tools.jpdl4.timer"
+ tab="org.jboss.tools.jpdl4.general">
+ <input type="org.jboss.tools.flow.jpdl4.model.Timer"/>
+ </propertySection>
+ <propertySection
class="org.jboss.tools.flow.jpdl4.properties.AssignmentSection"
id="org.jboss.tools.jpdl4.assignment"
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>
</propertySections>
</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-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -16,6 +16,8 @@
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.Logger;
+import org.jboss.tools.flow.jpdl4.model.Assignment;
+import org.jboss.tools.flow.jpdl4.model.AssignmentPropertySource;
import org.jboss.tools.flow.jpdl4.model.HumanTask;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -67,24 +69,24 @@
String assignee = element.getAttribute(HumanTask.ASSIGNEE);
if (!"".equals(assignee)) {
wrapper.setPropertyValue(
- HumanTask.ASSIGNMENT_TYPE,
- HumanTask.getAssignmentTypesIndex(HumanTask.ASSIGNEE));
+ Assignment.ASSIGNMENT_TYPE,
+ AssignmentPropertySource.getAssignmentTypesIndex(HumanTask.ASSIGNEE));
wrapper.setPropertyValue(HumanTask.ASSIGNMENT_EXPRESSION, assignee);
return;
}
String candidateGroups = element.getAttribute(HumanTask.CANDIDATE_GROUPS);
if (!"".equals(candidateGroups)) {
wrapper.setPropertyValue(
- HumanTask.ASSIGNMENT_TYPE,
- HumanTask.getAssignmentTypesIndex(HumanTask.CANDIDATE_GROUPS));
+ Assignment.ASSIGNMENT_TYPE,
+ AssignmentPropertySource.getAssignmentTypesIndex(HumanTask.CANDIDATE_GROUPS));
wrapper.setPropertyValue(HumanTask.ASSIGNMENT_EXPRESSION, candidateGroups);
return;
}
String swimlane = element.getAttribute(HumanTask.SWIMLANE);
if (!"".equals(swimlane)) {
wrapper.setPropertyValue(
- HumanTask.ASSIGNMENT_TYPE,
- HumanTask.getAssignmentTypesIndex(HumanTask.SWIMLANE));
+ Assignment.ASSIGNMENT_TYPE,
+ AssignmentPropertySource.getAssignmentTypesIndex(HumanTask.SWIMLANE));
wrapper.setPropertyValue(HumanTask.ASSIGNMENT_EXPRESSION, swimlane);
return;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPart.java 2009-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPart.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -31,7 +31,7 @@
private void initPropertySource() {
EditPart editPart = this;
- while (editPart != null && propertySource != null) {
+ while (editPart != null && propertySource == null) {
if (editPart.getModel() != null && editPart.getModel() instanceof IAdaptable) {
propertySource = (IPropertySource)((IAdaptable)editPart.getModel()).getAdapter(IPropertySource.class);
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/NoDetailsTreeRootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/NoDetailsTreeRootEditPart.java 2009-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/NoDetailsTreeRootEditPart.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -7,4 +7,8 @@
super(null);
}
+ protected String getText() {
+ return "Details are not available.";
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -4,12 +4,10 @@
import java.util.List;
import org.eclipse.gef.EditPart;
-import org.jboss.tools.flow.common.command.DeleteChildCommand;
import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
import org.jboss.tools.flow.common.wrapper.Wrapper;
-import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
public class ProcessTreeRootEditPart extends JpdlTreeEditPart {
@@ -64,26 +62,9 @@
}
} else if (event.getChangeType() == Wrapper.REMOVE_ELEMENT) {
refreshChildren();
-// if ("eventListener".equals(event.getChangeDiscriminator())) {
-// doCleanup(event.getChangedObject());
-// }
}
}
- private void doCleanup(Object object) {
- if (!(object instanceof Wrapper)) return;
- Wrapper child = (Wrapper)object;
- if (!(child.getElement() instanceof EventListenerContainer)) return;
- EventListenerContainer eventListenerContainer = (EventListenerContainer)child.getElement();
- if (eventListenerContainer.getListeners().isEmpty()) {
- DeleteChildCommand deleteChildCommand = new DeleteChildCommand();
- deleteChildCommand.setChild(child);
- deleteChildCommand.setParent((Wrapper)getModel());
- deleteChildCommand.setType("eventListener");
- getViewer().getEditDomain().getCommandStack().execute(deleteChildCommand);
- }
- }
-
public void activate() {
super.activate();
((FlowWrapper)getModel()).addListener(this);
Added: 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 (rev 0)
+++ 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)
@@ -0,0 +1,18 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+public interface Assignment {
+
+ 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 ASSIGNEE = "assignee";
+ public final String CANDIDATE_GROUPS = "candidate-groups";
+ public final String SWIMLANE = "swimlane";
+ public final String NONE = "none";
+
+ public final String[] ASSIGNMENT_TYPES = { ASSIGNEE, CANDIDATE_GROUPS, SWIMLANE, NONE };
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Assignment.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/AssignmentPropertySource.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/AssignmentPropertySource.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/AssignmentPropertySource.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -0,0 +1,98 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+public class AssignmentPropertySource implements IPropertySource, Assignment {
+
+ private String assignmentType = NONE;
+ private String assignmentExpression = "";
+ private String assignmentExpressionLanguage = "";
+
+ public static Integer getAssignmentTypesIndex(String assignmentType) {
+ Integer result = 0;
+ for (String type : ASSIGNMENT_TYPES) {
+ if (type.equals(assignmentType)) {
+ break;
+ }
+ result++;
+ }
+ return result;
+ }
+
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ private void initializePropertyDescriptors() {
+ PropertyDescriptor assignmentTypeDescriptor =
+ new ComboBoxPropertyDescriptor(ASSIGNMENT_TYPE, "Type", ASSIGNMENT_TYPES);
+ assignmentTypeDescriptor.setCategory(ASSIGNMENT_LABEL);
+ PropertyDescriptor assignmentExpressionDescriptor =
+ new TextPropertyDescriptor(ASSIGNMENT_EXPRESSION, "Expression");
+ assignmentExpressionDescriptor.setCategory(ASSIGNMENT_LABEL);
+ PropertyDescriptor assignmentExpressionLanguageDescriptor =
+ new TextPropertyDescriptor(ASSIGNMENT_EXPRESSION_LANGUAGE, "Language");
+ assignmentExpressionLanguageDescriptor.setCategory(ASSIGNMENT_LABEL);
+ propertyDescriptors = new IPropertyDescriptor[] {
+ assignmentTypeDescriptor,
+ assignmentExpressionDescriptor,
+ assignmentExpressionLanguageDescriptor
+ };
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ initializePropertyDescriptors();
+ }
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (ASSIGNMENT_TYPE.equals(id)) {
+ return getAssignmentTypesIndex(assignmentType);
+ } else if (ASSIGNMENT_EXPRESSION.equals(id)) {
+ return assignmentExpression;
+ } else if (ASSIGNMENT_EXPRESSION_LANGUAGE.equals(id)) {
+ return assignmentExpressionLanguage;
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (ASSIGNMENT_TYPE.equals(id)) {
+ return true;
+ } else if (ASSIGNMENT_EXPRESSION.equals(id)) {
+ return !"".equals(assignmentExpression);
+ } else if (ASSIGNMENT_EXPRESSION_LANGUAGE.equals(id)) {
+ return !"".equals(assignmentExpressionLanguage);
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ if (ASSIGNMENT_TYPE.equals(id)) {
+ assignmentType = NONE;
+ } else if (ASSIGNMENT_EXPRESSION.equals(id)) {
+ assignmentExpression = "";
+ } else if (ASSIGNMENT_EXPRESSION_LANGUAGE.equals(id)) {
+ assignmentExpressionLanguage = "";
+ }
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (ASSIGNMENT_TYPE.equals(id)) {
+ assignmentType = ASSIGNMENT_TYPES[(Integer)value];
+ } else if (ASSIGNMENT_EXPRESSION.equals(id)) {
+ assignmentExpression = (String)value;
+ } else if (ASSIGNMENT_EXPRESSION_LANGUAGE.equals(id)) {
+ assignmentExpressionLanguage = (String)value;
+ }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/AssignmentPropertySource.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HumanTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HumanTask.java 2009-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HumanTask.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -1,123 +1,9 @@
package org.jboss.tools.flow.jpdl4.model;
-import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-
-public class HumanTask extends Task {
+public class HumanTask extends Task implements Assignment {
- private static String ASSIGNMENT_LABEL = "Assignment";
-
- public static final String ASSIGNMENT_TYPE = "org.jboss.tools.flow.jpdl4.model.task.assignment.type";
- public static final String ASSIGNMENT_EXPRESSION = "org.jboss.tools.flow.jpdl4.model.task.assignment.expression";
- public static final String ASSIGNMENT_EXPRESSION_LANGUAGE = "org.jboss.tools.flow.jpdl4.model.task.assignment.expression.language";
-
- public static final String ASSIGNEE = "assignee";
- public static final String CANDIDATE_GROUPS = "candidate-groups";
- public static final String SWIMLANE = "swimlane";
- public static final String NONE = "none";
-
- public static final String[] ASSIGNMENT_TYPES = {
- ASSIGNEE, CANDIDATE_GROUPS, SWIMLANE, NONE
- };
-
- public static Integer getAssignmentTypesIndex(String assignmentType) {
- Integer result = 0;
- for (String type : ASSIGNMENT_TYPES) {
- if (type.equals(assignmentType)) {
- break;
- }
- result++;
- }
- return result;
- }
-
- private String assignmentType = NONE;
- private String assignmentExpression = "";
- private String assignmentExpressionLanguage = "";
-
public HumanTask() {
- setMetaData("propertySource", new PropertySource());
+ setMetaData("propertySource", new AssignmentPropertySource());
}
- private class PropertySource implements IPropertySource {
-
- private IPropertyDescriptor[] propertyDescriptors;
-
- private void initializePropertyDescriptors() {
- PropertyDescriptor assignmentTypeDescriptor =
- new ComboBoxPropertyDescriptor(ASSIGNMENT_TYPE, "Type", ASSIGNMENT_TYPES);
- assignmentTypeDescriptor.setCategory(ASSIGNMENT_LABEL);
- PropertyDescriptor assignmentExpressionDescriptor =
- new TextPropertyDescriptor(ASSIGNMENT_EXPRESSION, "Expression");
- assignmentExpressionDescriptor.setCategory(ASSIGNMENT_LABEL);
- PropertyDescriptor assignmentExpressionLanguageDescriptor =
- new TextPropertyDescriptor(ASSIGNMENT_EXPRESSION_LANGUAGE, "Language");
- assignmentExpressionLanguageDescriptor.setCategory(ASSIGNMENT_LABEL);
- propertyDescriptors = new IPropertyDescriptor[] {
- assignmentTypeDescriptor,
- assignmentExpressionDescriptor,
- assignmentExpressionLanguageDescriptor
- };
- }
-
- public Object getEditableValue() {
- return null;
- }
-
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (propertyDescriptors == null) {
- initializePropertyDescriptors();
- }
- return propertyDescriptors;
- }
-
- public Object getPropertyValue(Object id) {
- if (ASSIGNMENT_TYPE.equals(id)) {
- return getAssignmentTypesIndex(assignmentType);
- } else if (ASSIGNMENT_EXPRESSION.equals(id)) {
- return assignmentExpression;
- } else if (ASSIGNMENT_EXPRESSION_LANGUAGE.equals(id)) {
- return assignmentExpressionLanguage;
- }
- return null;
- }
-
- public boolean isPropertySet(Object id) {
- if (ASSIGNMENT_TYPE.equals(id)) {
- return true;
- } else if (ASSIGNMENT_EXPRESSION.equals(id)) {
- return !"".equals(assignmentExpression);
- } else if (ASSIGNMENT_EXPRESSION_LANGUAGE.equals(id)) {
- return !"".equals(assignmentExpressionLanguage);
- }
- return false;
- }
-
- public void resetPropertyValue(Object id) {
- if (ASSIGNMENT_TYPE.equals(id)) {
- assignmentType = NONE;
- } else if (ASSIGNMENT_EXPRESSION.equals(id)) {
- assignmentExpression = "";
- } else if (ASSIGNMENT_EXPRESSION_LANGUAGE.equals(id)) {
- assignmentExpressionLanguage = "";
- }
- }
-
- public void setPropertyValue(Object id, Object value) {
- if (ASSIGNMENT_TYPE.equals(id)) {
- assignmentType = ASSIGNMENT_TYPES[(Integer)value];
- } else if (ASSIGNMENT_EXPRESSION.equals(id)) {
- assignmentExpression = (String)value;
- } else if (ASSIGNMENT_EXPRESSION_LANGUAGE.equals(id)) {
- assignmentExpressionLanguage = (String)value;
- }
- }
-
- }
-
-
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java 2009-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -1,8 +1,82 @@
package org.jboss.tools.flow.jpdl4.model;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+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 Swimlane extends DefaultElement {
+
+ private String name;
+ public Swimlane() {
+ setMetaData("propertySource", new PropertySource());
+ }
+
+ public void setName(String newName) {
+ name = newName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ private class PropertySource extends AssignmentPropertySource implements IPropertyId {
+
+ private IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {
+ public String getCategory() {
+ return "General";
+ }
+ }
+ };
+
+ public Object getEditableValue() {
+ return super.getEditableValue();
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ IPropertyDescriptor[] parentDescriptors = super.getPropertyDescriptors();
+ int size = propertyDescriptors.length + parentDescriptors.length;
+ ArrayList<IPropertyDescriptor> list = new ArrayList<IPropertyDescriptor>(size);
+ list.addAll(Arrays.asList(propertyDescriptors));
+ list.addAll(Arrays.asList(parentDescriptors));
+ return (IPropertyDescriptor[]) list.toArray();
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return getName() != null ? getName() : "";
+ } else {
+ return super.getPropertyValue(id);
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return getName() != null;
+ } else {
+ return super.isPropertySet(id);
+ }
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ setName((String)value);
+ }
+ } else {
+ super.setPropertyValue(id, 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-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/AssignmentSection.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -1,9 +1,5 @@
package org.jboss.tools.flow.jpdl4.properties;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.ModifyEvent;
@@ -15,51 +11,38 @@
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.jboss.tools.flow.jpdl4.command.ChangePropertyCommand;
import org.jboss.tools.flow.jpdl4.model.HumanTask;
-public class AssignmentSection extends AbstractPropertySection {
+public class AssignmentSection extends JpdlPropertySection {
private CCombo typeCombo;
private CLabel typeLabel;
private Text expressionText;
private CLabel expressionLabel;
-// private Text languageText;
-// private CLabel languageLabel;
-// private Composite parent;
+ private SelectionListener typeComboSelectionListener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ changeProperty(HumanTask.ASSIGNMENT_TYPE, typeCombo.getSelectionIndex());
+ expressionText.setEnabled(!HumanTask.NONE.equals(typeCombo.getText()));
+ }
+ };
- private IPropertySource input;
+ private ModifyListener expressionTextModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ changeProperty(HumanTask.ASSIGNMENT_EXPRESSION, expressionText.getText());
+ }
+ };
- private CommandStack commandStack;
-
-// private CommandStackListener commandStackListener = new CommandStackListener() {
-// public void commandStackChanged(EventObject event) {
-// if (!parent.isDisposed()) {
-// refresh();
-// }
-// }
-// };
-
public void createControls(Composite parent,
TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
-// this.parent = parent;
- if (aTabbedPropertySheetPage instanceof JpdlPropertySheetPage) {
- commandStack = ((JpdlPropertySheetPage)aTabbedPropertySheetPage).getCommandStack();
-// commandStack.addCommandStackListener(commandStackListener);
- }
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
+ Composite composite = getFlatFormComposite();
createTypeLabel(composite);
createTypeCombo(composite);
createExpressionLabel(composite);
createExpressionText(composite);
-// createLanguageLabel(composite);
-// createLanguageText(composite);
}
@@ -97,86 +80,22 @@
expressionText.setLayoutData(data);
}
-// private void createLanguageLabel(Composite parent) {
-// languageLabel = getWidgetFactory().createCLabel(parent, "Language");
-// FormData data = new FormData();
-// data.left = new FormAttachment(0, 0);
-// data.top = new FormAttachment(expressionText, 2);
-// languageLabel.setLayoutData(data);
-// }
-//
-// private void createLanguageText(Composite parent) {
-// languageText = getWidgetFactory().createText(parent, "");
-// FormData data = new FormData();
-// data.top = new FormAttachment(expressionText, 0);
-// data.left = new FormAttachment(0, 80);
-// data.right = new FormAttachment(100, 0);
-// languageText.setLayoutData(data);
-// }
-
- public void setInput(IWorkbenchPart part, ISelection selection) {
- super.setInput(part, selection);
- if (selection instanceof IStructuredSelection) {
- Object object = ((IStructuredSelection)selection).getFirstElement();
- if (object instanceof IAdaptable) {
- object = ((IAdaptable)object).getAdapter(IPropertySource.class);
- if (object instanceof IPropertySource) {
- input = (IPropertySource)object;
- return;
- }
- }
- }
- input = null;
- }
-
- private SelectionListener typeComboSelectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- changeProperty(HumanTask.ASSIGNMENT_TYPE, typeCombo.getSelectionIndex());
- expressionText.setEnabled(!HumanTask.NONE.equals(typeCombo.getText()));
- }
- };
-
- private ModifyListener expressionTextModifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- changeProperty(HumanTask.ASSIGNMENT_EXPRESSION, expressionText.getText());
- }
- };
-
-// private ModifyListener languageTextModifyListener = new ModifyListener() {
-// public void modifyText(ModifyEvent e) {
-// changeProperty(HumanTask.ASSIGNMENT_EXPRESSION_LANGUAGE, languageText.getText());
-// }
-// };
-
- protected void changeProperty(Object propertyId, Object newValue) {
- if (commandStack == null || input == null) return;
- Object oldValue = input.getPropertyValue(propertyId);
- if (oldValue == newValue) return;
- ChangePropertyCommand changePropertyCommand = new ChangePropertyCommand();
- changePropertyCommand.setPropertyId(propertyId);
- changePropertyCommand.setTarget(input);
- changePropertyCommand.setNewValue(newValue);
- commandStack.execute(changePropertyCommand);
- }
-
protected void unhookListeners() {
typeCombo.removeSelectionListener(typeComboSelectionListener);
expressionText.removeModifyListener(expressionTextModifyListener);
-// languageText.removeModifyListener(languageTextModifyListener);
}
protected void hookListeners() {
typeCombo.addSelectionListener(typeComboSelectionListener);
expressionText.addModifyListener(expressionTextModifyListener);
-// languageText.addModifyListener(languageTextModifyListener);
}
protected void updateValues() {
+ IPropertySource input = getInput();
if (input == null) {
typeCombo.setText(HumanTask.NONE);
expressionText.setEnabled(false);
expressionText.setText("");
-// languageText.setText("");
} else {
typeCombo.setText(HumanTask.ASSIGNMENT_TYPES[(Integer)input.getPropertyValue(HumanTask.ASSIGNMENT_TYPE)]);
if (HumanTask.NONE.equals(typeCombo.getText())) {
@@ -185,19 +104,8 @@
} else {
expressionText.setEnabled(true);
expressionText.setText((String)input.getPropertyValue(HumanTask.ASSIGNMENT_EXPRESSION));
-// languageText.setText((String)input.getPropertyValue(HumanTask.ASSIGNMENT_EXPRESSION_LANGUAGE));
}
}
}
- public void aboutToBeShown() {
- refresh();
- }
-
- public void refresh() {
- unhookListeners();
- updateValues();
- hookListeners();
- }
-
}
Added: 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 (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JpdlPropertySection.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -0,0 +1,89 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.jboss.tools.flow.jpdl4.command.ChangePropertyCommand;
+
+public abstract class JpdlPropertySection extends AbstractPropertySection {
+
+ private CommandStack commandStack;
+ private Composite flatFormComposite;
+ private IPropertySource input;
+
+ protected abstract void hookListeners();
+ protected abstract void updateValues();
+ protected abstract void unhookListeners();
+
+ protected CommandStack getCommandStack() {
+ return commandStack;
+ }
+
+ protected Composite getFlatFormComposite() {
+ return flatFormComposite;
+ }
+
+ protected String getValueNullsAllowed(String string) {
+ return "".equals(string) ? null : string;
+ }
+
+ protected String getValueNotNull(String string) {
+ return string == null ? "" : string;
+ }
+
+ public void createControls(Composite parent,
+ TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ if (aTabbedPropertySheetPage instanceof JpdlPropertySheetPage) {
+ commandStack = ((JpdlPropertySheetPage)aTabbedPropertySheetPage).getCommandStack();
+ }
+ flatFormComposite = getWidgetFactory().createFlatFormComposite(parent);
+ }
+
+ public void setInput(IWorkbenchPart part, ISelection selection) {
+ super.setInput(part, selection);
+ if (selection instanceof IStructuredSelection) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+ if (object instanceof IAdaptable) {
+ object = ((IAdaptable)object).getAdapter(IPropertySource.class);
+ if (object instanceof IPropertySource) {
+ input = (IPropertySource)object;
+ return;
+ }
+ }
+ }
+ input = null;
+ }
+
+ public IPropertySource getInput() {
+ return input;
+ }
+
+ protected void changeProperty(Object propertyId, Object newValue) {
+ if (commandStack == null || input == null) return;
+ Object oldValue = input.getPropertyValue(propertyId);
+ if (oldValue == newValue) return;
+ ChangePropertyCommand changePropertyCommand = new ChangePropertyCommand();
+ changePropertyCommand.setPropertyId(propertyId);
+ changePropertyCommand.setTarget(input);
+ changePropertyCommand.setNewValue(newValue);
+ commandStack.execute(changePropertyCommand);
+ }
+
+ public void aboutToBeShown() {
+ refresh();
+ }
+
+ public void refresh() {
+ unhookListeners();
+ updateValues();
+ hookListeners();
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JpdlPropertySection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-04-28 19:49:47 UTC (rev 14950)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/NameSection.java 2009-04-28 19:50:22 UTC (rev 14951)
@@ -2,11 +2,7 @@
import java.util.EventObject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gef.commands.CommandStack;
import org.eclipse.gef.commands.CommandStackListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.ModifyEvent;
@@ -15,29 +11,25 @@
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.jboss.tools.flow.common.command.RenameElementCommand;
import org.jboss.tools.flow.common.properties.IPropertyId;
-public class NameSection extends AbstractPropertySection implements IPropertyId {
+public class NameSection extends JpdlPropertySection implements IPropertyId {
private Text nameText;
private CLabel nameLabel;
- private IPropertySource input;
- private CommandStack commandStack;
-
private ModifyListener nameTextModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent arg0) {
+ IPropertySource input = getInput();
if (input != null) {
RenameElementCommand rec = new RenameElementCommand();
rec.setSource(input);
rec.setOldName((String)input.getPropertyValue(NAME));
rec.setName(nameText.getText());
- commandStack.execute(rec);
+ getCommandStack().execute(rec);
}
}
};
@@ -49,8 +41,8 @@
};
public void dispose() {
- if (commandStack != null) {
- commandStack.removeCommandStackListener(commandStackListener);
+ if (getCommandStack() != null) {
+ getCommandStack().removeCommandStackListener(commandStackListener);
}
super.dispose();
}
@@ -58,12 +50,7 @@
public void createControls(Composite parent,
TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
- if (aTabbedPropertySheetPage instanceof JpdlPropertySheetPage) {
- commandStack = ((JpdlPropertySheetPage)aTabbedPropertySheetPage).getCommandStack();
- commandStack.addCommandStackListener(commandStackListener);
- }
- Composite composite = getWidgetFactory()
- .createFlatFormComposite(parent);
+ Composite composite = getFlatFormComposite();
createNameLabel(composite);
createNameText(composite);
}
@@ -86,27 +73,18 @@
nameText.setLayoutData(data);
}
- public void setInput(IWorkbenchPart part, ISelection selection) {
- super.setInput(part, selection);
- if (selection instanceof IStructuredSelection) {
- Object object = ((IStructuredSelection)selection).getFirstElement();
- if (object instanceof IAdaptable) {
- object = ((IAdaptable)object).getAdapter(IPropertySource.class);
- if (object instanceof IPropertySource) {
- input = (IPropertySource)object;
- return;
- }
- }
- }
- input = null;
+ protected void hookListeners() {
+ nameText.addModifyListener(nameTextModifyListener);
}
- public void refresh() {
+ protected void unhookListeners() {
+ nameText.removeModifyListener(nameTextModifyListener);
+ }
+
+ protected void updateValues() {
+ IPropertySource input = getInput();
if (input != null) {
- String value = (String)input.getPropertyValue(NAME);
- nameText.removeModifyListener(nameTextModifyListener);
- nameText.setText(value == null ? "" : value);
- nameText.addModifyListener(nameTextModifyListener);
+ nameText.setText(getValueNotNull((String)input.getPropertyValue(NAME)));
} else {
nameText.setText("");
}
Added: 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 (rev 0)
+++ 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)
@@ -0,0 +1,129 @@
+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;
+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;
+
+public class TimerSection extends JpdlPropertySection {
+
+ private Text dueDateText;
+ private CLabel dueDateLabel;
+ private Text repeatText;
+ private CLabel repeatLabel;
+ private Text dueDateTimeText;
+ private CLabel dueDateTimeLabel;
+
+ private ModifyListener textModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ IPropertySource input = getInput();
+ CommandStack commandStack = getCommandStack();
+ if (input == null || commandStack == null) return;
+ if (dueDateText == event.getSource()) {
+ changeProperty("dueDate", getValueNullsAllowed(dueDateText.getText()));
+ } else if (repeatText == event.getSource()) {
+ changeProperty("repeat", getValueNullsAllowed(repeatText.getText()));
+ } else if (dueDateTimeText == event.getSource()) {
+ changeProperty("dueDateTime", getValueNullsAllowed(dueDateTimeText.getText()));
+ }
+ }
+ };
+
+ public void createControls(Composite parent,
+ TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ Composite composite = getFlatFormComposite();
+ createDueDateLabel(composite);
+ createDueDateText(composite);
+ createRepeatLabel(composite);
+ createRepeatText(composite);
+ createDueDateTimeLabel(composite);
+ createDueDateTimeText(composite);
+ }
+
+
+ private void createDueDateLabel(Composite parent) {
+ dueDateLabel = getWidgetFactory().createCLabel(parent, "Due Date (e.g. '3 business hours') ");
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 5);
+ dueDateLabel.setLayoutData(data);
+ }
+
+ private void createDueDateText(Composite parent) {
+ dueDateText = getWidgetFactory().createText(parent, "");
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(dueDateLabel, 0, SWT.RIGHT);
+ data.right = new FormAttachment(100, 0);
+ dueDateText.setLayoutData(data);
+ }
+
+ private void createRepeatLabel(Composite parent) {
+ repeatLabel = getWidgetFactory().createCLabel(parent, "Repeat (e.g. '30 minutes')");
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(dueDateText, 5);
+ repeatLabel.setLayoutData(data);
+ }
+
+ private void createRepeatText(Composite parent) {
+ repeatText = getWidgetFactory().createText(parent, "");
+ FormData data = new FormData();
+ data.top = new FormAttachment(dueDateText, 0);
+ data.left = new FormAttachment(dueDateLabel, 0, SWT.RIGHT);
+ data.right = new FormAttachment(100, 0);
+ repeatText.setLayoutData(data);
+ }
+
+ private void createDueDateTimeLabel(Composite parent) {
+ dueDateTimeLabel = getWidgetFactory().createCLabel(parent, "Due Date-time (e.g. 'HH:mm dd/MM/yyyy')");
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(repeatText, 5);
+ dueDateTimeLabel.setLayoutData(data);
+ }
+
+ private void createDueDateTimeText(Composite parent) {
+ dueDateTimeText = getWidgetFactory().createText(parent, "");
+ FormData data = new FormData();
+ data.top = new FormAttachment(repeatText, 0);
+ data.left = new FormAttachment(dueDateLabel, 0, SWT.RIGHT);
+ data.right = new FormAttachment(100, 0);
+ dueDateTimeText.setLayoutData(data);
+ }
+
+ protected void hookListeners() {
+ dueDateText.addModifyListener(textModifyListener);
+ repeatText.addModifyListener(textModifyListener);
+ dueDateTimeText.addModifyListener(textModifyListener);
+ }
+
+ protected void unhookListeners() {
+ dueDateText.removeModifyListener(textModifyListener);
+ repeatText.removeModifyListener(textModifyListener);
+ dueDateTimeText.removeModifyListener(textModifyListener);
+ }
+
+ 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")));
+ } else {
+ dueDateText.setText("");
+ repeatText.setText("");
+ dueDateTimeText.setText("");
+ }
+ }
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/TimerSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 8 months
JBoss Tools SVN: r14950 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-28 15:49:47 -0400 (Tue, 28 Apr 2009)
New Revision: 14950
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
Log:
IPropertySource adapter for AbstractWrapper
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2009-04-28 18:56:06 UTC (rev 14949)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2009-04-28 19:49:47 UTC (rev 14950)
@@ -154,6 +154,8 @@
public Object getAdapter(Class adapter) {
if (adapter == Element.class) {
return element;
+ } else if (adapter == IPropertySource.class) {
+ return getPropertySource();
}
return null;
}
15 years, 8 months
JBoss Tools SVN: r14949 - trunk.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-04-28 14:56:06 -0400 (Tue, 28 Apr 2009)
New Revision: 14949
Removed:
trunk/org.jboss.tools.seam.core/
Log:
delete project that was shared by mistake
15 years, 8 months
JBoss Tools SVN: r14948 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: icons/16 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-28 11:19:32 -0400 (Tue, 28 Apr 2009)
New Revision: 14948
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/event.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java
Removed:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.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/editpart/JpdlTreeEditPartFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SequenceFlowTreeRootEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TaskTreeRootEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java
Log:
delete and add eventlisteners
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/event.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/event.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-28 15:19:32 UTC (rev 14948)
@@ -344,9 +344,14 @@
<visibleWhen
checkEnabled="true">
<iterate>
- <instanceof
- value="org.jboss.tools.flow.jpdl4.editpart.ProcessTreeRootEditPart">
- </instanceof>
+ <or>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.ProcessTreeRootEditPart">
+ </instanceof>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.SwimlaneListTreeEditPart">
+ </instanceof>
+ </or>
</iterate>
</visibleWhen>
</command>
@@ -358,9 +363,14 @@
<visibleWhen
checkEnabled="true">
<iterate>
- <instanceof
- value="org.jboss.tools.flow.jpdl4.editpart.ProcessTreeRootEditPart">
- </instanceof>
+ <or>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.ProcessTreeRootEditPart">
+ </instanceof>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.EventListenerListTreeEditPart">
+ </instanceof>
+ </or>
</iterate>
</visibleWhen>
</command>
@@ -372,9 +382,14 @@
<visibleWhen
checkEnabled="true">
<iterate>
- <instanceof
- value="org.jboss.tools.flow.jpdl4.editpart.ProcessTreeRootEditPart">
- </instanceof>
+ <or>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.ProcessTreeRootEditPart">
+ </instanceof>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.TimerListTreeEditPart">
+ </instanceof>
+ </or>
</iterate>
</visibleWhen>
</command>
Deleted: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -1,26 +0,0 @@
-package org.jboss.tools.flow.jpdl4.editpart;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.flow.jpdl4.model.Process;
-import org.jboss.tools.flow.jpdl4.util.SharedImages;
-
-public class EventListenerContainerListTreeEditPart extends JpdlTreeEditPart {
-
- public EventListenerContainerListTreeEditPart(Process process) {
- super(process);
- }
-
- protected Image getImage() {
- String iconPath = "icons/16/events_multiple.gif";
- ImageDescriptor descriptor = ImageDescriptor.createFromURL(
- Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
- return SharedImages.INSTANCE.getImage(descriptor);
- }
-
- protected String getText() {
- return "Event Listeners";
- }
-
-}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerListTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerListTreeEditPart.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -0,0 +1,60 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.gef.EditPart;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class EventListenerListTreeEditPart extends JpdlTreeEditPart implements ElementTreeEditPart {
+
+ public EventListenerListTreeEditPart(Wrapper wrapper) {
+ super(wrapper);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/events_multiple.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "event";
+ }
+
+ protected List<Object> getModelChildren() {
+ List<Object> result = new ArrayList<Object>();
+ Wrapper wrapper = (Wrapper)getModel();
+ if (wrapper.getChildren("listener") != null) {
+ result.addAll(wrapper.getChildren("listener"));
+ }
+ return result;
+ }
+
+
+ public void activate() {
+ super.activate();
+ ((Wrapper)getModel()).addListener(this);
+ }
+
+ public void deactivate() {
+ ((Wrapper)getModel()).removeListener(this);
+ super.deactivate();
+ }
+
+ public void modelChanged(ModelEvent event) {
+ EditPart parent = getParent();
+ if (parent instanceof JpdlTreeEditPart) {
+ ModelEvent modelEvent = new ModelEvent(Wrapper.REMOVE_ELEMENT, "eventListener", getModel(), null, null);
+ ((JpdlTreeEditPart)parent).modelChanged(modelEvent);
+ }
+ refreshChildren();
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerTreeEditPart.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -0,0 +1,26 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class EventListenerTreeEditPart extends JpdlTreeEditPart implements ElementTreeEditPart {
+
+ public EventListenerTreeEditPart(Wrapper wrapper) {
+ super(wrapper);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/event.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "event";
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -7,6 +7,8 @@
import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.EventListener;
+import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
import org.jboss.tools.flow.jpdl4.model.Swimlane;
import org.jboss.tools.flow.jpdl4.model.Timer;
@@ -19,11 +21,12 @@
if (model instanceof Wrapper) {
Element element = ((Wrapper)model).getElement();
if (element instanceof Swimlane) return new SwimlaneTreeEditPart((Wrapper)model);
+ if (element instanceof EventListenerContainer) return new EventListenerListTreeEditPart((Wrapper)model);
+ if (element instanceof EventListener) return new EventListenerTreeEditPart((Wrapper)model);
if (element instanceof Timer) return new TimerTreeEditPart((Wrapper)model);
return new NoDetailsTreeRootEditPart();
}
if (model instanceof SwimlaneListTreeEditPart) return (EditPart)model;
- if (model instanceof EventListenerContainerListTreeEditPart) return (EditPart)model;
if (model instanceof TimerListTreeEditPart) return (EditPart)model;
return new NoDetailsTreeRootEditPart();
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -4,10 +4,12 @@
import java.util.List;
import org.eclipse.gef.EditPart;
+import org.jboss.tools.flow.common.command.DeleteChildCommand;
import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
public class ProcessTreeRootEditPart extends JpdlTreeEditPart {
@@ -23,20 +25,31 @@
FlowWrapper flowWrapper = (FlowWrapper)getModel();
if (flowWrapper == null) return null;
addSwimlanes(result, flowWrapper);
+ addEventListeners(result, flowWrapper);
addTimers(result, flowWrapper);
return result;
}
- private void addSwimlanes(List<Object> list, FlowWrapper wrapper) {
- List<Element> swimlanes = wrapper.getChildren("swimlane");
- if (swimlanes != null && !(swimlanes.isEmpty())) {
+ private void addSwimlanes(List<Object> list, FlowWrapper flowWrapper) {
+ List<Element> swimlanes = flowWrapper.getChildren("swimlane");
+ if (swimlanes != null && !swimlanes.isEmpty()) {
list.add(new SwimlaneListTreeEditPart(swimlanes));
}
}
- private void addTimers(List<Object> list, FlowWrapper wrapper) {
- List<Element> timers = wrapper.getChildren("timer");
- if (timers != null && !(timers.isEmpty())) {
+ private void addEventListeners(List<Object> list, FlowWrapper flowWrapper) {
+ List<Element> eventListeners = flowWrapper.getChildren("eventListener");
+ if (eventListeners == null) return;
+ for (Element element : eventListeners) {
+ if (element instanceof Wrapper) {
+ list.add((Wrapper)element);
+ }
+ }
+ }
+
+ private void addTimers(List<Object> list, FlowWrapper flowWrapper) {
+ List<Element> timers = flowWrapper.getChildren("timer");
+ if (timers != null && !timers.isEmpty()) {
list.add(new TimerListTreeEditPart(timers));
}
}
@@ -46,12 +59,31 @@
refreshChildren();
Object object = event.getNewValue();
EditPart editPart = (EditPart)getViewer().getEditPartRegistry().get(object);
- getViewer().select(editPart);
+ if (editPart != null) {
+ getViewer().select(editPart);
+ }
} else if (event.getChangeType() == Wrapper.REMOVE_ELEMENT) {
refreshChildren();
+// if ("eventListener".equals(event.getChangeDiscriminator())) {
+// doCleanup(event.getChangedObject());
+// }
}
}
+ private void doCleanup(Object object) {
+ if (!(object instanceof Wrapper)) return;
+ Wrapper child = (Wrapper)object;
+ if (!(child.getElement() instanceof EventListenerContainer)) return;
+ EventListenerContainer eventListenerContainer = (EventListenerContainer)child.getElement();
+ if (eventListenerContainer.getListeners().isEmpty()) {
+ DeleteChildCommand deleteChildCommand = new DeleteChildCommand();
+ deleteChildCommand.setChild(child);
+ deleteChildCommand.setParent((Wrapper)getModel());
+ deleteChildCommand.setType("eventListener");
+ getViewer().getEditDomain().getCommandStack().execute(deleteChildCommand);
+ }
+ }
+
public void activate() {
super.activate();
((FlowWrapper)getModel()).addListener(this);
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SequenceFlowTreeRootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SequenceFlowTreeRootEditPart.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SequenceFlowTreeRootEditPart.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -13,7 +13,7 @@
protected List<Object> getModelChildren() {
List<Object> result = new ArrayList<Object>();
- result.add(new EventListenerContainerListTreeEditPart(null));
+ result.add(new EventListenerListTreeEditPart(null));
return result;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TaskTreeRootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TaskTreeRootEditPart.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TaskTreeRootEditPart.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -13,7 +13,7 @@
protected List<Object> getModelChildren() {
List<Object> result = new ArrayList<Object>();
- result.add(new EventListenerContainerListTreeEditPart(null));
+ result.add(new EventListenerListTreeEditPart(null));
return result;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -5,6 +5,7 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.gef.EditPart;
+import org.eclipse.gef.RootEditPart;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -13,9 +14,9 @@
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.flow.common.command.AddChildCommand;
import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
-import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
-import org.jboss.tools.flow.jpdl4.model.Swimlane;
+import org.jboss.tools.flow.jpdl4.model.EventListener;
+import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
public class AddEventListenerHandler extends AbstractHandler implements IHandler {
@@ -29,19 +30,27 @@
if (!(first instanceof EditPart)) return null;
EditPart editPart = (EditPart)first;
Object model = editPart.getModel();
- if (model == null || !(model instanceof FlowWrapper)) return null;
- FlowWrapper flowWrapper = (FlowWrapper)model;
+ if (model == null || !(model instanceof Wrapper)) return null;
IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
if (editorPart == null) return null;
Object object = editorPart.getAdapter(CommandStack.class);
if (object == null || !(object instanceof CommandStack)) return null;
CommandStack commandStack = (CommandStack)object;
+ Wrapper parent = (Wrapper)model;
+ Wrapper child = new DefaultWrapper();
AddChildCommand addChildCommand = new AddChildCommand();
- Wrapper child = new DefaultWrapper();
- child.setElement(new Swimlane());
+ if (editPart.getParent() != null && editPart.getParent() instanceof RootEditPart) {
+ Wrapper wrapper = new DefaultWrapper();
+ wrapper.setElement(new EventListener());
+ addChildCommand.setType("eventListener");
+ child.setElement(new EventListenerContainer());
+ child.addChild("listener", wrapper);
+ } else {
+ addChildCommand.setType("listener");
+ child.setElement(new EventListener());
+ }
addChildCommand.setChild(child);
- addChildCommand.setType("eventListener");
- addChildCommand.setParent(flowWrapper);
+ addChildCommand.setParent(parent);
commandStack.execute(addChildCommand);
return null;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -13,7 +13,6 @@
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.flow.common.command.AddChildCommand;
import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
-import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.model.Swimlane;
@@ -29,8 +28,8 @@
if (!(first instanceof EditPart)) return null;
EditPart editPart = (EditPart)first;
Object model = editPart.getModel();
- if (model == null || !(model instanceof FlowWrapper)) return null;
- FlowWrapper flowWrapper = (FlowWrapper)model;
+ if (model == null || !(model instanceof Wrapper)) return null;
+ Wrapper parent = (Wrapper)model;
IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
if (editorPart == null) return null;
Object object = editorPart.getAdapter(CommandStack.class);
@@ -41,7 +40,7 @@
child.setElement(new Swimlane());
addChildCommand.setChild(child);
addChildCommand.setType("swimlane");
- addChildCommand.setParent(flowWrapper);
+ addChildCommand.setParent(parent);
commandStack.execute(addChildCommand);
return null;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -13,8 +13,11 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.flow.common.command.DeleteChildCommand;
+import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.Logger;
+import org.jboss.tools.flow.jpdl4.model.EventListener;
+import org.jboss.tools.flow.jpdl4.model.EventListenerContainer;
import org.jboss.tools.flow.jpdl4.model.Swimlane;
import org.jboss.tools.flow.jpdl4.model.Timer;
@@ -32,13 +35,9 @@
Object model = editPart.getModel();
if (model == null || !(model instanceof Wrapper)) return null;
Wrapper child = (Wrapper)model;
- EditPart root = null;
- while (editPart != null && !(editPart instanceof RootEditPart)) {
- root = editPart;
- editPart = editPart.getParent();
- }
- if (root == null) return null;
- model = root.getModel();
+ EditPart parentEditPart = getParentEditPart(child.getElement(), editPart);
+ if (parentEditPart == null) return null;
+ model = parentEditPart.getModel();
if (model == null || !(model instanceof Wrapper)) return null;
Wrapper parent = (Wrapper)model;
IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
@@ -52,6 +51,10 @@
deleteChildCommand.setType("swimlane");
} else if (child.getElement() instanceof Timer) {
deleteChildCommand.setType("timer");
+ } else if (child.getElement() instanceof EventListener) {
+ deleteChildCommand.setType("listener");
+ } else if (child.getElement() instanceof EventListenerContainer) {
+ deleteChildCommand.setType("eventListener");
}
deleteChildCommand.setParent(parent);
if (deleteChildCommand.canExecute()) {
@@ -61,5 +64,21 @@
}
return null;
}
+
+ private EditPart getParentEditPart(Element element, EditPart editPart) {
+ if (element instanceof Swimlane || element instanceof Timer) {
+ return getRootEditPart(editPart);
+ } else {
+ return editPart.getParent();
+ }
+ }
+
+ private EditPart getRootEditPart(EditPart editPart) {
+ EditPart result = editPart;
+ while (result.getParent() != null && !(result.getParent() instanceof RootEditPart)) {
+ result = result.getParent();
+ }
+ return result;
+ }
}
Deleted: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -1,27 +0,0 @@
-package org.jboss.tools.flow.jpdl4.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class DefaultEventListenerContainer {
-
- private String eventName;
- private List<EventListener> eventListeners = new ArrayList<EventListener>();
-
- public String getEventName() {
- return eventName;
- }
-
- public void setEventName(String eventName) {
- this.eventName = eventName;
- }
-
- public void addEventListener(EventListener eventListener) {
- eventListeners.add(eventListener);
- }
-
- public void removeEventListener(EventListener eventListener) {
- eventListeners.remove(eventListener);
- }
-
-}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java 2009-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -1,5 +1,17 @@
package org.jboss.tools.flow.jpdl4.model;
-public class EventListener {
+import org.jboss.tools.flow.common.model.DefaultElement;
+public class EventListener extends DefaultElement {
+
+ private String className;
+
+ public String getClassName() {
+ return className;
+ }
+
+ public void setClassName(String className) {
+ this.className = className;
+ }
+
}
Added: 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 (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -0,0 +1,66 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.DefaultElement;
+
+public class EventListenerContainer extends DefaultElement {
+
+ private String eventType;
+ private List<EventListener> listeners = new ArrayList<EventListener>();
+
+ public EventListenerContainer() {
+ setMetaData("propertySource", new PropertySource());
+ }
+
+ public String getEventType() {
+ return eventType;
+ }
+
+ public void setEventType(String eventType) {
+ this.eventType = eventType;
+ }
+
+ public List<EventListener> getListeners() {
+ return listeners;
+ }
+
+ public void setListeners(List<EventListener> listeners) {
+ this.listeners = listeners;
+ }
+
+ private class PropertySource implements IPropertySource {
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ if ("listener".equals(id)) {
+ return listeners;
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if ("listener".equals(id)) {
+ return true;
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListenerContainer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-04-28 15:07:15 UTC (rev 14947)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2009-04-28 15:19:32 UTC (rev 14948)
@@ -16,8 +16,7 @@
private List<Swimlane> swimlanes = new ArrayList<Swimlane>();
private List<Timer> timers = new ArrayList<Timer>();
-// private List<String> eventTypes = new ArrayList<String>();
-// private Map<String, List<EventListener>> eventListeners = new HashMap<String, List<EventListener>>();
+ private List<EventListenerContainer> eventlisteners = new ArrayList<EventListenerContainer>();
public Process() {
setMetaData("propertySource", new PropertySource());
@@ -61,6 +60,8 @@
return swimlanes;
} else if ("timer".equals(id)) {
return timers;
+ } else if ("eventListener".equals(id)) {
+ return eventlisteners;
}
return null;
}
@@ -70,6 +71,8 @@
return true;
} else if ("timer".equals(id)) {
return true;
+ } else if ("eventListener".equals(id)) {
+ return true;
}
return false;
}
15 years, 8 months
JBoss Tools SVN: r14947 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-28 11:07:15 -0400 (Tue, 28 Apr 2009)
New Revision: 14947
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4213Test.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4213
Test added
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4213Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4213Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4213Test.java 2009-04-28 15:07:15 UTC (rev 14947)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+* Copyright (c) 2007 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
+import org.jboss.tools.jst.web.project.WebProject;
+import org.jboss.tools.jst.web.tld.ITaglibMapping;
+import org.jboss.tools.jst.web.tld.TaglibMapping;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * @author V.Kabanovich
+ *
+ */
+public class JBIDE4213Test extends VpeTest {
+
+ private static final String TEST_PAGE_NAME="JBIDE/1105/employee.xhtml"; //$NON-NLS-1$
+
+ public JBIDE4213Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE4213() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ setException(null);
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("customFaceletsTestProject");
+ assertNotNull(project);
+
+ IModelNature nature = EclipseResourceUtil.getModelNature(project);
+ assertNotNull(nature);
+
+ ITaglibMapping tm = WebProject.getInstance(nature.getModel()).getTaglibMapping();
+ ((TaglibMapping)tm).revalidate(WebAppHelper.getWebApp(nature.getModel()));
+ XModelObject o = tm.getTaglibObject("http://mareshkau/tags");
+ assertNotNull(o);
+
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
+}
15 years, 8 months
JBoss Tools SVN: r14946 - in trunk/jsf/plugins/org.jboss.tools.jsf: resources/help and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-28 09:37:56 -0400 (Tue, 28 Apr 2009)
New Revision: 14946
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/AddTagHandler.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibObjectImpl.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf/resources/help/keys-jsf.properties
trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibConstants.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibEntityRecognizer.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibLoader.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4213
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2009-04-28 13:26:20 UTC (rev 14945)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2009-04-28 13:37:56 UTC (rev 14946)
@@ -365,6 +365,10 @@
class="org.jboss.tools.jsf.facelet.model.FaceletTaglibEntityRecognizer"/>
<xclass id="org.jboss.tools.jsf.facelet.model.FaceletTaglibLoader"
class="org.jboss.tools.jsf.facelet.model.FaceletTaglibLoader"/>
+ <xclass id="org.jboss.tools.jsf.facelet.model.FaceletTaglibObjectImpl"
+ class="org.jboss.tools.jsf.facelet.model.FaceletTaglibObjectImpl"/>
+ <xclass id="org.jboss.tools.jsf.facelet.model.AddTagHandler"
+ class="org.jboss.tools.jsf.facelet.model.AddTagHandler"/>
</extension>
<extension
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/help/keys-jsf.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/help/keys-jsf.properties 2009-04-28 13:26:20 UTC (rev 14945)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/help/keys-jsf.properties 2009-04-28 13:37:56 UTC (rev 14946)
@@ -630,3 +630,34 @@
JSFValidatorExtension_CreateTag.Title=Tag
JSFConfigExtensions_Properties.Title=Extensions
+
+FileFaceletTaglib_Properties.Title=File Facelet Taglib
+
+FileFaceletTaglib_AddTag.WindowTitle=Add Tag
+FileFaceletTaglib_AddTag.Title=Facelet Tag
+
+FileFaceletTaglib_AddFunction.WindowTitle=Add Function
+FileFaceletTaglib_AddFunction.Title=Facelet Function
+
+FaceletTaglibTag_AddHandler.WindowTitle=New Handler
+FaceletTaglibTag_AddHandler.Title=Facelet Tag Handler
+
+FaceletTaglibTag_AddComponent.WindowTitle=New Component
+FaceletTaglibTag_AddComponent.Title=Facelet Component
+
+FaceletTaglibTag_AddConverter.WindowTitle=New Converter
+FaceletTaglibTag_AddConverter.Title=Facelet Converter
+
+FaceletTaglibTag_AddValidator.WindowTitle=New Validator
+FaceletTaglibTag_AddValidator.Title=Facelet Validator
+
+FaceletTaglibTag_AddSource.WindowTitle=New Source
+FaceletTaglibTag_AddSource.Title=Facelet Tag Source
+
+FaceletTaglibTag_Properties.Title=Facelet Tag
+
+FaceletTaglibHandler_Properties.Title=Facelet Tag Handler
+FaceletTaglibComponent_Properties.Title=Facelet Component
+FaceletTaglibConverter_Properties.Title=Facelet Converter
+FaceletTaglibValidator_Properties.Title=Facelet Validator
+FaceletTaglibSource_Properties.Title=Facelet Tag Source
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta 2009-04-28 13:26:20 UTC (rev 14945)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta 2009-04-28 13:37:56 UTC (rev 14946)
@@ -10,6 +10,9 @@
<MAPPING name="FilteredTreeConstraints"/>
<MAPPING name="FilteredTrees"/>
<MAPPING name="Handlers"/>
+ <MAPPING name="Implementations">
+ <PAIR name="FT_TagDecl" value="org.jboss.tools.jsf.facelet.model.FaceletTaglibObjectImpl"/>
+ </MAPPING>
<MAPPING name="Recognizers">
<PAIR name="xml$41" value="org.jboss.tools.jsf.facelet.model.FaceletTaglibEntityRecognizer"/>
</MAPPING>
@@ -34,7 +37,7 @@
</GROUP>
</ICONS>
<GlobalActions kind="list"/>
- <XModelEntity ImplementingClass="%Custom%"
+ <XModelEntity ImplementingClass="%FT_TagDecl%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.jsf.ui.editor.form.FaceletTaglibXMLFormLayoutData"
XMLSUBPATH="component" name="FaceletTaglibComponent">
<XChildrenEntities/>
@@ -87,7 +90,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%Custom%"
+ <XModelEntity ImplementingClass="%FT_TagDecl%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.jsf.ui.editor.form.FaceletTaglibXMLFormLayoutData"
XMLSUBPATH="converter" name="FaceletTaglibConverter">
<XChildrenEntities/>
@@ -188,7 +191,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%Custom%"
+ <XModelEntity ImplementingClass="%FT_TagDecl%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.jsf.ui.editor.form.FaceletTaglibXMLFormLayoutData"
XMLSUBPATH="handler-class" name="FaceletTaglibHandler">
<XChildrenEntities/>
@@ -238,7 +241,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%Custom%"
+ <XModelEntity ImplementingClass="%FT_TagDecl%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.jsf.ui.editor.form.FaceletTaglibXMLFormLayoutData"
XMLSUBPATH="source" name="FaceletTaglibSource">
<XChildrenEntities/>
@@ -248,7 +251,7 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="handler" loader="ElementType" name="element type">
+ <XModelAttribute default="source" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true" default="declaration"
@@ -316,6 +319,13 @@
kind="list" name="CreateActions">
<XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
+ WizardClassName="%Default%" displayName="Handler..." kind="action" name="AddHandler">
+ <EntityData EntityName="FaceletTaglibHandler">
+ <AttributeData AttributeName="handler-class"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
WizardClassName="%Default%" displayName="Component..."
kind="action" name="AddComponent">
<EntityData EntityName="FaceletTaglibComponent">
@@ -333,6 +343,22 @@
<AttributeData AttributeName="handler-class" Mandatory="no"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
+ WizardClassName="%Default%" displayName="Validator..."
+ kind="action" name="AddValidator">
+ <EntityData EntityName="FaceletTaglibValidator">
+ <AttributeData AttributeName="validator-id"/>
+ <AttributeData AttributeName="handler-class" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
+ WizardClassName="%Default%" displayName="Source..." kind="action" name="AddSource">
+ <EntityData EntityName="FaceletTaglibSource">
+ <AttributeData AttributeName="source"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
<XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
@@ -355,7 +381,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%Custom%"
+ <XModelEntity ImplementingClass="%FT_TagDecl%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.jsf.ui.editor.form.FaceletTaglibXMLFormLayoutData"
XMLSUBPATH="validator" name="FaceletTaglibValidator">
<XChildrenEntities/>
@@ -503,7 +529,25 @@
ICON="action.save" displayName="Save" kind="action" name="Save"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="New" group="1"
- kind="list" name="CreateActions"/>
+ kind="list" name="CreateActions">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.jsf.facelet.model.AddTagHandler"
+ ICON="action.empty" PROPERTIES="validator.add=true"
+ WizardClassName="%Default%" displayName="Tag..." kind="action" name="AddTag">
+ <EntityData EntityName="FaceletTaglibTag">
+ <AttributeData AttributeName="tag-name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%CreateInCollapsed%"
+ ICON="action.empty" PROPERTIES="validator.add=true"
+ WizardClassName="%Default%" displayName="Function..." kind="action" name="AddFunction">
+ <EntityData EntityName="FaceletTaglibFunction">
+ <AttributeData AttributeName="function-name"/>
+ <AttributeData AttributeName="function-class"/>
+ <AttributeData AttributeName="function-signature"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
<XActionItem HIDE="disabled"
HandlerClassName="org.jboss.tools.jst.web.tld.model.handlers.ExpandTLDHandler"
ICON="action.empty" displayName="Set Expanded" kind="action" name="SetExpanded"/>
@@ -539,7 +583,7 @@
<XEntityRenderer/>
<XModelAttributes/>
<XActionItem kind="list">
- <XActionItemReference entity="FileFaceletTaglib" name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="FileFaceletTaglib" name="CreateActions"/>
<XActionItem ICON="action.empty" kind="list" name="Properties">
<XActionItem HandlerClassName="%Properties%" ICON="action.empty"
displayName="Properties..." kind="action" name="Properties"/>
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/AddTagHandler.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/AddTagHandler.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/AddTagHandler.java 2009-04-28 13:37:56 UTC (rev 14946)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.facelet.model;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.jst.web.tld.model.handlers.CreateInCollapsedHandler;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class AddTagHandler extends CreateInCollapsedHandler {
+
+ protected XModelObject modifyCreatedObject(XModelObject o) {
+ XModelObject c = o.getModel().createModelObject("FaceletTaglibHandler", null);
+ o.addChild(c);
+ return o;
+ }
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibConstants.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibConstants.java 2009-04-28 13:26:20 UTC (rev 14945)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibConstants.java 2009-04-28 13:37:56 UTC (rev 14946)
@@ -1,5 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.facelet.model;
+/**
+ * @author Viacheslav Kabanovich
+ */
public interface FaceletTaglibConstants {
public static final String DOC_QUALIFIEDNAME = "facelet-taglib";
public static final String DOC_PUBLICID = "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN";
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibEntityRecognizer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibEntityRecognizer.java 2009-04-28 13:26:20 UTC (rev 14945)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibEntityRecognizer.java 2009-04-28 13:37:56 UTC (rev 14946)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.facelet.model;
import org.jboss.tools.common.model.loaders.EntityRecognizer;
@@ -2,2 +12,5 @@
+/**
+ * @author Viacheslav Kabanovich
+ */
public class FaceletTaglibEntityRecognizer implements EntityRecognizer, FaceletTaglibConstants {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibLoader.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibLoader.java 2009-04-28 13:26:20 UTC (rev 14945)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibLoader.java 2009-04-28 13:37:56 UTC (rev 14946)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.facelet.model;
import org.jboss.tools.common.meta.XAttribute;
@@ -5,6 +15,9 @@
import org.jboss.tools.common.model.loaders.impl.SimpleWebFileLoader;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+/**
+ * @author Viacheslav Kabanovich
+ */
public class FaceletTaglibLoader extends SimpleWebFileLoader {
public FaceletTaglibLoader() {}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibObjectImpl.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibObjectImpl.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/facelet/model/FaceletTaglibObjectImpl.java 2009-04-28 13:37:56 UTC (rev 14946)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.facelet.model;
+
+import org.jboss.tools.common.model.impl.CustomizedObjectImpl;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class FaceletTaglibObjectImpl extends CustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public String getPresentationString() {
+ String element = getAttributeValue("element type");
+ return element != null ? element : super.getPresentationString();
+ }
+
+}
15 years, 8 months
JBoss Tools SVN: r14945 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-28 09:26:20 -0400 (Tue, 28 Apr 2009)
New Revision: 14945
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4213
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java 2009-04-28 12:48:32 UTC (rev 14944)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java 2009-04-28 13:26:20 UTC (rev 14945)
@@ -79,12 +79,32 @@
}
}
}
+ getFaceletTaglibs(webxml);
loadTldsInWebInf();
findTldsInJars();
taglibObjectsCopy = null;
isLoading = false;
}
-
+
+ private void getFaceletTaglibs(XModelObject webxml) {
+ XModelObject webRoot = FileSystemsHelper.getWebRoot(model);
+ if(webxml == null || webRoot == null) return;
+ XModelObject cp = WebAppHelper.findWebAppContextParam(webxml, "facelets.LIBRARIES");
+ if(cp == null) return;
+ String path = cp.getAttributeValue("param-value");
+ if(path == null || path.length() == 0) return;
+ String modelPath = path;
+ if(modelPath.startsWith("/")) modelPath = modelPath.substring(1);
+ XModelObject facelet = webRoot.getChildByPath(modelPath);
+ if(facelet == null) return;
+ String uri = facelet.getAttributeValue("uri");
+ if(uri != null) {
+ resolvedURIs.put(path, uri);
+ taglibObjects.put(uri, facelet);
+ }
+ }
+
+
public Map<String,XModelObject> getTaglibObjects() {
Map<String,XModelObject> result = taglibObjectsCopy;
if(result == null) {
15 years, 8 months