JBoss Tools SVN: r10449 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/search and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-24 09:26:37 -0400 (Wed, 24 Sep 2008)
New Revision: 10449
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
Log:
JBIDE-1497.
Replacing ELToken with ELModel in SeamSearchVisitor.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2008-09-24 13:24:20 UTC (rev 10448)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2008-09-24 13:26:37 UTC (rev 10449)
@@ -22,6 +22,7 @@
org.eclipse.wst.common.frameworks.ui,
org.jboss.tools.common,
org.jboss.tools.seam.core,
+ org.jboss.tools.common.el.core,
org.apache.log4j,
org.hibernate.eclipse.console,
org.eclipse.jdt.ui,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2008-09-24 13:24:20 UTC (rev 10448)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2008-09-24 13:26:37 UTC (rev 10449)
@@ -91,6 +91,12 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -108,13 +114,9 @@
import org.jboss.tools.seam.internal.core.AbstractSeamDeclaration;
import org.jboss.tools.seam.internal.core.SeamComponent;
import org.jboss.tools.seam.internal.core.el.ELOperandToken;
-import org.jboss.tools.seam.internal.core.el.ELStringToken;
-import org.jboss.tools.seam.internal.core.el.ELToken;
import org.jboss.tools.seam.internal.core.el.ElVarSearcher;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.internal.core.el.SeamELOperandTokenizerForward;
-import org.jboss.tools.seam.internal.core.el.SeamELStringTokenizer;
-import org.jboss.tools.seam.internal.core.el.SeamELTokenizer;
import org.jboss.tools.seam.internal.core.el.Var;
import org.jboss.tools.seam.internal.core.scanner.ScannerException;
import org.jboss.tools.seam.internal.core.scanner.java.AnnotatedASTNode;
@@ -676,8 +678,12 @@
int length = valueRegion.getLength();
int offset = valueRegion.getOffset();
- String string = "#{" + value + "}";
- locateMatchesInString(file, string, offset - 2, content);
+ if(value != null && value.indexOf("#{") >= 0) {
+ locateMatchesInString(file, value, offset, content);
+ } else {
+ String string = "#{" + value + "}";
+ locateMatchesInString(file, string, offset - 2, content);
+ }
}
}
} catch (BadLocationException e) {
@@ -692,25 +698,24 @@
private void locateMatchesInString(IFile file, String string, int offset, CharSequence content) throws CoreException {
int startEl = string.indexOf("#{"); //$NON-NLS-1$
if(startEl>-1) {
- SeamELStringTokenizer st = new SeamELStringTokenizer(string);
- List<ELStringToken> tokens = st.getTokens();
- for (ELStringToken stringToken : tokens) {
- stringToken.setStart(offset + stringToken.getStart() + 2);
- locateMatchesInEL(file, stringToken, content);
+ ELParser parser = ELParserFactory.createJbossParser();
+ ELModel model = parser.parse(string);
+ List<ELInstance> is = model.getInstances();
+ for (ELInstance i: is) {
+ if(i.getExpression() != null) {
+ locateMatchesInEL(file, i.getExpression(), content, offset);
+ }
}
}
}
- private void locateMatchesInEL(IFile file, ELStringToken el, CharSequence content) throws CoreException {
- String exp = el.getBody();
- SeamELTokenizer elTokenizer = new SeamELTokenizer(exp);
- List<ELToken> tokens = elTokenizer.getTokens();
- for (ELToken token : tokens) {
- if(token.getType()==ELToken.EL_VARIABLE_TOKEN) {
+ private void locateMatchesInEL(IFile file, ELExpression el, CharSequence content, int offset) throws CoreException {
+ List<ELInvocationExpression> invocations = el.getInvocations();
+ for (ELInvocationExpression token : invocations) {
// validateElOperand(file, token, el.getStart());
String operand = token.getText();
String varName = operand;
- int offsetOfToken = el.getStart() + token.getStart();
+ int offsetOfToken = offset + token.getFirstToken().getStart();
SeamELOperandTokenizerForward forwardTokenizer = new SeamELOperandTokenizerForward(operand, 0);
List<ELOperandToken>operandTokens = forwardTokenizer.getTokens();
if (fJavaMatchers != null) {
@@ -794,7 +799,6 @@
}
}
}
- }
}
}
16 years, 3 months
JBoss Tools SVN: r10448 - in trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el: core/parser and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-09-24 09:24:20 -0400 (Wed, 24 Sep 2008)
New Revision: 10448
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELExpression.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/TokenizerFactory.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELComplexExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInvocationExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMethodInvocationImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMultiExpressionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELPropertyInvocationImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/UnaryTokenDescription.java
Log:
JBIDE-1497.
Minor fixes in EL parser.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELExpression.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELExpression.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/model/ELExpression.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.common.el.core.model;
+import java.util.List;
+
/**
*
* @author V. Kabanovich
@@ -17,4 +19,10 @@
*/
public interface ELExpression extends ELObject {
+ /**
+ * Utility method
+ * @return
+ */
+ public List<ELInvocationExpression> getInvocations();
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/TokenizerFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/TokenizerFactory.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/TokenizerFactory.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -13,6 +13,7 @@
import java.util.List;
import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELModel;
import org.jboss.tools.common.el.internal.core.parser.rule.ArgRule;
import org.jboss.tools.common.el.internal.core.parser.rule.CallRule;
@@ -99,8 +100,8 @@
}
public static void main(String[] args) {
- String text = //"#{a.b.}";
-"#{a.b + s.h((6 != -8) & (7 + -iy88.g[9].h(7 div 8).i.j)+(8) ? 4 : 7,'p', a.b.c.d[null])}";
+ String text = "#{a.b().b()}";
+//"#{not a.b(x,y) + s.h((6 != -8) & (7 + -iy88.g[9].h(7 div 8).i.j)+(8) ? 4 : 7,'p', a.b.c.d[null])}";
//"q82#{a( g.h(7 + 8) + 8, g['h'].j(),'p')}k#{b}";
Tokenizer t = createJbossTokenizer();
LexicalToken token = t.parse(text);
@@ -120,6 +121,11 @@
System.out.println(model);
ELExpression expr = model.getInstances().get(0).getExpression();
System.out.println("Expression=" + expr);
+ List<ELInvocationExpression> is = expr.getInvocations();
+ System.out.println("Invocations:");
+ for (ELInvocationExpression i : is) {
+ System.out.println(i);
+ }
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELComplexExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELComplexExpressionImpl.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELComplexExpressionImpl.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.model;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELObjectType;
import org.jboss.tools.common.el.core.parser.LexicalToken;
import org.jboss.tools.common.el.internal.core.parser.token.ExprEndTokenDescription;
@@ -89,4 +92,9 @@
return ELObjectType.EL_COMPLEX_EXPRESSION;
}
+ public void collectInvocations(List<ELInvocationExpression> list) {
+ if(expression != null) {
+ expression.collectInvocations(list);
+ }
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELExpressionImpl.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELExpressionImpl.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -10,7 +10,11 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.model;
+import java.util.ArrayList;
+import java.util.List;
+
import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
/**
*
@@ -21,4 +25,13 @@
public ELExpressionImpl() {}
+ public List<ELInvocationExpression> getInvocations() {
+ List<ELInvocationExpression> list = new ArrayList<ELInvocationExpression>();
+ collectInvocations(list);
+ return list;
+ }
+
+ public void collectInvocations(List<ELInvocationExpression> list) {
+ }
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInvocationExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInvocationExpressionImpl.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInvocationExpressionImpl.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.model;
+import java.util.List;
+
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELObject;
/**
*
@@ -34,6 +37,11 @@
if(left != null) {
left.setParent(this);
setFirstToken(left.getFirstToken());
+ ELObject p = parent;
+ while(p instanceof ELInvocationExpressionImpl) {
+ ((ELInvocationExpressionImpl)p).setFirstToken(firstToken);
+ p = p.getParent();
+ }
}
}
@@ -41,4 +49,8 @@
return left != null ? left.toString() : "";
}
+ public void collectInvocations(List<ELInvocationExpression> list) {
+ list.add(this);
+ //We do not need left part expression, it is part of this invocation
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMethodInvocationImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMethodInvocationImpl.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMethodInvocationImpl.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -10,6 +10,10 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.model;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELMethodInvocation;
import org.jboss.tools.common.el.core.model.ELObjectType;
@@ -49,4 +53,13 @@
return ELObjectType.EL_METHOD_INVOCATION;
}
+ public void collectInvocations(List<ELInvocationExpression> list) {
+ super.collectInvocations(list);
+ if(parameters != null) {
+ List<ELExpression> ps = parameters.getParameters();
+ for (ELExpression expr: ps) {
+ ((ELExpressionImpl)expr).collectInvocations(list);
+ }
+ }
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMultiExpressionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMultiExpressionImpl.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELMultiExpressionImpl.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELObject;
import org.jboss.tools.common.el.core.model.ELObjectType;
@@ -77,4 +78,10 @@
return ELObjectType.EL_MULTI_EXPRESSION;
}
+ public void collectInvocations(List<ELInvocationExpression> list) {
+ for (ELExpressionImpl expr: expressions) {
+ expr.collectInvocations(list);
+ }
+ }
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELPropertyInvocationImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELPropertyInvocationImpl.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELPropertyInvocationImpl.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -40,6 +40,7 @@
this.name = name;
if(name != null) {
if(left == null) setFirstToken(name);
+ setLastToken(name);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -181,8 +181,8 @@
case ParamStartTokenDescription.PARAM_START:
ELParametersImpl params = readParameters();
ELMethodInvocationImpl method = new ELMethodInvocationImpl();
+ method.setName(name.getName());
method.setParameters(params);
- method.setName(name.getName());
result = method;
}
if(current.getType() == DotTokenDescription.DOT) {
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -75,12 +75,12 @@
case STATE_EXPECTING_EXPRESSION:
return new int[] {
WhiteSpaceTokenDescription.WHITESPACE,
+ UnaryTokenDescription.UNARY,
EndELTokenDescription.END_EL,
PrimitiveValueTokenDescription.PRIMITIVE_VALUE,
JavaNameTokenDescription.JAVA_NAME,
StringTokenDescription.STRING,
ExprStartTokenDescription.EXPR_START,
- UnaryTokenDescription.UNARY,
};
case STATE_EXPECTING_NAME:
return new int[] {
@@ -90,20 +90,20 @@
case STATE_EXPECTING_PARAM:
return new int[] {
WhiteSpaceTokenDescription.WHITESPACE,
+ UnaryTokenDescription.UNARY,
PrimitiveValueTokenDescription.PRIMITIVE_VALUE,
JavaNameTokenDescription.JAVA_NAME,
StringTokenDescription.STRING,
ExprStartTokenDescription.EXPR_START,
- UnaryTokenDescription.UNARY,
ParamEndTokenDescription.PARAM_END
};
case STATE_EXPECTING_OPERAND:
return new int[] {
WhiteSpaceTokenDescription.WHITESPACE,
+ UnaryTokenDescription.UNARY,
PrimitiveValueTokenDescription.PRIMITIVE_VALUE,
StringTokenDescription.STRING,
ExprStartTokenDescription.EXPR_START,
- UnaryTokenDescription.UNARY,
JavaNameTokenDescription.JAVA_NAME,
};
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -56,7 +56,8 @@
if(end < 0) return false;
char ch = tokenizer.lookUpChar(end);
if(Character.isWhitespace(ch) || ch == '\0' || ch == '('
- || (canBeFollowedByOperand && Character.isJavaIdentifierPart(ch))) {
+ || (canBeFollowedByOperand && Character.isJavaIdentifierPart(ch)
+ || ch == '\'' || ch == '"' || ch == '-')) {
return true;
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/UnaryTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/UnaryTokenDescription.java 2008-09-24 13:08:51 UTC (rev 10447)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/UnaryTokenDescription.java 2008-09-24 13:24:20 UTC (rev 10448)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.token;
+import org.jboss.tools.common.el.core.parser.Tokenizer;
+
/**
*
* @author V. Kabanovich
@@ -20,6 +22,10 @@
public static UnaryTokenDescription INSTANCE = new UnaryTokenDescription();
+ private static final String[] OPS_2 = {
+ "not",
+ };
+
public UnaryTokenDescription() {
super("!", UNARY);
addContent("--");
@@ -28,4 +34,38 @@
addContent("-");
}
+ public boolean isStart(Tokenizer tokenizer, int offset) {
+ if(super.isStart(tokenizer, offset)) {
+ return true;
+ }
+ int end = -1;
+ for (int i = 0; end < 0 && i < OPS_2.length; i++) {
+ if(tokenizer.startsWith(OPS_2[i])) {
+ end = offset + OPS_2[i].length();
+ }
+ }
+ if(end < 0) return false;
+ char ch = tokenizer.lookUpChar(end);
+ if(Character.isWhitespace(ch) || ch == '\0' || ch == '('
+ ) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean read(Tokenizer tokenizer, int offset) {
+ if(super.isStart(tokenizer, offset)) {
+ return super.read(tokenizer, offset);
+ }
+ int end = -1;
+ for (int i = 0; end < 0 && i < OPS_2.length; i++) {
+ if(tokenizer.startsWith(OPS_2[i])) {
+ end = offset + OPS_2[i].length();
+ }
+ }
+ tokenizer.addToken(getType(), offset, end);
+ return true;
+ }
+
}
16 years, 3 months
JBoss Tools SVN: r10447 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-09-24 09:08:51 -0400 (Wed, 24 Sep 2008)
New Revision: 10447
Added:
trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-134 - adding FAQ;
Added: trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml (rev 0)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml 2008-09-24 13:08:51 UTC (rev 10447)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<chapter id="gsg_faq" xreflabel="gsg_faq" role="new">
+ <?dbhtml filename="gsg_faq.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Developer Studio</keyword>
+ <keyword>Eclipse</keyword>
+ <keyword>Java</keyword>
+ <keyword>JBoss</keyword>
+ </keywordset>
+ </chapterinfo>
+ <title>FAQ</title>
+
+ <para>For more information on <property>JBoss Developer Studio</property> features, refer to the following
+ FAQ to get the answers on the most "popular" questions.</para>
+
+ <section id="question1">
+ <title>How to get Code Assist for Seam specific resources in an externally
+ generated project?</title>
+
+ <para>To get Code Assist for Seam specific resources in an externally generated project, you
+ should enable Seam features in Project Preferences. Right click an imported project and
+ navigate <emphasis>
+ <property>Properties > Seam Settings</property>.</emphasis> Check <emphasis>
+ <property>Seam support</property></emphasis> box to enable
+ all available <ulink url="&seamlink;#project_pref">Seam Settings</ulink>.</para>
+ </section>
+
+ <section id="question2">
+ <title>How to import an example Seam project from jboss-eap
+ directory?</title>
+
+ <para>To import an example Seam project from <emphasis>
+ <property>jboss-eap</property>
+ </emphasis> into your working directory, you should perform the following steps:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Go to <emphasis>
+ <property>New > Other > Java Project from Existing Buildfile</property>
+ </emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>Point to the <emphasis>
+ <property>build.xml</property>
+ </emphasis> of any chosen project by pressing <emphasis>
+ <property>Browse</property>
+ </emphasis> button</para>
+ </listitem>
+
+ <listitem>
+ <para>Hit <emphasis>
+ <property>Finish</property>
+ </emphasis> to open the project</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>As these seam examples are non WTP projects, next you should enable Seam support for them.
+ To do that, right click the project and go to <emphasis>
+ <property>Properties > Seam Settings</property>.</emphasis></para>
+ </section>
+
+</chapter>
\ No newline at end of file
16 years, 3 months
JBoss Tools SVN: r10446 - trunk/documentation/guides/GettingStartedGuide/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-09-24 09:08:13 -0400 (Wed, 24 Sep 2008)
New Revision: 10446
Modified:
trunk/documentation/guides/GettingStartedGuide/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-134 - adding FAQ;
Modified: trunk/documentation/guides/GettingStartedGuide/en/master.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/master.xml 2008-09-24 12:11:46 UTC (rev 10445)
+++ trunk/documentation/guides/GettingStartedGuide/en/master.xml 2008-09-24 13:08:13 UTC (rev 10446)
@@ -7,6 +7,7 @@
<!ENTITY first_seam SYSTEM "modules/first_seam.xml">
<!ENTITY jsp_application SYSTEM "modules/jsp_application.xml">
<!ENTITY rad_jsf_application SYSTEM "modules/rad_jsf_application.xml">
+<!ENTITY gsg_faq SYSTEM "modules/gsg_faq.xml">
<!ENTITY further_reading SYSTEM "modules/further_reading.xml">
<!ENTITY seamlink "../../seam/html_single/index.html">
@@ -52,6 +53,8 @@
&first_seam;
&jsp_application;
&rad_jsf_application;
+ &gsg_faq;
&further_reading;
+
</book>
16 years, 3 months
JBoss Tools SVN: r10445 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-09-24 08:11:46 -0400 (Wed, 24 Sep 2008)
New Revision: 10445
Modified:
trunk/seam/docs/reference/en/modules/seam_editors.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-240 - adding note;
Modified: trunk/seam/docs/reference/en/modules/seam_editors.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_editors.xml 2008-09-24 11:55:52 UTC (rev 10444)
+++ trunk/seam/docs/reference/en/modules/seam_editors.xml 2008-09-24 12:11:46 UTC (rev 10445)
@@ -6,117 +6,143 @@
<keyword>JBoss Tools</keyword>
<keyword>Seam</keyword>
<keyword>JBDS</keyword>
- </keywordset>
+ </keywordset>
</chapterinfo>
-
+
<title>Seam Editors Features</title>
-
+
<section id="ContentAssist">
-
+
<title>Content Assist</title>
-
- <para>In this chapter you know what are Seam Editors Features and how to work with them. </para>
- <para><property>Content Assist</property> (ctrl + space) is available when using expression language in:</para>
+
+ <para>In this chapter you know what Seam Editors Features are and how to work with them. </para>
+ <para><property>Content Assist</property> (ctrl + space) is available when using expression
+ language in:</para>
<itemizedlist>
- <listitem><para>JSP</para></listitem>
- <listitem><para>XHTML</para></listitem>
- <listitem><para>XML</para></listitem>
- <listitem><para>JAVA</para></listitem>
+ <listitem>
+ <para>JSP</para>
+ </listitem>
+ <listitem>
+ <para>XHTML</para>
+ </listitem>
+ <listitem>
+ <para>XML</para>
+ </listitem>
+ <listitem>
+ <para>JAVA</para>
+ </listitem>
</itemizedlist>
-
- <para>The Seam components are available in content assist.</para>
-
+
+ <para>The Seam components are available in content assist.</para>
+
<figure>
<title>Content Assist</title>
- <mediaobject>
+ <mediaobject>
<imageobject>
<imagedata fileref="images/seam_editors/seam_editors_1.png" scale="70"/>
</imageobject>
</mediaobject>
</figure>
-
+
+ <note>
+ <title>Note:</title>
+
+ <para>To get Code Assist available for an externally generated and imported project, don't forget to enable Seam
+ features and configure Seam Settings in <link linkend="project_pref">Project Preferences</link>.</para>
+ </note>
</section>
-
+
<section id="OpenOn">
<title>OpenOn</title>
-
- <para><property>OpenOn</property> let's you easily navigate through your project without using the Package Explorer or Project Explorer.
- After pressing ctrl + left click (or just F3) you will see a corresponding method or class.</para>
-
+
+ <para><property>OpenOn</property> let's you easily navigate through your project without
+ using the Package Explorer or Project Explorer. After pressing ctrl + left click (or
+ just F3) you will see a corresponding method or class.</para>
+
<figure>
<title>OpenOn</title>
- <mediaobject>
+ <mediaobject>
<imageobject>
<imagedata fileref="images/seam_editors/seam_editors_2.png"/>
</imageobject>
</mediaobject>
</figure>
-
+
</section>
-
+
<section id="SeamValidation">
<title>Seam Validation</title>
-
- <para>Validation of various possible problematic definitions is implemented for Seam applications.</para>
-
- <para>If an issue is found it will be showed in the standard <property>Problems View</property>.</para>
-
+
+ <para>Validation of various possible problematic definitions is implemented for Seam
+ applications.</para>
+
+ <para>If an issue is found it will be showed in the standard <property>Problems
+ View</property>.</para>
+
<figure>
<title>Seam Validation</title>
- <mediaobject>
+ <mediaobject>
<imageobject>
<imagedata fileref="images/seam_editors/seam_editors_6.png" scale="70"/>
</imageobject>
</mediaobject>
</figure>
-
-
- <para>In the preferences page for Seam Validator you can see and modify the validator behavior. Go to <emphasis><property>Window > Preferences > JBoss Tools > Web > Seam > Validator</property></emphasis>
- and select the severity level for the optional Seam Validator problem.</para>
-
+
+
+ <para>In the preferences page for Seam Validator you can see and modify the validator
+ behavior. Go to <emphasis>
+ <property>Window > Preferences > JBoss Tools > Web > Seam > Validator</property>
+ </emphasis> and select the severity level for the optional Seam Validator problem.</para>
+
<figure>
<title>Seam Validator Preferences</title>
- <mediaobject>
+ <mediaobject>
<imageobject>
<imagedata fileref="images/seam_editors/seam_editors_3.png"/>
</imageobject>
</mediaobject>
</figure>
-
- <para>On WTP projects validation are enabled by default and thus executed automatically, but on normal Java projects you will have to go and add the Validation builder to your project .
- It is available in the properties of your project under <property>Validation</property>. The validations can be run manually by clicking <property>Validate</property> via the context menu
- on your project which will execute all the active WTP validations.</para>
+
+ <para>On WTP projects validation are enabled by default and thus executed automatically, but
+ on normal Java projects you will have to go and add the Validation builder to your
+ project . It is available in the properties of your project under
+ <property>Validation</property>. The validations can be run manually by clicking
+ <property>Validate</property> via the context menu on your project which will
+ execute all the active WTP validations.</para>
</section>
-
- <section id="ComponentsEditor" revisionflag="changed">
+
+ <section id="ComponentsEditor" revisionflag="changed">
<title>Structured components.xml Editor</title>
-
- <para>When editing <property>components.xml</property> a structured tree editor is available in addition to pure source editing.
- It has a graphical view (Tree tab) and source (Source tab).</para>
-
+
+ <para>When editing <property>components.xml</property> a structured tree editor is available
+ in addition to pure source editing. It has a graphical view (Tree tab) and source
+ (Source tab).</para>
+
<figure>
<title>component.xml Editor</title>
- <mediaobject>
+ <mediaobject>
<imageobject>
<imagedata fileref="images/seam_editors/seam_editors_4.png"/>
</imageobject>
</mediaobject>
</figure>
-
- <note>
- <title>Note:</title>
-
- <para>You can view and edit <property>components.xml</property> and other xml files directly in the Project Explorer and Properties sheet without opening the components.xml editor.</para>
- </note>
+
+ <note>
+ <title>Note:</title>
+
+ <para>You can view and edit <property>components.xml</property> and other xml files
+ directly in the Project Explorer and Properties sheet without opening the
+ components.xml editor.</para>
+ </note>
<figure>
<title>component.xml Editor</title>
- <mediaobject>
+ <mediaobject>
<imageobject>
<imagedata fileref="images/seam_editors/seam_editors_5.png"/>
</imageobject>
</mediaobject>
</figure>
-
+
</section>
-
- </chapter>
+
+</chapter>
16 years, 3 months
JBoss Tools SVN: r10444 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-24 07:55:52 -0400 (Wed, 24 Sep 2008)
New Revision: 10444
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
transfer some code because was broken hot keys handling
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-09-24 09:01:53 UTC (rev 10443)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-09-24 11:55:52 UTC (rev 10444)
@@ -1306,6 +1306,10 @@
*/
if (!keyBindingPressed) {
if (keyEventHandler.handleKeyPress(keyEvent)) {
+ /*
+ * JBIDE-2670
+ */
+ keyEvent.stopPropagation();
switcher
.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL);
try {
@@ -1320,10 +1324,6 @@
}
}
- /*
- * JBIDE-2670
- */
- keyEvent.stopPropagation();
}
public void elementResized(nsIDOMElement element, int resizerConstrains,
16 years, 3 months
JBoss Tools SVN: r10443 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-24 05:01:53 -0400 (Wed, 24 Sep 2008)
New Revision: 10443
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xsd/ui/XSDStructuredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
Log:
finish the XML2JavaAnalyzer
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Properties;
import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.core.IJavaProject;
@@ -31,6 +32,8 @@
JavaBeanConfigWizardPage page = null;
IJavaProject project = null;
Object result = null;
+
+ Properties properties = new Properties();
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
@@ -74,4 +77,8 @@
return JavaBeanActivator.DATA_TYPE_ID_JAVABEAN;
}
+ public Properties getProperties() {
+ return this.properties;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.smooks.ui;
+import java.util.Properties;
+
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
@@ -26,4 +28,6 @@
public String getInputDataTypeID();
+ public Properties getProperties();
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -109,6 +109,8 @@
import org.jboss.tools.smooks.graphical.GraphInformations;
import org.jboss.tools.smooks.graphical.GraphicalPackage;
import org.jboss.tools.smooks.graphical.MappingDataType;
+import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
import org.jboss.tools.smooks.graphical.util.GraphicalInformationSaver;
import org.jboss.tools.smooks.model.DocumentRoot;
import org.jboss.tools.smooks.model.ResourceConfigType;
@@ -565,44 +567,44 @@
createGraphModels(items, SourceModel.class);
}
-
- private void disConnectGraphModel(Class clazz,TreeItemRelationModel model){
- if(clazz == SourceModel.class){
+ private void disConnectGraphModel(Class clazz, TreeItemRelationModel model) {
+ if (clazz == SourceModel.class) {
List list = model.getModelSourceConnections();
List temp = new ArrayList(list);
for (Iterator iterator = temp.iterator(); iterator.hasNext();) {
- LineConnectionModel line = (LineConnectionModel) iterator.next();
+ LineConnectionModel line = (LineConnectionModel) iterator
+ .next();
line.disConnect();
}
temp.clear();
}
-
- if(clazz == TargetModel.class){
+
+ if (clazz == TargetModel.class) {
List list = model.getModelTargetConnections();
List temp = new ArrayList(list);
for (Iterator iterator = temp.iterator(); iterator.hasNext();) {
- LineConnectionModel line = (LineConnectionModel) iterator.next();
+ LineConnectionModel line = (LineConnectionModel) iterator
+ .next();
line.disConnect();
}
temp.clear();
}
}
-
+
private void clearExsitingGraphModels(Class<? extends Object> clazz) {
- if(rootModel != null){
+ if (rootModel != null) {
List children = rootModel.getChildren();
List removeList = new ArrayList();
for (Iterator iterator = children.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
- if(object.getClass() == clazz){
+ if (object.getClass() == clazz) {
removeList.add(object);
- disConnectGraphModel(clazz,(TreeItemRelationModel)object);
+ disConnectGraphModel(clazz, (TreeItemRelationModel) object);
}
}
rootModel.removeChildrenList(removeList);
}
}
-
protected void createTargetGraphModels() {
Tree tree = targetViewer.getTree();
@@ -699,7 +701,8 @@
context.setTargetDataTypeID(this.targetDataTypeID);
context.setSmooksType(SmooksModelConstants.SAX);
context.setDataMappingRootModel(this.rootModel);
- context.setSmooksConfigFile(((IFileEditorInput)getEditorInput()).getFile());
+ context.setSmooksConfigFile(((IFileEditorInput) getEditorInput())
+ .getFile());
}
protected Composite createUISectionContainer(Composite parent, int columns) {
@@ -888,6 +891,8 @@
try {
graph = graphicalInformationSaver.doLoad();
initFormEditorWithGraphInfo(graph);
+ initSmooksContext(graph, this
+ .getSmooksConfigurationFileGenerateContext());
} catch (Throwable t) {
// ignore
t.printStackTrace();
@@ -915,6 +920,21 @@
}
}
+ protected void initSmooksContext(GraphInformations graph,
+ SmooksConfigurationFileGenerateContext context) {
+ Params params = graph.getParams();
+ if (params != null) {
+ List list = params.getParam();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ Param p = (Param) iterator.next();
+ String name = p.getName();
+ String value = p.getValue();
+ if (name != null && value != null)
+ context.putProperty(name, value);
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -959,6 +979,8 @@
if (dialog.open() == WizardDialog.OK) {
IStrucutredDataCreationWizard cw = dialog
.getCurrentCreationWizard();
+ this.getSmooksConfigurationFileGenerateContext().addProperties(
+ cw.getProperties());
String typeID = cw.getInputDataTypeID();
if (UIUtils.setTheProvidersForTreeViewer(viewer, typeID)) {
if (viewer.getInput() != null) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.ui.modelparser;
import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
@@ -134,4 +135,13 @@
return properties;
}
+ public void addProperties(Properties properties){
+ if(properties == null) return;
+ Enumeration keys = properties.keys();
+ while(keys.hasMoreElements()){
+ Object key = keys.nextElement();
+ this.properties.put(key, properties.get(key));
+ }
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -60,6 +60,10 @@
public Object getReturnValue() {
return returnObject;
}
+
+ public String getFilePath(){
+ return fileText.getText();
+ }
/*
* (non-Javadoc)
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -14,8 +14,8 @@
*/
public abstract class AbstractStructuredDdataWizard extends Wizard implements
IStrucutredDataCreationWizard {
- AbstractFileSelectionWizardPage page = null;
- Object xsdElement = null;
+ protected AbstractFileSelectionWizardPage page = null;
+ protected Object xsdElement = null;
/**
*
*/
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.smooks.xml.ui;
+import java.util.Properties;
+
import org.jboss.tools.smooks.xml.AbstractFileSelectionWizardPage;
import org.jboss.tools.smooks.xml.AbstractStructuredDdataWizard;
import org.jboss.tools.smooks.xml.XmlActivator;
@@ -18,18 +20,34 @@
* @author Dart Peng
* @Date Aug 18, 2008
*/
-public class XMLStructuredDataWizard extends AbstractStructuredDdataWizard{
+public class XMLStructuredDataWizard extends AbstractStructuredDdataWizard {
+ Properties properties = new Properties();
+ String filePath = null;
+ public static final String XML_FILE = "xmlFile";
+
@Override
protected AbstractFileSelectionWizardPage createAbstractFileSelectionWizardPage() {
return new XMLStructuredDataWizardPage("XML");
}
- /* (non-Javadoc)
+ public boolean performFinish() {
+ filePath = page.getFilePath();
+ properties.put(XML_FILE, filePath);
+ return super.performFinish();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard#getInputDataTypeID()
*/
public String getInputDataTypeID() {
return XmlActivator.TYPE_ID_XML;
}
-
+
+ public Properties getProperties() {
+ return properties;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xsd/ui/XSDStructuredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xsd/ui/XSDStructuredDataWizard.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xsd/ui/XSDStructuredDataWizard.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.smooks.xsd.ui;
+import java.util.Properties;
+
import org.jboss.tools.smooks.xml.AbstractFileSelectionWizardPage;
import org.jboss.tools.smooks.xml.AbstractStructuredDdataWizard;
import org.jboss.tools.smooks.xml.XmlActivator;
@@ -19,7 +21,7 @@
* @Date Aug 18, 2008
*/
public class XSDStructuredDataWizard extends AbstractStructuredDdataWizard {
-
+ Properties properties = new Properties();
/* (non-Javadoc)
* @see org.jboss.tools.smooks.xml.AbstractStructuredDdataWizard#createAbstractFileSelectionWizardPage()
*/
@@ -34,5 +36,8 @@
public String getInputDataTypeID() {
return XmlActivator.TYPE_ID_XSD;
}
+ public Properties getProperties() {
+ return this.properties;
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-09-24 08:31:36 UTC (rev 10442)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-09-24 09:01:53 UTC (rev 10443)
@@ -57,10 +57,6 @@
SmooksConfigurationFileGenerateContext context)
throws SmooksAnalyzerException {
- String filePath = context.getSmooksConfigFile().getLocation()
- .toOSString();
- context.putProperty(XMLSourceModelAnalyzer.XML_FILE, filePath);
-
SmooksResourceListType listType = context.getSmooksResourceListModel();
GraphRootModel rootModel = context.getDataMappingRootModel();
List children = rootModel.getChildren();
@@ -339,6 +335,7 @@
String name = names[i].trim();
if (current instanceof TagObject && isXMLAttributeObject(name)) {
List properties = ((TagObject) current).getProperties();
+ name = name.substring(1);
for (Iterator iterator = properties.iterator(); iterator
.hasNext();) {
TagPropertyObject property = (TagPropertyObject) iterator
16 years, 3 months
JBoss Tools SVN: r10442 - in trunk/common/plugins: org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-09-24 04:31:36 -0400 (Wed, 24 Sep 2008)
New Revision: 10442
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Activator.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReferenceList.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgEndTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/Activator.java
Log:
Added Copyright to some new classes.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Activator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Activator.java 2008-09-24 06:54:26 UTC (rev 10441)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Activator.java 2008-09-24 08:31:36 UTC (rev 10442)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.common.el.core;
import org.eclipse.ui.plugin.AbstractUIPlugin;
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReferenceList.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReferenceList.java 2008-09-24 06:54:26 UTC (rev 10441)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReferenceList.java 2008-09-24 08:31:36 UTC (rev 10442)
@@ -1,10 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.common.el.core;
-
import org.eclipse.core.runtime.QualifiedName;
import org.jboss.tools.common.resref.core.ResourceReferenceList;
-
/**
* The Class ELReferenceList.
*/
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgEndTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgEndTokenDescription.java 2008-09-24 06:54:26 UTC (rev 10441)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/ArgEndTokenDescription.java 2008-09-24 08:31:36 UTC (rev 10442)
@@ -9,6 +9,16 @@
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.token;
+/*******************************************************************************
+ * Copyright (c) 2008 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
+ ******************************************************************************/
import org.jboss.tools.common.el.core.parser.Tokenizer;
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/Activator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/Activator.java 2008-09-24 06:54:26 UTC (rev 10441)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/Activator.java 2008-09-24 08:31:36 UTC (rev 10442)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.common.el.ui;
import org.eclipse.ui.plugin.AbstractUIPlugin;
16 years, 3 months
JBoss Tools SVN: r10441 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-24 02:54:26 -0400 (Wed, 24 Sep 2008)
New Revision: 10441
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AbstractAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataContentProvider.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
Log:
finish the XML2JavaAnalyzer!!!
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-09-23 23:39:16 UTC (rev 10440)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-09-24 06:54:26 UTC (rev 10441)
@@ -438,7 +438,7 @@
continue;
if (isReferenceSelector(selector)) {
ResourceConfigType rc = this
- .findResourceCinfigTypeWithSelector(selector,
+ .findResourceConfigTypeWithSelector(selector,
resourceList);
if (rc != null) {
String newSelector = rc.getSelector();
@@ -663,9 +663,9 @@
model.setError("don't exist");
}
- if (selector.startsWith("${") && selector.endsWith("}")) {
+ if (isReferenceSelector(selector)) {
selector = selector.substring(2, selector.length() - 1);
- ResourceConfigType resourceConfig = findResourceCinfigTypeWithSelector(
+ ResourceConfigType resourceConfig = findResourceConfigTypeWithSelector(
selector, listType);
if (resourceConfig != null) {
this.buildChildrenOfTargetInputModel(listType, model, false,
@@ -712,7 +712,7 @@
}
}
- protected ResourceConfigType findResourceCinfigTypeWithSelector(
+ protected ResourceConfigType findResourceConfigTypeWithSelector(
String selector, SmooksResourceListType listType) {
if (isReferenceSelector(selector)) {
selector = this.getBeanIdWithRawSelectorString(selector);
@@ -740,7 +740,7 @@
// memory out???
currentModel.getProperties();
selector = this.getBeanIdWithRawSelectorString(selector);
- ResourceConfigType resourceConfig = findResourceCinfigTypeWithSelector(
+ ResourceConfigType resourceConfig = findResourceConfigTypeWithSelector(
selector, listType);
if (resourceConfig != null) {
String referenceSelector = resourceConfig.getSelector();
@@ -825,7 +825,7 @@
* @param parentModel
* @return
*/
- protected JavaBeanModel findTheChildJavaBeanModel(String name,
+ public static JavaBeanModel findTheChildJavaBeanModel(String name,
JavaBeanModel parentModel) {
List list = parentModel.getProperties();
if (list == null)
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AbstractAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AbstractAnalyzer.java 2008-09-23 23:39:16 UTC (rev 10440)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AbstractAnalyzer.java 2008-09-24 06:54:26 UTC (rev 10441)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.emf.common.command.BasicCommandStack;
@@ -38,8 +39,9 @@
protected List usedConnectionList = new ArrayList();
protected AdapterFactoryEditingDomain editingDomain;
protected ComposedAdapterFactory adapterFactory;
-
+ private HashMap<String, Object> userdResourceTypeMap;
public AbstractAnalyzer() {
+ userdResourceTypeMap = new HashMap<String, Object>();
adapterFactory = new ComposedAdapterFactory(
ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
@@ -68,6 +70,16 @@
usedConnectionList.clear();
}
+
+ protected void setSelectorIsUsed(String selector) {
+ userdResourceTypeMap.put(selector, new Object());
+ }
+
+
+ protected boolean isSelectorIsUsed(String resourceType) {
+ return (userdResourceTypeMap.get(resourceType) != null);
+ }
+
protected void addResourceConfigType(SmooksResourceListType resourceList,
ResourceConfigType resourceConfig) {
Command addResourceConfigCommand = AddCommand.create(
@@ -88,7 +100,50 @@
resourceConfigType.getParam().add(paramType);
return paramType;
}
+
+
+ protected String getBeanIDFromParam(ResourceConfigType config) {
+ List list = config.getParam();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ ParamType p = (ParamType) iterator.next();
+ if ("beanId".equals(p.getName())) {
+ return SmooksModelUtils.getAnyTypeText(p);
+ }
+ }
+ return null;
+ }
+
+ protected String getBeanIdWithRawSelectorString(String selector) {
+ selector = selector.substring(2, selector.length() - 1);
+ return selector;
+ }
+
+ protected boolean isReferenceSelector(String selector) {
+ return (selector.startsWith("${") && selector.endsWith("}"));
+ }
+
+
+ protected ResourceConfigType findResourceConfigTypeWithSelector(
+ String selector, SmooksResourceListType listType) {
+ if (isReferenceSelector(selector)) {
+ selector = this.getBeanIdWithRawSelectorString(selector);
+ }
+ List rl = listType.getAbstractResourceConfig();
+ ResourceConfigType resourceConfig = null;
+ for (Iterator iterator = rl.iterator(); iterator.hasNext();) {
+ ResourceConfigType rct = (ResourceConfigType) iterator.next();
+ if (this.isSelectorIsUsed(rct.getSelector()))
+ continue;
+ String beanId = getBeanIDFromParam(rct);
+ if (selector.equals(beanId)) {
+ resourceConfig = rct;
+ break;
+ }
+ }
+ return resourceConfig;
+ }
+
/**
* @return the editingDomain
*/
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataContentProvider.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataContentProvider.java 2008-09-23 23:39:16 UTC (rev 10440)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataContentProvider.java 2008-09-24 06:54:26 UTC (rev 10441)
@@ -15,6 +15,7 @@
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
import org.jboss.tools.smooks.xml.model.DocumentObject;
import org.jboss.tools.smooks.xml.model.TagObject;
@@ -50,7 +51,9 @@
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object )
*/
public Object getParent(Object arg0) {
- // if(arg0 instanceof)
+ if(arg0 instanceof AbstractXMLObject){
+ return ((AbstractXMLObject)arg0).getParent();
+ }
return null;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-09-23 23:39:16 UTC (rev 10440)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-09-24 06:54:26 UTC (rev 10441)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.smooks.xml2java.analyzer;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -20,6 +21,7 @@
import org.jboss.tools.smooks.analyzer.MappingModel;
import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
+import org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
import org.jboss.tools.smooks.model.ParamType;
import org.jboss.tools.smooks.model.ResourceConfigType;
@@ -208,25 +210,22 @@
|| !(targetObject instanceof JavaBeanModel)) {
return MappingResourceConfigList.createEmptyList();
}
-
AbstractXMLObject sourceRoot = (AbstractXMLObject) sourceObject;
JavaBeanModel sourceTarget = (JavaBeanModel) targetObject;
ResourceConfigType rootResourceConfig = findFirstMappingResourceConfig(listType);
- String selector = rootResourceConfig.getSelector();
- AbstractXMLObject source = findXMLObjectBySelector(selector, sourceRoot);
+ String xmlName = rootResourceConfig.getSelector();
+ AbstractXMLObject source = findXMLObjectByName(xmlName, sourceRoot);
if (source == null)
return MappingResourceConfigList.createEmptyList();
MappingResourceConfigList rcl = new MappingResourceConfigList();
- MappingModel mapping = new MappingModel(source, sourceTarget);
- rcl.getMappingModelList().add(mapping);
- rcl.addResourceConfig(rootResourceConfig);
-
- return null;
+ this.createMappingResourceConfigList(rcl, listType, rootResourceConfig,
+ source, sourceTarget);
+ return rcl;
}
- private AbstractXMLObject findXMLObjectBySelector(String selector,
+ public static AbstractXMLObject findXMLObjectByName(String selector,
AbstractXMLObject root) {
if (selector == null)
return null;
@@ -244,7 +243,7 @@
for (Iterator iterator = tags.iterator(); iterator.hasNext();) {
AbstractXMLObject tagChild = (AbstractXMLObject) iterator
.next();
- AbstractXMLObject result = findXMLObjectBySelector(selector,
+ AbstractXMLObject result = findXMLObjectByName(selector,
tagChild);
if (result != null)
return result;
@@ -257,12 +256,18 @@
protected void createMappingResourceConfigList(
MappingResourceConfigList configList, SmooksResourceListType list,
ResourceConfigType config, AbstractXMLObject sourceRoot,
- JavaBeanModel targetRoot) {
+ JavaBeanModel targetJavaBean) {
String selector = config.getSelector();
String beanID = SmooksModelUtils.getParmaText(
SmooksModelConstants.BEAN_ID, config);
String beanClass = SmooksModelUtils.getParmaText(
SmooksModelConstants.BEAN_CLASS, config);
+
+ MappingModel mapping = new MappingModel(sourceRoot, targetJavaBean);
+ configList.getMappingModelList().add(mapping);
+ configList.addResourceConfig(config);
+ this.setSelectorIsUsed(config.getSelector());
+
List<ParamType> paramList = config.getParam();
ParamType bindingParam = null;
for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
@@ -280,20 +285,91 @@
if (bindings != null) {
for (Iterator iterator = bindings.iterator(); iterator
.hasNext();) {
+ AnyType binding = (AnyType) iterator.next();
String property = SmooksModelUtils
- .getAttributeValueFromAnyType((AnyType) iterator
- .next(),
+ .getAttributeValueFromAnyType(binding,
SmooksModelUtils.ATTRIBUTE_PROPERTY);
String selectorStr = SmooksModelUtils
- .getAttributeValueFromAnyType((AnyType) iterator
- .next(),
+ .getAttributeValueFromAnyType(binding,
SmooksModelUtils.ATTRIBUTE_SELECTOR);
+ JavaBeanModel childBean = JavaBeanAnalyzer
+ .findTheChildJavaBeanModel(property, targetJavaBean);
+ processXMLSelector(configList, config, sourceRoot,
+ childBean, list, selectorStr);
}
}
}
- AbstractXMLObject source = findXMLObjectBySelector(selector, sourceRoot);
}
+ protected void processXMLSelector(MappingResourceConfigList configList,
+ ResourceConfigType resourceConfig, AbstractXMLObject root,
+ JavaBeanModel targetBean, SmooksResourceListType listType,
+ String selector) {
+ if (isReferenceSelector(selector)) {
+ ResourceConfigType resourceConfig1 = this
+ .findResourceConfigTypeWithSelector(selector, listType);
+ String newSelector = resourceConfig1.getSelector();
+ if (newSelector == null)
+ return;
+ AbstractXMLObject newRoot = findXMLObjectByName(newSelector, root);
+ createMappingResourceConfigList(configList, listType,
+ resourceConfig1, newRoot, targetBean);
+ } else {
+ AbstractXMLObject source = findXMLObjectWithSelectorString(
+ selector, root);
+ if (source != null) {
+ MappingModel mapping = new MappingModel(source, targetBean);
+ configList.getMappingModelList().add(mapping);
+ configList.addResourceConfig(resourceConfig);
+ this.setSelectorIsUsed(selector);
+ }
+ }
+ }
+
+ public static AbstractXMLObject findXMLObjectWithSelectorString(
+ String selector, AbstractXMLObject parent) {
+ if (selector == null)
+ return null;
+ selector = selector.trim();
+ String[] names = selector.split(" ");
+ if (names == null)
+ return null;
+ AbstractXMLObject current = parent;
+ for (int i = 0; i < names.length; i++) {
+ String name = names[i].trim();
+ if (current instanceof TagObject && isXMLAttributeObject(name)) {
+ List properties = ((TagObject) current).getProperties();
+ for (Iterator iterator = properties.iterator(); iterator
+ .hasNext();) {
+ TagPropertyObject property = (TagPropertyObject) iterator
+ .next();
+ if (name.equals(property.getName())) {
+ current = property;
+ }
+ }
+ } else {
+ List list = parent.getChildren();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ AbstractXMLObject child = (AbstractXMLObject) iterator
+ .next();
+ if (name.equals(child.getName())) {
+ current = child;
+ break;
+ }
+ }
+ }
+ }
+ if (current == parent)
+ return null;
+ return current;
+ }
+
+ public static boolean isXMLAttributeObject(String name) {
+ if (name != null && name.startsWith("@"))
+ return true;
+ return false;
+ }
+
private ResourceConfigType findFirstMappingResourceConfig(
SmooksResourceListType listType) {
List list = listType.getAbstractResourceConfig();
16 years, 3 months
JBoss Tools SVN: r10440 - trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-09-23 19:39:16 -0400 (Tue, 23 Sep 2008)
New Revision: 10440
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java
Log:
ignore two system jobs "Usage Data Event consumer" and "Flush Cache Job"
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java 2008-09-23 23:36:58 UTC (rev 10439)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java 2008-09-23 23:39:16 UTC (rev 10440)
@@ -206,6 +206,7 @@
Job[] jobs= jobManager.find(null);
for (int i= 0; i < jobs.length; i++) {
Job job= jobs[i];
+ if ("Usage Data Event consumer".equals(job.getName()) || "Flush Cache Job".equals(job.getName())) continue;
int state= job.getState();
if (state == Job.RUNNING || state == Job.WAITING) {
Logger.global.finest(job.getName());
16 years, 3 months