summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2011-12-07 06:05:40 (EST)
committerStephan Born2012-04-24 04:16:39 (EDT)
commit75e455ebcdeed2ae968f1ad1a346b754f4d75028 (patch)
tree8536f9c304360c4f982db5cf96e4839d3d99b1b9
parent08b3ab0c9331f52b1707f86501b1acb60a6829a1 (diff)
downloadorg.eclipse.stardust.ide-75e455ebcdeed2ae968f1ad1a346b754f4d75028.zip
org.eclipse.stardust.ide-75e455ebcdeed2ae968f1ad1a346b754f4d75028.tar.gz
org.eclipse.stardust.ide-75e455ebcdeed2ae968f1ad1a346b754f4d75028.tar.bz2
Jira-ID: CRNT-22831 Merge: CRNT-22218 (Clicking on any field of input, typed access point created by structured data throws exception)
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@51715 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationApplicationControlsManager.java16
-rw-r--r--modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationController.java96
2 files changed, 54 insertions, 58 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationApplicationControlsManager.java b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationApplicationControlsManager.java
index 048e5f8..629db67 100644
--- a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationApplicationControlsManager.java
+++ b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationApplicationControlsManager.java
@@ -589,7 +589,6 @@ public class MessageTransformationApplicationControlsManager
{
TreeSelection selection = (TreeSelection) event.getSelection();
controller.sourceMessageFieldSelected(selection);
-
if (!controller.isSimpleMode())
{
sourceFieldText = controller.getDraggedText();
@@ -662,14 +661,10 @@ public class MessageTransformationApplicationControlsManager
{
public void selectionChanged(SelectionChangedEvent event)
{
- controller.ignoreUpcomingAnnotationChanges();
- TreeSelection selection = (TreeSelection) event.getSelection();
-
- boolean refreshDocument = controller.targetMessageFieldSelected(selection);
-
- if (!controller.isSimpleMode())
- {
- if (!simpleMode)
+ controller.ignoreUpcomingAnnotationChanges();
+ TreeSelection selection = (TreeSelection) event.getSelection();
+ boolean refreshDocument = controller.targetMessageFieldSelected(selection);
+ if (!controller.isSimpleMode())
{
if (null != controller.getSelectedTargetField())
{
@@ -701,9 +696,6 @@ public class MessageTransformationApplicationControlsManager
}
sourceMessageTreeViewer.refreshVisibleItems();
}
-
- }
-
}
});
diff --git a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationController.java b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationController.java
index 737fac7..7eb324e 100644
--- a/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationController.java
+++ b/modeling/org.eclipse.stardust.modeling.transformation/src/org/eclipse/stardust/modeling/transformation/messaging/modeling/application/transformation/MessageTransformationController.java
@@ -481,53 +481,57 @@ private void extractAccessPoints(IModelElement element)
return expressionRegion;
}
- public boolean targetMessageFieldSelected(TreeSelection targetTreeSelection) {
- selectedTargetField = (AccessPointType) targetTreeSelection
- .getFirstElement();
- if (selectedTargetField == null) {
- return false;
- }
- String xPath = getXPathFor(selectedTargetField);
- if (selectedTargetField != null && xPath != null) {
- this.selectedTargetFieldMapping = fieldMappings
- .get(xPath);
- if (null != selectedTargetFieldMapping) {
- if (selectedTargetFieldMapping.getMappingExpression() != null) {
- expressionDocument = "//Expression\n" //$NON-NLS-1$
- + selectedTargetFieldMapping.getMappingExpression();
- } else {
- expressionDocument = "//Expression\n" + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- statementsDocument = "//Statements\n" + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- return true;
- }
- }
- return false;
- }
-
- public void sourceMessageFieldSelected(TreeSelection sourceTreeSelection) {
- selectedSourceFields = extractSelectedElements(sourceTreeSelection);
- selectedSourceField = (AccessPointType) sourceTreeSelection.getFirstElement();
- if (selectedSourceField == null) {
- return;
- }
- arraySelectionDepthSource = getArraySelectionDepth(selectedSourceField);
- String xPath = this.getXPathFor(selectedSourceField);
- if (selectedSourceField != null && xPath != null) {
- FieldMapping fm = fieldMappings.get(xPath);
- if (fm != null) {
- String javaPath = getMapperByType(selectedSourceField).renderGetterCode(false, false, null);
- draggedText = javaPath;
- draggedText = draggedText.replaceAll("@",""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } else {
- if (selectedSourceField != null && isRoot(selectedSourceField)) {
- draggedText = selectedSourceField.getName();
- draggedText = draggedText.replaceAll("@",""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
+ public boolean targetMessageFieldSelected(TreeSelection targetTreeSelection) {
+ selectedTargetField = (AccessPointType) targetTreeSelection
+ .getFirstElement();
+ if (selectedTargetField == null) {
+ return false;
+ }
+ if (this.isSimpleMode()) {
+ String xPath = getXPathFor(selectedTargetField);
+ if (selectedTargetField != null && xPath != null) {
+ this.selectedTargetFieldMapping = fieldMappings
+ .get(xPath);
+ if (null != selectedTargetFieldMapping) {
+ if (selectedTargetFieldMapping.getMappingExpression() != null) {
+ expressionDocument = "//Expression\n" //$NON-NLS-1$
+ + selectedTargetFieldMapping.getMappingExpression();
+ } else {
+ expressionDocument = "//Expression\n" + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ statementsDocument = "//Statements\n" + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ public void sourceMessageFieldSelected(TreeSelection sourceTreeSelection) {
+ selectedSourceFields = extractSelectedElements(sourceTreeSelection);
+ selectedSourceField = (AccessPointType) sourceTreeSelection.getFirstElement();
+ if (selectedSourceField == null) {
+ return;
+ }
+ if (!isSimpleMode()) {
+ arraySelectionDepthSource = getArraySelectionDepth(selectedSourceField);
+ String xPath = this.getXPathFor(selectedSourceField);
+ if (selectedSourceField != null && xPath != null) {
+ FieldMapping fm = fieldMappings.get(xPath);
+ if (fm != null) {
+ String javaPath = getMapperByType(selectedSourceField).renderGetterCode(false, false, null);
+ draggedText = javaPath;
+ draggedText = draggedText.replaceAll("@",""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else {
+ if (selectedSourceField != null && isRoot(selectedSourceField)) {
+ draggedText = selectedSourceField.getName();
+ draggedText = draggedText.replaceAll("@",""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+ }
+
private List<AccessPointType> extractSelectedElements(TreeSelection sourceTreeSelection) {
List<AccessPointType> result = new ArrayList<AccessPointType>();
for (Iterator<?> i = sourceTreeSelection.iterator(); i.hasNext();) {