Author: bbrodt
Date: 2010-10-15 09:29:07 -0400 (Fri, 15 Oct 2010)
New Revision: 25865
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditPropertyAliasDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java
Log:
https://jira.jboss.org/browse/JBIDE-7107
more fixes: query expression not constructed properly
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java 2010-10-15
13:15:35 UTC (rev 25864)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java 2010-10-15
13:29:07 UTC (rev 25865)
@@ -209,8 +209,21 @@
for (int i=0; i<sel2.length; ++i) {
Object data = sel2[i].getData();
if (data instanceof TreeNode)
- data = ((TreeNode)data).getModelObject();
- result.add(data);
+ {
+ // list of the selected node's model object ancestry in reverse order
+ ArrayList<Object> elements = new ArrayList<Object>();
+ TreeNode node = (TreeNode)data;
+ ITreeContentProvider prov =
(ITreeContentProvider)fTreeViewer.getContentProvider();
+ do {
+ elements.add(node.getModelObject());
+ node = (TreeNode)prov.getParent(node);
+ }
+ while (node!=null && node.getModelObject()!=sel1[0]);
+
+ for (int e=elements.size(); e>0; --e) {
+ result.add(elements.get(e-1));
+ }
+ }
}
setResult(result);
}
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditPropertyAliasDialog.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditPropertyAliasDialog.java 2010-10-15
13:15:35 UTC (rev 25864)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/EditPropertyAliasDialog.java 2010-10-15
13:29:07 UTC (rev 25865)
@@ -454,53 +454,21 @@
if (result.length>=1) {
type = result[0];
+ int index = 1;
if (type instanceof Message) {
message = (Message) type;
- if (result.length>=2) {
- if (result[1] instanceof Part) {
- part = result[1];
- }
- else if (result[1] instanceof XSDComponent) {
- // The selected XSD component must be a child of the message part.
- // Look for part and build query path to the component.
- // TODO: move this search algorithm to ModelQuery class
- for ( Part p : (EList<Part>)message.getEParts() ) {
- XSDTypeDefinition def = p.getElementDeclaration().getTypeDefinition();
- XSDComponent comp = (XSDComponent)result[1];
- String s = "";
- while ( comp.eContainer() instanceof XSDComponent ) {
- comp = (XSDComponent)comp.eContainer();
- if (def == comp) {
- part = p.getName();
- query = s;
- break;
- }
- else
- {
- if (comp instanceof XSDParticle && ((XSDParticle)comp).getTerm()
instanceof XSDNamedComponent)
- {
- XSDNamedComponent nc = (XSDNamedComponent)((XSDParticle)comp).getTerm();
- s = "/" + nc.getName() + s;
- }
- }
- }
- }
- }
+ if (result.length>=2 && result[1] instanceof Part) {
+ part = ((Part)result[1]).getName();
+ index = 2;
}
}
- else if (type instanceof XSDComponent) {
- if (result.length>=2 && result[1] instanceof XSDComponent) {
- XSDComponent comp = (XSDComponent)result[1];
- query = "";
- while ( comp.eContainer() instanceof XSDComponent ) {
- comp = (XSDComponent)comp.eContainer();
- if (comp instanceof XSDParticle && ((XSDParticle)comp).getTerm()
instanceof XSDNamedComponent)
- {
- XSDNamedComponent nc = (XSDNamedComponent)((XSDParticle)comp).getTerm();
- query = "/" + nc.getName() + query;
- }
- }
+ query = "";
+ while (index<result.length) {
+ if (result[index] instanceof XSDComponent) {
+ XSDNamedComponent nc = (XSDNamedComponent)result[index];
+ query = query + "/" + nc.getQName();
}
+ ++index;
}
}
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java 2010-10-15
13:15:35 UTC (rev 25864)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/TypeSelectorDialog.java 2010-10-15
13:29:07 UTC (rev 25865)
@@ -276,7 +276,7 @@
enabled = false;
}
}
- if ( getResult().length!=2 && this.requireLowerTreeSelection )
+ if ( getResult().length<2 && this.requireLowerTreeSelection )
enabled = false;
getOkButton().setEnabled(enabled);
@@ -292,7 +292,7 @@
return;
}
}
- if ( getResult().length!=2 && this.requireLowerTreeSelection )
+ if ( getResult().length<2 && this.requireLowerTreeSelection )
return;
super.okPressed();
}