JBoss Tools SVN: r38529 - in trunk/cdi: tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-02-08 21:06:21 -0500 (Wed, 08 Feb 2012)
New Revision: 38529
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/AnnotationType.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifierDeclaration.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/MemberValuePair.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/Method.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
Log:
Wizard 'Specify CDI Bean for the Injection Point' does not compute correctly condition 'can finish' https://issues.jboss.org/browse/JBIDE-10637
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java 2012-02-09 02:01:40 UTC (rev 38528)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java 2012-02-09 02:06:21 UTC (rev 38529)
@@ -22,13 +22,6 @@
import org.jboss.tools.cdi.core.IQualifierDeclaration;
public class ValuedQualifier{
- public static final int STATE_NONE = -1;
- public static final int STATE_NEW_QUALIFIER = 0;
- public static final int STATE_NEW_QUALIFIER_CHANGED_VALUE = 1;
- public static final int STATE_BEAN_QUALIFIER = 2;
- public static final int STATE_BEAN_QUALIFIER_CHANGED_VALUE = 3;
-
- private int state = STATE_NONE;
private IQualifier qualifier;
private List<Pair> pairs = new ArrayList<Pair>();
@@ -55,10 +48,8 @@
pair.type = Signature.getSignatureSimpleName(method.getReturnType());
pair.name = method.getElementName();
if(mvp != null && mvp.getValue() != null){
- pair.required = false;
pair.value = mvp.getValue();
}else{
- pair.required = true;
if(pair.type.equals("boolean")){
pair.value = "false";
}else if(pair.type.equals("int") || pair.type.equals("short") || pair.type.equals("long")){
@@ -98,10 +89,6 @@
return false;
}
- public int getState(){
- return state;
- }
-
public List<Pair> getValuePairs(){
return pairs;
}
@@ -182,8 +169,7 @@
return false;
}
- static class Pair{
- public boolean required;
+ private static class Pair{
public String type="";
public String name="";
public Object value;
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/AnnotationType.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/AnnotationType.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/AnnotationType.java 2012-02-09 02:06:21 UTC (rev 38529)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.cdi.ui.test.testmodel;
+
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.JavaModelException;
+
+/*
+Signature Java Type
+Z boolean
+B byte
+C char
+S short
+I int
+J long
+F float
+D double
+L fully-qualified-class ; fully-qualified-class
+[ type type[]
+( arg-types ) ret-type method type
+*/
+
+public class AnnotationType extends Type {
+ private static IMethod[] methods = new IMethod[]{
+ new Method("realChanky", "Z", null),
+ new Method("unrealChanky", "Z", new MemberValuePair("unrealChanky", true, IMemberValuePair.K_BOOLEAN)),
+ new Method("number", "I", null),
+ new Method("size", "I", new MemberValuePair("size", 125, IMemberValuePair.K_INT))
+ };
+
+ public AnnotationType(String qualifiedName) {
+ super(qualifiedName);
+ }
+
+ @Override
+ public boolean isAnnotation() throws JavaModelException {
+ return true;
+ }
+
+ @Override
+ public IMethod[] getMethods() throws JavaModelException {
+ return methods;
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/AnnotationType.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java 2012-02-09 02:01:40 UTC (rev 38528)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifier.java 2012-02-09 02:06:21 UTC (rev 38529)
@@ -28,7 +28,7 @@
public CDIQualifier(ICDIProject project, String qualifiedName){
this.project = project;
- this.cdiClass = new Type(qualifiedName);
+ this.cdiClass = new AnnotationType(qualifiedName);
}
@Override
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifierDeclaration.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifierDeclaration.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifierDeclaration.java 2012-02-09 02:06:21 UTC (rev 38529)
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.cdi.ui.test.testmodel;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
+import org.jboss.tools.common.java.IAnnotationType;
+
+public class CDIQualifierDeclaration implements IQualifierDeclaration {
+ static private IMemberValuePair[] pairs = new IMemberValuePair[]{
+ new MemberValuePair("name", "John", IMemberValuePair.K_STRING),
+ new MemberValuePair("size", 5, IMemberValuePair.K_INT),
+ new MemberValuePair("p", 0.5, IMemberValuePair.K_DOUBLE),
+ new MemberValuePair("char", 'Q', IMemberValuePair.K_CHAR),
+ };
+
+ public CDIQualifierDeclaration(){
+
+ }
+
+ @Override
+ public IMemberValuePair[] getMemberValuePairs() {
+ return pairs;
+ }
+
+ @Override
+ public Object getMemberValue(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IMember getParentMember() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getTypeName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IType getType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IAnnotationType getAnnotation() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IAnnotation getJavaAnnotation() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IResource getResource() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getStartPosition() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getLength() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public IMember getSourceMember() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaElement getSourceElement() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IQualifier getQualifier() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIQualifierDeclaration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/MemberValuePair.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/MemberValuePair.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/MemberValuePair.java 2012-02-09 02:06:21 UTC (rev 38529)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.cdi.ui.test.testmodel;
+
+import org.eclipse.jdt.core.IMemberValuePair;
+
+public class MemberValuePair implements IMemberValuePair {
+ private String memberName;
+ private Object value;
+ private int valueKind;
+
+ public MemberValuePair(String memberName, Object value, int valueKind){
+ this.memberName = memberName;
+ this.value = value;
+ this.valueKind = valueKind;
+ }
+
+ @Override
+ public String getMemberName() {
+ return memberName;
+ }
+
+ @Override
+ public Object getValue() {
+ return value;
+ }
+
+ @Override
+ public int getValueKind() {
+ return valueKind;
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/MemberValuePair.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/Method.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/Method.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/Method.java 2012-02-09 02:06:21 UTC (rev 38529)
@@ -0,0 +1,391 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.cdi.ui.test.testmodel;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IOpenable;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeParameter;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.JavaModelException;
+
+public class Method implements IMethod {
+
+ private IMemberValuePair defaultValue = null;
+ private String elementName = "";
+ private String returnType = "";
+
+ public Method(String elementName, String returnType, IMemberValuePair defaultValue){
+ this.elementName = elementName;
+ this.returnType = returnType;
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public String[] getCategories() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IClassFile getClassFile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ICompilationUnit getCompilationUnit() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IType getDeclaringType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getFlags() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public ISourceRange getJavadocRange() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getOccurrenceCount() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public ITypeRoot getTypeRoot() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IType getType(String name, int occurrenceCount) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isBinary() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean exists() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public IJavaElement getAncestor(int ancestorType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getAttachedJavadoc(IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IResource getCorrespondingResource() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getElementType() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public String getHandleIdentifier() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaModel getJavaModel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaProject getJavaProject() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IOpenable getOpenable() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaElement getParent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IPath getPath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IJavaElement getPrimaryElement() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IResource getResource() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ISchedulingRule getSchedulingRule() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IResource getUnderlyingResource() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStructureKnown() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getSource() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ISourceRange getSourceRange() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ISourceRange getNameRange() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void copy(IJavaElement container, IJavaElement sibling,
+ String rename, boolean replace, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void delete(boolean force, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void move(IJavaElement container, IJavaElement sibling,
+ String rename, boolean replace, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void rename(String name, boolean replace, IProgressMonitor monitor)
+ throws JavaModelException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public IJavaElement[] getChildren() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public IAnnotation getAnnotation(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IAnnotation[] getAnnotations() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IMemberValuePair getDefaultValue() throws JavaModelException {
+ return defaultValue;
+ }
+
+ @Override
+ public String getElementName() {
+ return elementName;
+ }
+
+ @Override
+ public String[] getExceptionTypes() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getTypeParameterSignatures() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeParameter[] getTypeParameters() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int getNumberOfParameters() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public ILocalVariable[] getParameters() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getKey() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getParameterNames() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getParameterTypes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getRawParameterNames() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getReturnType() throws JavaModelException {
+ return returnType;
+ }
+
+ @Override
+ public String getSignature() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ITypeParameter getTypeParameter(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isConstructor() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isMainMethod() throws JavaModelException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isResolved() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isSimilar(IMethod method) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/Method.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 2 months
JBoss Tools SVN: r38528 - workspace/dgolovin/new-releng/parent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-02-08 21:01:40 -0500 (Wed, 08 Feb 2012)
New Revision: 38528
Modified:
workspace/dgolovin/new-releng/parent/pom.xml
Log:
added linux gtk x86 packaging
Modified: workspace/dgolovin/new-releng/parent/pom.xml
===================================================================
--- workspace/dgolovin/new-releng/parent/pom.xml 2012-02-09 01:42:44 UTC (rev 38527)
+++ workspace/dgolovin/new-releng/parent/pom.xml 2012-02-09 02:01:40 UTC (rev 38528)
@@ -59,6 +59,11 @@
<environment>
<os>linux</os>
<ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
<arch>x86_64</arch>
</environment>
</environments>
14 years, 2 months
JBoss Tools SVN: r38527 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-02-08 20:42:44 -0500 (Wed, 08 Feb 2012)
New Revision: 38527
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
Log:
JBIDE-10791
https://issues.jboss.org/browse/JBIDE-10791
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2012-02-09 00:04:46 UTC (rev 38526)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2012-02-09 01:42:44 UTC (rev 38527)
@@ -626,7 +626,9 @@
if (p != null) {
n = p.getMemberName();
Object o = p.getValue();
- if(!values.containsKey(n)) {
+ // Default value can be null since JDT does not computes complex values
+ // E.g. values (char)7 or (2 + 3) will be resolved to null.
+ if(!values.containsKey(n) && o != null) {
values.put(n, o.toString());
}
}
14 years, 2 months
JBoss Tools SVN: r38526 - workspace/dgolovin/new-releng/parent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-02-08 19:04:46 -0500 (Wed, 08 Feb 2012)
New Revision: 38526
Modified:
workspace/dgolovin/new-releng/parent/pom.xml
Log:
Target platform updated to latest nightly SR2 nightly build
Modified: workspace/dgolovin/new-releng/parent/pom.xml
===================================================================
--- workspace/dgolovin/new-releng/parent/pom.xml 2012-02-08 21:53:41 UTC (rev 38525)
+++ workspace/dgolovin/new-releng/parent/pom.xml 2012-02-09 00:04:46 UTC (rev 38526)
@@ -28,21 +28,6 @@
<archiveSite>true</archiveSite>
<environments>
<environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86_64</arch>
- </environment>
- <environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
@@ -72,28 +57,8 @@
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<environments>
<environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86_64</arch>
- </environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86</arch>
- </environment>
- <environment>
<os>linux</os>
<ws>gtk</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
<arch>x86_64</arch>
</environment>
</environments>
@@ -289,12 +254,13 @@
</profile>
</profiles>
-
+ <!-- Use profiles to define target platform url for different versions of eclipse -->
<repositories>
<repository>
<id>eclipse</id>
- <!-- url>http://mirrors.xmission.com/eclipse/releases/indigo/201105200900</url-->
- <url>http://mirrors.xmission.com/eclipse/releases/indigo</url>
+ <!-- url>http://mirrors.xmission.com/eclipse/releases/indigo/201105200900</url-->
+ <!-- url>http://mirrors.xmission.com/eclipse/releases/indigo</url-->
+ <url>http://download.eclipse.org/releases/maintenance/</url>
<layout>p2</layout>
<snapshots>
<enabled>true</enabled>
@@ -305,7 +271,7 @@
</repository>
<repository>
<id>eclipse.gef</id>
- <url>http://download.eclipse.org/tools/gef/updates/releases/</url>
+ <url>http://download.eclipse.org/tools/gef/updates/interim/</url>
<layout>p2</layout>
<snapshots>
<enabled>true</enabled>
@@ -314,9 +280,9 @@
<enabled>true</enabled>
</releases>
</repository>
- <!-- repository>
+ <repository>
<id>eclipse.epp</id>
- <url>http://build.eclipse.org/technology/epp/epp_repo/indigo/epp.build/buildre...</url>
+ <url>http://build.eclipse.org/technology/epp/epp_repo/indigo/epp.build/buildre...</url>
<layout>p2</layout>
<snapshots>
<enabled>true</enabled>
@@ -324,7 +290,7 @@
<releases>
<enabled>true</enabled>
</releases>
- </repository-->
+ </repository>
<repository>
<id>eclipse.swtbot</id>
<url>http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site</url>
@@ -349,7 +315,7 @@
</repository>
<repository>
<id>eclipse.wtp</id>
- <url>http://download.eclipse.org/webtools/downloads/drops/R3.3.0/R-3.3.0-20110...</url>
+ <url>http://download.eclipse.org/webtools/downloads/drops/R3.3.2/M-3.3.2-20120...</url>
<layout>p2</layout>
<snapshots>
<enabled>true</enabled>
@@ -382,7 +348,7 @@
</repository>
<repository>
<id>eclipse.m2e-wtp</id>
- <url>https://repository.sonatype.org/content/sites/forge-sites/m2eclipse-wtp/0...</url>
+ <url>http://download.jboss.org/jbosstools/updates/target-platform_3.3.indigo.S...</url>
<layout>p2</layout>
<snapshots>
<enabled>true</enabled>
14 years, 2 months
JBoss Tools SVN: r38525 - in trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-08 16:53:41 -0500 (Wed, 08 Feb 2012)
New Revision: 38525
Added:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterAction.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterActionProvider.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml
Log:
patches applied - https://issues.jboss.org/browse/JBIDE-10609 and https://issues.jboss.org/browse/JBIDE-10285
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2012-02-08 21:06:10 UTC (rev 38524)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2012-02-08 21:53:41 UTC (rev 38525)
@@ -33,7 +33,8 @@
org.eclipse.ui.editors;bundle-version="3.7.0",
org.eclipse.core.commands;bundle-version="3.6.0",
org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
- org.eclipse.wst.validation;bundle-version="1.2.300"
+ org.eclipse.wst.validation;bundle-version="1.2.300",
+ org.eclipse.wst.server.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml 2012-02-08 21:06:10 UTC (rev 38524)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml 2012-02-08 21:53:41 UTC (rev 38525)
@@ -203,6 +203,24 @@
</or>
</enablement>
</actionProvider>
+ <actionProvider
+ class="org.jboss.tools.ws.jaxrs.ui.cnf.action.OpenInWSTesterActionProvider"
+ id="org.jboss.tools.ws.jaxrs.ui.cnf.openWSTesterActionProvider"
+ priority="normal">
+ <enablement>
+ <or>
+ <instanceof
+ value="org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateElement">
+ </instanceof>
+ <instanceof
+ value="org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateMethodMappingElement">
+ </instanceof>
+ <instanceof
+ value="org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateMediaTypeMappingElement">
+ </instanceof>
+ </or>
+ </enablement>
+ </actionProvider>
</navigatorContent>
</extension>
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterAction.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterAction.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterAction.java 2012-02-08 21:53:41 UTC (rev 38525)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Brian Fitzpatrick - Initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.jaxrs.ui.cnf.action;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateElement;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
+
+/**
+ * @author bfitzpat
+ *
+ */
+public class OpenInWSTesterAction extends Action implements ISelectionChangedListener {
+
+ private ISelection selection = null;
+
+ public OpenInWSTesterAction() {
+ super("Open in JBoss WS Tester");
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ ITreeSelection treeSelection = ((ITreeSelection) selection);
+ @SuppressWarnings("rawtypes")
+ List selections = treeSelection.toList();
+ if (selections.isEmpty()) {
+ return;
+ }
+ Object selectedObject = selections.get(0);
+ try {
+ if (selectedObject instanceof UriPathTemplateElement) {
+ UriPathTemplateElement element = (UriPathTemplateElement) selectedObject;
+ String uriPathTemplate = element.getEndpoint().getUriPathTemplate();
+ String uriPrefix = "http://[domain]:[port]"; //$NON-NLS-1$
+
+ // Now we call the WS Tester through Reflection so there's no direct plug-in dependency
+ IWorkbench wb = PlatformUI.getWorkbench();
+ IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
+ IWorkbenchPage page = win.getActivePage();
+ String id = "org.jboss.tools.ws.ui.tester.views.TestWSView"; //$NON-NLS-1$
+ try {
+ IViewPart part = page.showView(id);
+ if (part != null &&
+ part.getClass().getName().equalsIgnoreCase(
+ "org.jboss.tools.ws.ui.views.JAXRSWSTestView2")) { //$NON-NLS-1$
+ Class<?> c = part.getClass();
+ Class<?> parmtypes[] = new Class[2];
+ parmtypes[0] = String.class;
+ parmtypes[1] = String.class;
+ Method setURL = c.getDeclaredMethod("setJAXRS", parmtypes); //$NON-NLS-1$
+ if (setURL != null) {
+ Object arglist[] = new Object[2];
+ arglist[0] = uriPrefix + uriPathTemplate;
+ arglist[1] = element.getEndpoint().getHttpMethod().getHttpVerb();
+ setURL.invoke(part, arglist);
+ }
+ }
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ Logger.error("Failed to open WS Tester", e);
+ }
+ }
+ } catch (Exception e) {
+ Logger.error("Failed to open WS Tester", e);
+ }
+ }
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ Object source = event.getSource();
+ if (source instanceof CommonViewer) {
+ this.selection = ((CommonViewer) source).getSelection();
+ }
+ }
+
+ public void setSelection(ISelection selection) {
+ this.selection = selection;
+
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterActionProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterActionProvider.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterActionProvider.java 2012-02-08 21:53:41 UTC (rev 38525)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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:
+ * Brian Fitzpatrick - Initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.jaxrs.ui.cnf.action;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonMenuConstants;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+
+/**
+ * @author bfitzpat
+ *
+ */
+public class OpenInWSTesterActionProvider extends CommonActionProvider {
+
+ private OpenInWSTesterAction openInWSTesterAction = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator
+ * .ICommonActionExtensionSite)
+ */
+ @Override
+ public void init(ICommonActionExtensionSite aSite) {
+ ICommonViewerSite viewSite = aSite.getViewSite();
+ if (viewSite instanceof ICommonViewerWorkbenchSite) {
+ openInWSTesterAction = new OpenInWSTesterAction();
+ openInWSTesterAction.setSelection(aSite.getStructuredViewer().getSelection());
+ aSite.getStructuredViewer().addSelectionChangedListener(openInWSTesterAction);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars
+ * )
+ */
+ @Override
+ public void fillActionBars(IActionBars actionBars) {
+ super.fillActionBars(actionBars);
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), openInWSTesterAction);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.
+ * action.IMenuManager)
+ */
+ @Override
+ public void fillContextMenu(IMenuManager menu) {
+ if (openInWSTesterAction != null && openInWSTesterAction.isEnabled()) {
+ menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, openInWSTesterAction);
+ }
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/OpenInWSTesterActionProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java 2012-02-08 21:53:41 UTC (rev 38525)
@@ -0,0 +1,49 @@
+package org.jboss.tools.ws.jaxrs.ui.internal.utils;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
+import org.eclipse.wst.server.core.util.WebResource;
+import org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateElement;
+
+/**
+ * This class adapts {@link UriPathTemplateElement} into WebResources that Eclipse Run|Debug On Server functionallity can handle.
+ *
+ * This allows you to use the Run As functionality on the JAX-RS node elements which represent a path.
+ *
+ * @TODO currently only shows up for paths without "{" in them.
+ * @author max
+ *
+ */
+public class JaxrsPathModuleArtifactAdapter extends ModuleArtifactAdapterDelegate {
+
+ @Override
+ public IModuleArtifact getModuleArtifact(Object obj) {
+ if (obj instanceof UriPathTemplateElement) {
+ UriPathTemplateElement element = (UriPathTemplateElement) obj;
+
+ //TODO: NPE check this
+ IProject project = element.getEndpoint().getJavaProject().getProject();
+
+ IModule module = ServerUtil.getModule(project);
+
+ if(plainUrl(element)) {
+ Path path = new Path(element.getEndpoint().getUriPathTemplate());
+ //TODO: need to take possible @Application context path into consideration!
+ return new WebResource(module, path); //$NON-NLS-1$
+ }
+ }
+
+ return null;
+ }
+
+ // @return true when the path is directly viewable in a browser and its a GET request.
+ private boolean plainUrl(UriPathTemplateElement element) {
+ //TODO: NPE check this
+ return element.getEndpoint().getHttpMethod().getHttpVerb().equalsIgnoreCase("GET") && !element.getEndpoint().getUriPathTemplate().contains("{");
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 2 months
JBoss Tools SVN: r38524 - in trunk/ws: plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-08 16:06:10 -0500 (Wed, 08 Feb 2012)
New Revision: 38524
Added:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/quickfix/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposal.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposalComputer.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementDeltaScanner.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessor.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBaseElement.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResource.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/WtpUtils.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodParameter.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignature.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/.options
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateCategory.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateElement.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/Logger.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/resources/web-2_3-with-servlet-mapping.xml
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessorTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessorTestCase.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidatorTestCase.java
Log:
FIXED - https://issues.jboss.org/browse/JBIDE-10287 - Support JAX-RS Applications
FIXED - https://issues.jboss.org/browse/JBIDE-10748 - Sometimes there is no update in JAX-RS explorer as it should be
FIXED - https://issues.jboss.org/browse/JBIDE-10686 - [Validation] Show error when trying to inject unsupported type with @Context
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementDeltaScanner.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementDeltaScanner.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementDeltaScanner.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -36,7 +36,6 @@
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IOpenable;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.compiler.IProblem;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessor.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessor.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -214,8 +214,7 @@
if (returnTypeHandler != null && supertypesHandlers.contains(returnTypeHandler)) {
final LinkedList<JaxrsResourceMethod> resourceMethods = new LinkedList<JaxrsResourceMethod>(
Arrays.asList(otherResourceMethod, resourceMethod));
- final JaxrsEndpoint endpoint = new JaxrsEndpoint(metamodel.getApplication(), httpMethod,
- resourceMethods);
+ final JaxrsEndpoint endpoint = new JaxrsEndpoint(metamodel, httpMethod, resourceMethods);
if (metamodel.add(endpoint)) {
changes.add(new JaxrsEndpointDelta(endpoint, ADDED));
}
@@ -231,7 +230,7 @@
final JaxrsMetamodel metamodel) {
final JaxrsHttpMethod httpMethod = metamodel.getHttpMethod(resourceMethod.getHttpMethodAnnotation());
final List<JaxrsEndpointDelta> changes = new ArrayList<JaxrsEndpointDelta>();
- final JaxrsEndpoint endpoint = new JaxrsEndpoint(metamodel.getApplication(), httpMethod, resourceMethod);
+ final JaxrsEndpoint endpoint = new JaxrsEndpoint(metamodel, httpMethod, resourceMethod);
if (metamodel.add(endpoint)) {
changes.add(new JaxrsEndpointDelta(endpoint, ADDED));
}
@@ -263,8 +262,8 @@
.getHttpMethodAnnotation());
final LinkedList<JaxrsResourceMethod> resourceMethods = new LinkedList<JaxrsResourceMethod>(
Arrays.asList(subresourceLocator, resourceMethod));
- final JaxrsEndpoint endpoint = new JaxrsEndpoint(metamodel.getApplication(),
- httpMethod, resourceMethods);
+ final JaxrsEndpoint endpoint = new JaxrsEndpoint(metamodel, httpMethod,
+ resourceMethods);
if (metamodel.add(endpoint)) {
changes.add(new JaxrsEndpointDelta(endpoint, ADDED));
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBaseElement.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBaseElement.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsBaseElement.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -3,6 +3,7 @@
import java.util.List;
import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumKind;
@@ -51,7 +52,7 @@
public abstract IResource getResource();
- public abstract List<ValidatorMessage> validate();
+ public abstract List<ValidatorMessage> validate() throws JavaModelException;
public abstract String getName();
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -11,6 +11,7 @@
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain;
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_CONSUMED_MEDIATYPES_VALUE;
+import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_HTTP_METHOD_VALUE;
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_PATH_VALUE;
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_PRODUCED_MEDIATYPES_VALUE;
@@ -35,24 +36,29 @@
public class JaxrsEndpoint implements IJaxrsEndpoint {
- private final JaxrsHttpMethod httpMethod;
+ private final JaxrsMetamodel metamodel;
+ private JaxrsHttpMethod httpMethod;
+
private final LinkedList<JaxrsResourceMethod> resourceMethods;
private IJaxrsApplication application = null;
-
+
private String uriPathTemplate = null;
private List<String> consumedMediaTypes = null;
private List<String> producedMediaTypes = null;
- public JaxrsEndpoint(final IJaxrsApplication application, final JaxrsHttpMethod httpMethod, final JaxrsResourceMethod resourceMethod) {
- this(application, httpMethod, new LinkedList<JaxrsResourceMethod>(Arrays.asList(resourceMethod)));
+ public JaxrsEndpoint(final JaxrsMetamodel metamodel, final JaxrsHttpMethod httpMethod,
+ final JaxrsResourceMethod resourceMethod) {
+ this(metamodel, httpMethod, new LinkedList<JaxrsResourceMethod>(Arrays.asList(resourceMethod)));
}
- public JaxrsEndpoint(final IJaxrsApplication application, final JaxrsHttpMethod httpMethod, final LinkedList<JaxrsResourceMethod> resourceMethods) {
- this.application = application;
+ public JaxrsEndpoint(final JaxrsMetamodel metamodel, final JaxrsHttpMethod httpMethod,
+ final LinkedList<JaxrsResourceMethod> resourceMethods) {
+ this.metamodel = metamodel;
+ this.application = (metamodel != null ? metamodel.getApplication() : null);
this.httpMethod = httpMethod;
this.resourceMethods = resourceMethods;
refreshUriPathTemplate();
@@ -62,7 +68,6 @@
/*
* (non-Javadoc)
- *
* @see java.lang.Object#toString()
*/
@Override
@@ -75,7 +80,6 @@
/*
* (non-Javadoc)
- *
* @see java.lang.Object#hashCode()
*/
@Override
@@ -92,7 +96,6 @@
/*
* (non-Javadoc)
- *
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
@@ -148,28 +151,31 @@
/**
* Triggers a refresh when changes occurred on the application element (whatever operation).
*
- * @return true if the endpoint is still valid, false otherwise (it should
- * be removed from the metamodel)
+ * @return true if the endpoint is still valid, false otherwise (it should be removed from the metamodel)
*/
public boolean refresh(IJaxrsApplication application) {
this.application = application;
refreshUriPathTemplate();
return true;
}
-
+
/**
- * Triggers a refresh when changes occurred on one or more elements
- * (HttpMethod and/or ResourcMethods) of the endpoint.
+ * Triggers a refresh when changes occurred on one or more elements (HttpMethod and/or ResourcMethods) of the
+ * endpoint.
*
- * @return true if the endpoint is still valid, false otherwise (it should
- * be removed from the metamodel)
+ * @return true if the endpoint is still valid, false otherwise (it should be removed from the metamodel)
*/
public boolean refresh(IJaxrsResourceMethod changedResourceMethod, int flags) {
// check if the chain of resource methods still match
/*
- * if ((flags & F_ELEMENT_KIND) > 0 && changedResourceMethod.getKind()
- * == EnumKind.SUBRESOURCE_LOCATOR) { return false; }
+ * if ((flags & F_ELEMENT_KIND) > 0 && changedResourceMethod.getKind() == EnumKind.SUBRESOURCE_LOCATOR) { return
+ * false; }
*/
+
+ if ((flags & F_HTTP_METHOD_VALUE) > 0) {
+ refreshHttpMethod();
+ }
+
if ((flags & F_PATH_VALUE) > 0) {
refreshUriPathTemplate();
}
@@ -187,6 +193,14 @@
return true;
}
+ private void refreshHttpMethod() {
+ final JaxrsResourceMethod resourceMethod = resourceMethods.getLast();
+ final Annotation httpMethodAnnotation = resourceMethod.getHttpMethodAnnotation();
+ if (httpMethodAnnotation != null) {
+ this.httpMethod = metamodel.getHttpMethod(httpMethodAnnotation);
+ }
+ }
+
private void refreshProducedMediaTypes() {
final JaxrsResourceMethod resourceMethod = resourceMethods.getLast();
final JaxrsResource resource = resourceMethod.getParentResource();
@@ -214,7 +228,7 @@
private void refreshUriPathTemplate() {
// compute the URI Path Template from the chain of Methods/Resources
StringBuilder uriPathTemplateBuilder = new StringBuilder();
- if(application != null) {
+ if (application != null) {
uriPathTemplateBuilder.append(application.getApplicationPath());
}
for (JaxrsResourceMethod resourceMethod : resourceMethods) {
@@ -293,10 +307,7 @@
/*
* (non-Javadoc)
- *
- * @see
- * org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IJaxrsEndpoint
- * #getHttpMethod()
+ * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IJaxrsEndpoint #getHttpMethod()
*/
@Override
public IJaxrsHttpMethod getHttpMethod() {
@@ -321,8 +332,7 @@
/**
* Convenient method to check if this endpoint uses this ResourceMethod.
*
- * @return true if this endpoint's ResourceMethod is the one given in
- * parameter
+ * @return true if this endpoint's ResourceMethod is the one given in parameter
*/
public boolean match(IJaxrsResourceMethod resourceMethod) {
return this.resourceMethods.contains(resourceMethod);
@@ -330,10 +340,7 @@
/*
* (non-Javadoc)
- *
- * @see
- * org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IJaxrsEndpoint
- * #getUriPathTemplate()
+ * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IJaxrsEndpoint #getUriPathTemplate()
*/
@Override
public String getUriPathTemplate() {
@@ -342,10 +349,7 @@
/*
* (non-Javadoc)
- *
- * @see
- * org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IJaxrsEndpoint
- * #getConsumedMediaTypes()
+ * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IJaxrsEndpoint #getConsumedMediaTypes()
*/
@Override
public List<String> getConsumedMediaTypes() {
@@ -354,10 +358,7 @@
/*
* (non-Javadoc)
- *
- * @see
- * org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IJaxrsEndpoint
- * #getProducedMediaTypes()
+ * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IJaxrsEndpoint #getProducedMediaTypes()
*/
@Override
public List<String> getProducedMediaTypes() {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResource.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResource.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResource.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -23,6 +23,7 @@
import javax.ws.rs.Produces;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.validation.ValidatorMessage;
import org.jboss.tools.ws.jaxrs.core.jdt.Annotation;
import org.jboss.tools.ws.jaxrs.core.metamodel.EnumElementKind;
@@ -229,7 +230,7 @@
}
@Override
- public List<ValidatorMessage> validate() {
+ public List<ValidatorMessage> validate() throws JavaModelException {
List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
// delegating the validation to the undelying resource methods
for (Entry<String, JaxrsResourceMethod> entry : resourceMethods.entrySet()) {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -16,16 +16,23 @@
import static org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.JaxrsElementDelta.F_NONE;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Request;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.validation.ValidatorMessage;
@@ -42,11 +49,16 @@
/** @author xcoulon */
public class JaxrsResourceMethod extends JaxrsResourceElement<IMethod> implements IJaxrsResourceMethod {
+ /** The parameter type names that can be annotated with {@link Context}. */
+ private final static List<String> CONTEXT_TYPE_NAMES = new ArrayList<String>(Arrays.asList(
+ "javax.ws.rs.core.HttpHeaders", "javax.ws.rs.core.UriInfo", "javax.ws.rs.core.Request",
+ "javax.servlet.HttpServletRequest", "javax.servlet.HttpServletResponse", "javax.servlet.ServletConfig",
+ "javax.servlet.ServletContext", "javax.ws.rs.core.SecurityContext"));
+
private final JaxrsResource parentResource;
/**
- * return type of the java javaMethod. Null if this is not a subresource
- * locator.
+ * return type of the java javaMethod. Null if this is not a subresource locator.
*/
private IType returnedJavaType = null;
@@ -182,9 +194,92 @@
}
@Override
- public List<ValidatorMessage> validate() {
- List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
+ public List<ValidatorMessage> validate() throws JavaModelException {
+ final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
+ messages.addAll(validateMissingPathValueInPathParamAnnotations());
+ messages.addAll(validateMissingPathParamAnnotations());
+ messages.addAll(validateParamsWithContextAnnotation());
+ messages.addAll(validateSingleParamWithoutAnnotation());
+ return messages;
+ }
+
+ /**
+ * Validate that only one method parameter is not annotated with a JAX-RS annotation. This non-annotated parameter
+ * is the "Entity parameter", coming from the client's request body, unmarshalled by the appropriate
+ * {@link MesssageBodyReader}.
+ *
+ * @return
+ */
+ private List<ValidatorMessage> validateSingleParamWithoutAnnotation() {
+ final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
+ return messages;
+ }
+
+ /**
+ * Validates that the method parameters annotated with {@link Context} are of the supported types in the spec:
+ * {@link UriInfo}, {@link HttpHeaders}, {@link ServletConfig}, {@link ServletContext}, {@link HttpServletRequest},
+ * {@link Request}, {@link HttpServletResponse} and {@link Response}.
+ *
+ * @return
+ */
+ private List<ValidatorMessage> validateParamsWithContextAnnotation() {
+ final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
+ for (JavaMethodParameter parameter : this.javaMethodParameters) {
+ final Annotation annotation = parameter.getAnnotation(Context.class.getName());
+ final String typeName = parameter.getTypeName();
+ if (annotation != null && typeName != null && !CONTEXT_TYPE_NAMES.contains(typeName)) {
+ final ValidatorMessage message = ValidatorMessage.create("This parameter type (" + typeName
+ + ") cannot be annotated with @Context", this.getResource());
+ message.setAttribute(IMarker.MARKER, JaxrsMetamodelBuilder.JAXRS_PROBLEM);
+ message.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
+ message.setAttribute(IMarker.CHAR_START, parameter.getRegion().getOffset());
+ message.setAttribute(IMarker.CHAR_END, parameter.getRegion().getOffset()
+ + parameter.getRegion().getLength());
+ messages.add(message);
+ Logger.debug("Validation message for {}: {}", this.getJavaElement().getElementName(),
+ message.getAttribute(IMarker.MESSAGE));
+ }
+ }
+ return messages;
+ }
+
+ private List<ValidatorMessage> validateMissingPathParamAnnotations() throws JavaModelException {
+ final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
final List<String> pathParamValueProposals = getPathParamValueProposals();
+ for (String proposal : pathParamValueProposals) {
+ boolean matching = false;
+ for (JavaMethodParameter parameter : this.javaMethodParameters) {
+ final Annotation annotation = parameter.getAnnotation(PathParam.class.getName());
+ if (annotation != null && annotation.getValue("value").equals(proposal)) {
+ matching = true;
+ break;
+ }
+ }
+ if (!matching) {
+ final ValidatorMessage message = ValidatorMessage.create("Missing @PathParam value: expected "
+ + proposal, this.getResource());
+ message.setAttribute(IMarker.MARKER, JaxrsMetamodelBuilder.JAXRS_PROBLEM);
+ message.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
+ final ISourceRange nameRange = getJavaElement().getNameRange();
+ message.setAttribute(IMarker.CHAR_START, nameRange.getOffset());
+ message.setAttribute(IMarker.CHAR_END, nameRange.getOffset() + nameRange.getLength());
+ messages.add(message);
+ Logger.debug("Validation message for {}: {}", this.getJavaElement().getElementName(),
+ message.getAttribute(IMarker.MESSAGE));
+ }
+ }
+ return messages;
+ }
+
+ /**
+ * Checks that the {@link PathParam} annotation values match the params in the {@link Path} annotations at the
+ * method and the parent type levels.
+ *
+ * @return errors in case of mismatch, empty list otherwise.
+ */
+ private List<ValidatorMessage> validateMissingPathValueInPathParamAnnotations() {
+ final List<ValidatorMessage> messages = new ArrayList<ValidatorMessage>();
+ final List<String> pathParamValueProposals = getPathParamValueProposals();
for (JavaMethodParameter parameter : this.javaMethodParameters) {
final Annotation annotation = parameter.getAnnotation(PathParam.class.getName());
if (annotation != null) {
@@ -198,7 +293,8 @@
message.setAttribute(IMarker.CHAR_END, annotation.getRegion().getOffset()
+ annotation.getRegion().getLength());
messages.add(message);
- Logger.debug("Validation message for {}: {}", this.getJavaElement().getElementName(), message.getAttribute(IMarker.MESSAGE));
+ Logger.debug("Validation message for {}: {}", this.getJavaElement().getElementName(),
+ message.getAttribute(IMarker.MESSAGE));
}
}
}
@@ -207,10 +303,7 @@
/*
* (non-Javadoc)
- *
- * @see
- * org.jboss.tools.ws.jaxrs.core.internal.metamodel.IResourceMethod#hasErrors
- * (boolean)
+ * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.IResourceMethod#hasErrors (boolean)
*/
@Override
public void hasErrors(final boolean h) {
@@ -222,10 +315,7 @@
/*
* (non-Javadoc)
- *
- * @see
- * org.jboss.tools.ws.jaxrs.core.internal.metamodel.IResourceMethod#getKind
- * ()
+ * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.IResourceMethod#getKind ()
*/
@Override
public final EnumKind getKind() {
@@ -243,9 +333,7 @@
/*
* (non-Javadoc)
- *
- * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.IResourceMethod#
- * getParentResource()
+ * @see org.jboss.tools.ws.jaxrs.core.internal.metamodel.IResourceMethod# getParentResource()
*/
@Override
public final JaxrsResource getParentResource() {
@@ -315,16 +403,15 @@
public List<JavaMethodParameter> getJavaMethodParameters() {
return javaMethodParameters;
}
-
+
/*
* (non-Javadoc)
- *
* @see java.lang.Object#toString()
*/
@Override
public final String toString() {
- return "ResourceMethod '" + parentResource.getName() + "."
- + getJavaElement().getElementName() + "' (" + getKind().toString() + ")";
+ return "ResourceMethod '" + parentResource.getName() + "." + getJavaElement().getElementName() + "' ("
+ + getKind().toString() + ")";
}
@Override
@@ -344,8 +431,7 @@
}
/**
- * Extracts all the character sequences inside of curly braces ('{' and '}')
- * and returns them as a list of strings
+ * Extracts all the character sequences inside of curly braces ('{' and '}') and returns them as a list of strings
*
* @param value
* the given value
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/WtpUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/WtpUtils.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/WtpUtils.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -26,7 +27,7 @@
public static IFolder getWebInfFolder(IProject project) {
IVirtualComponent component = ComponentCore.createComponent(project);
- if(component == null) {
+ if (component == null) {
return null;
}
IVirtualFolder contentFolder = component.getRootFolder();
@@ -57,7 +58,7 @@
*/
public static String getApplicationPath(IProject project, String applicationTypeName) throws CoreException {
IFolder webInfFolder = getWebInfFolder(project);
- if(webInfFolder == null) {
+ if (webInfFolder == null) {
return null;
}
IResource webxmlResource = webInfFolder.findMember("web.xml");
@@ -65,34 +66,44 @@
Logger.debug("No deployment descriptor found in project '{}'", project.getName());
return null;
}
- /*if (webxmlResource.isSynchronized(IResource.DEPTH_INFINITE)) {
+ if (!webxmlResource.isSynchronized(IResource.DEPTH_INFINITE)) {
Logger.debug("Resource is not in sync'");
webxmlResource.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
- }*/
- // cannot use the WebTools WebArtifact Edit APIs because the web.xml configuration does not require a servlet,
- // but just a servlet-mapping element.
+ }
+
/*
- * WebArtifactEdit webArtifactEdit = WebArtifactEdit.getWebArtifactEditForRead(javaProject.getProject()); //
- * webArtifactEdit.getDeploymentDescriptorRoot().eResource().unload(); if (!webArtifactEdit.isValid()) { return
- * null; } webArtifactEdit.getDeploymentDescriptorRoot(); WebApp webApp = webArtifactEdit.getWebApp();
- * EList<ServletMapping> servletMappings = webApp.getServletMappings(); for (ServletMapping servletMapping :
- * servletMappings) { if (servletMapping.getName().equals(applicationTypeName)) { return
- * servletMapping.getUrlPattern(); } }
+ * WebArtifactEdit webArtifactEdit = WebArtifactEdit.getWebArtifactEditForRead(project); // if
+ * (!webArtifactEdit.isValid()) { return null; } WebPackageImpl.eINSTANCE.getWebApp(); IModelProvider provider =
+ * ModelProviderManager.getModelProvider(project); Object mObj = provider.getModelObject(); if (mObj instanceof
+ * org.eclipse.jst.j2ee.webapplication.WebApp) { org.eclipse.jst.j2ee.webapplication.WebApp webApp =
+ * (org.eclipse.jst.j2ee.webapplication.WebApp) mObj; } else if (mObj instanceof
+ * org.eclipse.jst.javaee.web.WebApp) { org.eclipse.jst.javaee.web.WebApp webApp =
+ * (org.eclipse.jst.javaee.web.WebApp) mObj; }
*/
+ // final List<Servlet> servlets = webApp.getServlets();
+ /*
+ * webArtifactEdit.getDeploymentDescriptorRoot().eResource().unload();
+ * webArtifactEdit.getDeploymentDescriptorRoot(); WebApp webApp = webArtifactEdit.getWebApp();
+ * @SuppressWarnings("unchecked") EList<ServletMapping> servletMappings = webApp.getServletMappings(); for
+ * (ServletMapping servletMapping : servletMappings) { if (servletMapping.getName().equals(applicationTypeName))
+ * { return servletMapping.getUrlPattern(); } }
+ */
// using a good old xpath expression to scan the file.
-
+
try {
- DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
- domFactory.setNamespaceAware(false); // never forget this!
- domFactory.setValidating(false);
- DocumentBuilder builder = domFactory.newDocumentBuilder();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(false); // never forget this!
+ dbf.setValidating(false);
+ dbf.setFeature("http://xml.org/sax/features/namespaces", false);
+ dbf.setFeature("http://xml.org/sax/features/validation", false);
+ dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
+ dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
+ DocumentBuilder builder = dbf.newDocumentBuilder();
final FileInputStream fileInputStream = new FileInputStream(webxmlResource.getLocation().toFile());
InputSource inputSource = new InputSource(fileInputStream);
Document doc = builder.parse(inputSource);
-
XPath xpath = XPathFactory.newInstance().newXPath();
String expression = "//servlet-mapping[servlet-name=\"" + applicationTypeName + "\"]/url-pattern/text()";
-
XPathExpression expr = xpath.compile(expression);
Node urlPattern = (Node) expr.evaluate(doc, XPathConstants.NODE);
if (urlPattern != null) {
@@ -117,7 +128,7 @@
*/
public static boolean isWebDeploymentDescriptor(IResource resource) {
final IFolder webinfFolder = getWebInfFolder(resource.getProject());
- if(webinfFolder == null) {
+ if (webinfFolder == null) {
return false;
}
final IFile file = webinfFolder.getFile("web.xml");
@@ -135,7 +146,7 @@
*/
public static boolean hasWebDeploymentDescriptor(IProject project) {
final IFolder webinfFolder = getWebInfFolder(project);
- if(webinfFolder == null) {
+ if (webinfFolder == null) {
return false;
}
final IFile file = webinfFolder.getFile("web.xml");
@@ -145,7 +156,7 @@
public static IResource getWebDeploymentDescriptor(IProject project) {
final IFolder webinfFolder = getWebInfFolder(project);
final IFile file = webinfFolder.getFile("web.xml");
- if(file != null && file.exists()) {
+ if (file != null && file.exists()) {
return project.findMember(file.getProjectRelativePath());
}
return null;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodParameter.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodParameter.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodParameter.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -15,6 +15,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.TypedRegion;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.IValidable;
public class JavaMethodParameter implements IValidable {
@@ -23,9 +24,12 @@
private final List<Annotation> annotations;
- public JavaMethodParameter(String name, String typeName, List<Annotation> annotations) {
+ private final TypedRegion region;
+
+ public JavaMethodParameter(String name, String typeName, List<Annotation> annotations, final TypedRegion region) {
this.typeName = typeName;
this.annotations = annotations;
+ this.region = region;
}
@Override
@@ -42,15 +46,41 @@
return annotations;
}
+ public Annotation getAnnotation(String name) {
+ for (Annotation annotation : annotations) {
+ if (annotation.getName().equals(name)) {
+ return annotation;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return the region
+ */
+ public TypedRegion getRegion() {
+ return region;
+ }
+
@Override
+ public String toString() {
+ return "ResourceMethodAnnotatedParameter [type=" + typeName + ", annotations=" + annotations + "]";
+ }
+
+ @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((annotations == null) ? 0 : annotations.hashCode());
+ //result = prime * result + ((region == null) ? 0 : region.hashCode());
result = prime * result + ((typeName == null) ? 0 : typeName.hashCode());
return result;
}
+ /*
+ * (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
@Override
public boolean equals(Object obj) {
if (this == obj) {
@@ -62,7 +92,7 @@
if (getClass() != obj.getClass()) {
return false;
}
- final JavaMethodParameter other = (JavaMethodParameter) obj;
+ JavaMethodParameter other = (JavaMethodParameter) obj;
if (annotations == null) {
if (other.annotations != null) {
return false;
@@ -70,6 +100,13 @@
} else if (!annotations.equals(other.annotations)) {
return false;
}
+ /*if (region == null) {
+ if (other.region != null) {
+ return false;
+ }
+ } else if (!region.equals(other.region)) {
+ return false;
+ }*/
if (typeName == null) {
if (other.typeName != null) {
return false;
@@ -80,23 +117,4 @@
return true;
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "ResourceMethodAnnotatedParameter [type=" + typeName + ", annotations=" + annotations + "]";
- }
-
- public Annotation getAnnotation(String name) {
- for (Annotation annotation : annotations) {
- if (annotation.getName().equals(name)) {
- return annotation;
- }
- }
- return null;
- }
-
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignature.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignature.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignature.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -44,7 +44,11 @@
@Override
public String toString() {
StringBuilder stb = new StringBuilder("JavaMethodSignature ");
- stb.append(returnedType.getElementName()).append(" ");
+ if (returnedType != null) {
+ stb.append(returnedType.getElementName()).append(" ");
+ } else {
+ stb.append("void ");
+ }
stb.append(javaMethod.getElementName()).append("(");
for (Iterator<JavaMethodParameter> paramIterator = methodParameters.iterator(); paramIterator.hasNext();) {
JavaMethodParameter methodParam = (JavaMethodParameter) paramIterator.next();
@@ -96,7 +100,7 @@
} else if (!methodParameters.equals(other.methodParameters)) {
return false;
}
-
+
if (returnedType == null) {
if (other.returnedType != null)
return false;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -108,7 +108,9 @@
annotationElements, typedRegion));
}
}
- methodParameters.add(new JavaMethodParameter(paramName, paramTypeName, paramAnnotations));
+ final TypedRegion typedRegion = new TypedRegion(parameter.getStartPosition(),
+ parameter.getLength(), IDocument.DEFAULT_CONTENT_TYPE);
+ methodParameters.add(new JavaMethodParameter(paramName, paramTypeName, paramAnnotations, typedRegion));
}
// TODO : add support for thrown exceptions
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/.options
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/.options 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/.options 2012-02-08 21:06:10 UTC (rev 38524)
@@ -1,2 +1,3 @@
# This file enables runtime tracing
-org.jboss.tools.ws.jaxrs.ui/debug=true
\ No newline at end of file
+org.jboss.tools.ws.jaxrs.ui/debug=true
+org.jboss.tools.ws.jaxrs.ui/trace=false
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2012-02-08 21:06:10 UTC (rev 38524)
@@ -6,7 +6,8 @@
Bundle-SymbolicName: org.jboss.tools.ws.jaxrs.ui;singleton:=true
Bundle-Version: 1.2.2.qualifier
Bundle-Activator: org.jboss.tools.ws.jaxrs.ui.JBossJaxrsUIPlugin
-Require-Bundle: org.eclipse.ui;bundle-version="3.6.0",
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.ui.ide;bundle-version="3.7.0",
org.eclipse.core.runtime;visibility:=reexport,
org.eclipse.jdt.core;bundle-version="3.6.0",
org.eclipse.jdt.core.manipulation;bundle-version="1.3.0",
@@ -31,7 +32,6 @@
org.eclipse.jdt.core.manipulation;bundle-version="1.4.0",
org.eclipse.ui.editors;bundle-version="3.7.0",
org.eclipse.core.commands;bundle-version="3.6.0",
- org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
org.eclipse.wst.validation;bundle-version="1.2.300"
Bundle-ActivationPolicy: lazy
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml 2012-02-08 21:06:10 UTC (rev 38524)
@@ -262,7 +262,7 @@
</extension>
<extension
- id="org.jboss.tools.ws.jaxrs.ui.javaCompetionProposalComputer"
+ id="org.jboss.tools.ws.jaxrs.ui.pathParamAnnotationValueCompletionProposalComputer"
point="org.eclipse.jdt.ui.javaCompletionProposalComputer">
<javaCompletionProposalComputer
activate="true"
@@ -276,6 +276,27 @@
</partition>
</javaCompletionProposalComputer>
</extension>
+ <!--extension
+ id="org.jboss.tools.ws.jaxrs.ui.methodParametersCompletionProposalComputer"
+ point="org.eclipse.jdt.ui.javaCompletionProposalComputer">
+ <javaCompletionProposalComputer
+ activate="true"
+ categoryId="org.eclipse.jdt.ui.defaultProposalCategory"
+ class="org.jboss.tools.ws.jaxrs.ui.contentassist.MethodParametersCompletionProposalComputer">
+ <partition
+ type="__dftl_partition_content_type">
+ </partition>
+ <partition
+ type="__java_string">
+ </partition>
+ </javaCompletionProposalComputer>
+ </extension-->
+ <!--extension
+ point="org.eclipse.ui.ide.markerResolution">
+ <markerResolutionGenerator
+ class="org.jboss.tools.ws.jaxrs.ui.contentassist.JaxrsMarkerResolutionGenerator">
+ </markerResolutionGenerator>
+ </extension-->
<!-- see https://bugs.eclipse.org/bugs/show_bug.cgi?id=338898 -->
</plugin>
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriMappingsContentProvider.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -159,7 +159,7 @@
if (viewer != null) {
TreePath[] treePaths = viewer.getExpandedTreePaths();
Logger.debug("*** Refreshing the viewer at target level: {} (viewer busy: {}) ***", target, viewer.isBusy());
- viewer.refresh(target);
+ viewer.refresh();
viewer.setExpandedTreePaths(treePaths);
Logger.debug("*** Refreshing the viewer... done ***");
} else {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateCategory.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateCategory.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateCategory.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -54,9 +54,11 @@
// LinkedList<IJaxrsResourceMethod> resourceMethods =
// endpoint.getResourceMethods();
if (element == null) {
+ Logger.trace("Creating element for endpoint {} ('cause not found in wrapperCache)", endpoint);
element = new UriPathTemplateElement(endpoint, this);
wrapperCache.put(endpoint, element);
}
+ Logger.trace("Adding element for endpoint {}", endpoint);
uriPathTemplateElements.add(element);
}
return uriPathTemplateElements.toArray();
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateElement.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateElement.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/UriPathTemplateElement.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -19,6 +19,7 @@
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsEndpoint;
import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsResourceMethod;
import org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateMediaTypeMappingElement.EnumCapabilityType;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
public class UriPathTemplateElement implements ITreeContentProvider {
@@ -43,10 +44,6 @@
return elements.toArray();
}
- public void refresh(IJaxrsEndpoint endpoint2) {
- // TODO Auto-generated method stub
-
- }
@Override
public Object getParent(Object element) {
return uriPathTemplateCategory;
@@ -69,7 +66,7 @@
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// TODO Auto-generated method stub
-
+ Logger.trace("Input changed: {} -> {}", oldInput, newInput);
}
public boolean hasErrors() {
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -0,0 +1,21 @@
+package org.jboss.tools.ws.jaxrs.ui.contentassist;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolutionGenerator2;
+
+public class JaxrsMarkerResolutionGenerator implements IMarkerResolutionGenerator2 {
+
+ @Override
+ public IMarkerResolution[] getResolutions(IMarker marker) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean hasResolutions(IMarker marker) {
+
+ return false;
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/JaxrsMarkerResolutionGenerator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposal.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposal.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposal.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -0,0 +1,278 @@
+/*******************************************************************************
+ * 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:
+ * Xavier Coulon - Initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.jaxrs.ui.contentassist;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.text.java.hover.JavadocBrowserInformationControlInput;
+import org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover;
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.internal.text.html.BrowserInformationControl;
+import org.eclipse.jface.internal.text.html.HTMLPrinter;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension4;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension6;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchSite;
+import org.jboss.tools.ws.jaxrs.core.jdt.JdtUtils;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
+import org.osgi.framework.Bundle;
+
+@SuppressWarnings("restriction")
+public class MethodParametersCompletionProposal implements ICompletionProposal, ICompletionProposalExtension,
+ ICompletionProposalExtension3, ICompletionProposalExtension4, ICompletionProposalExtension5,
+ ICompletionProposalExtension6, IJavaCompletionProposal {
+
+ /** The maximum relevance value, to ensure the proposal is at the top of the
+ * list. */
+ public static final int MAX_RELEVANCE = 1000;
+
+ private String additionalProposalInfo;
+
+ private final IMember member;
+
+ private final String replacementString;
+
+ private final int replacementOffset;
+
+ private final int replacementLength;
+
+ private final Image icon;
+
+ private final StyledString displayStyledString;
+
+ private final int relevance;
+
+ private final int cursorPosition;
+
+ private String fgCSSStyles;
+
+ private IInformationControlCreator creator;
+
+ public MethodParametersCompletionProposal(final String replacementString, final StyledString displayStyledString,
+ final ITypedRegion region, final Image icon, final IMember member) {
+ this.replacementString = replacementString;
+ this.replacementOffset = region.getOffset();
+ this.replacementLength = region.getLength();
+ this.icon = icon;
+ this.displayStyledString = displayStyledString;
+ this.cursorPosition = replacementString.length();
+ this.relevance = MAX_RELEVANCE;
+ this.member = member;
+ }
+
+ @Override
+ public Point getSelection(IDocument document) {
+ return new Point(replacementOffset + cursorPosition, 0);
+ }
+
+ @Override
+ public void apply(IDocument document) {
+ apply(document, (char) 0, 0);
+ }
+
+ @Override
+ public void apply(IDocument document, char trigger, int offset) {
+ try {
+ document.replace(replacementOffset, replacementLength, replacementString);
+ // cursorPosition++;
+ } catch (BadLocationException e) {
+ Logger.warn("Failed to replace document content with selected proposal", e);
+ }
+ }
+
+ @Override
+ public String getAdditionalProposalInfo() {
+ if (additionalProposalInfo == null) {
+ additionalProposalInfo = ((JavadocBrowserInformationControlInput) getAdditionalProposalInfo(new NullProgressMonitor()))
+ .getHtml();
+ }
+ return additionalProposalInfo.toString();
+ }
+
+ @Override
+ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+ CompilationUnit compilationUnit;
+ try {
+ compilationUnit = JdtUtils.parse(member, monitor);
+ MemberDeclarationVisitor memberDeclarationVisitor = new MemberDeclarationVisitor(member);
+ compilationUnit.accept(memberDeclarationVisitor);
+ String sourceOverview = memberDeclarationVisitor.getSourceOverview();
+ StringBuffer buffer = new StringBuffer();
+ HTMLPrinter.insertPageProlog(buffer, 0, getCSSStyles());
+ buffer.append("Matching URI Template mapping defined in the <strong>@Path</strong> annotation value below:</br></br>");
+ buffer.append(sourceOverview.replaceFirst("@Path.*\n", "<strong>$0</strong>").replaceAll("\n", "<br/>")
+ .replaceAll("\t", " ").replaceAll("<br/>\\s*", "<br/>"));
+ HTMLPrinter.addPageEpilog(buffer);
+ this.additionalProposalInfo = buffer.toString();
+ return new JavadocBrowserInformationControlInput(null, null, this.additionalProposalInfo, 0);
+ } catch (JavaModelException e) {
+ // do nothing
+ }
+ return null;
+ }
+
+ /** Returns the style information for displaying HTML (Javadoc) content.
+ *
+ * @return the CSS styles
+ * @since 3.3 */
+ protected String getCSSStyles() {
+ if (fgCSSStyles == null) {
+ Bundle bundle = Platform.getBundle(JavaPlugin.getPluginId());
+ URL url = bundle.getEntry("/JavadocHoverStyleSheet.css"); //$NON-NLS-1$
+ if (url != null) {
+ BufferedReader reader = null;
+ try {
+ url = FileLocator.toFileURL(url);
+ reader = new BufferedReader(new InputStreamReader(url.openStream()));
+ StringBuffer buffer = new StringBuffer(200);
+ String line = reader.readLine();
+ while (line != null) {
+ buffer.append(line);
+ buffer.append('\n');
+ line = reader.readLine();
+ }
+ fgCSSStyles = buffer.toString();
+ } catch (IOException ex) {
+ JavaPlugin.log(ex);
+ } finally {
+ try {
+ if (reader != null)
+ reader.close();
+ } catch (IOException e) {
+ }
+ }
+
+ }
+ }
+ String css = fgCSSStyles;
+ if (css != null) {
+ FontData fontData = JFaceResources.getFontRegistry().getFontData(
+ PreferenceConstants.APPEARANCE_JAVADOC_FONT)[0];
+ css = HTMLPrinter.convertTopLevelFont(css, fontData);
+ }
+ return css;
+ }
+
+ @Override
+ public boolean isAutoInsertable() {
+ return false;
+ }
+
+ @Override
+ public String getDisplayString() {
+ return displayStyledString.getString();
+ }
+
+ @Override
+ public StyledString getStyledDisplayString() {
+ return displayStyledString;
+ }
+
+ @Override
+ public Image getImage() {
+ return icon;
+ }
+
+ @Override
+ public IContextInformation getContextInformation() {
+ return null;
+ }
+
+ @Override
+ public int getRelevance() {
+ return relevance;
+ }
+
+ @Override
+ public boolean isValidFor(IDocument document, int offset) {
+ return false;
+ }
+
+ @Override
+ public char[] getTriggerCharacters() {
+ return null;
+ }
+
+ /*
+ * @see ICompletionProposalExtension#getContextInformationPosition()
+ */
+ @Override
+ public int getContextInformationPosition() {
+ if (getContextInformation() == null) {
+ return replacementOffset - 1;
+ }
+ return replacementOffset + cursorPosition;
+ }
+
+ @Override
+ public IInformationControlCreator getInformationControlCreator() {
+ Shell shell = JavaPlugin.getActiveWorkbenchShell();
+ if (shell == null || !BrowserInformationControl.isAvailable(shell)) {
+ return null;
+ }
+ if (creator == null) {
+ JavadocHover.PresenterControlCreator presenterControlCreator = new JavadocHover.PresenterControlCreator(
+ getSite());
+ creator = new JavadocHover.HoverControlCreator(presenterControlCreator, true);
+ }
+ return creator;
+ }
+
+ private IWorkbenchSite getSite() {
+ IWorkbenchPage page = JavaPlugin.getActivePage();
+ if (page != null) {
+ IWorkbenchPart part = page.getActivePart();
+ if (part != null)
+ return part.getSite();
+ }
+ return null;
+ }
+
+ @Override
+ public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) {
+ return null;
+ }
+
+ @Override
+ public int getPrefixCompletionStart(IDocument document, int completionOffset) {
+ return 0;
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposal.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposalComputer.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposalComputer.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposalComputer.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -0,0 +1,106 @@
+package org.jboss.tools.ws.jaxrs.ui.contentassist;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.ui.text.IJavaPartitions;
+import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
+import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.TypedRegion;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsMetamodel;
+import org.jboss.tools.ws.jaxrs.core.metamodel.JaxrsMetamodelLocator;
+import org.jboss.tools.ws.jaxrs.ui.JBossJaxrsUIPlugin;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
+
+/**
+ * Computes proposals for method parameters based on the Path values found on the method and on the parent type. Also,
+ * depending on the HttpMethod, a single content object may be proposed, too. For example, with @POST and @PUT request,
+ * there should be a body to process, but not in @GET and @DELETE, nor in @HEAD and @OPTIONS.
+ * If the java method is annotated with a custom HttpMethod, then the content object will be proposed, too.
+ *
+ *
+ * @author xcoulon
+ */
+public class MethodParametersCompletionProposalComputer implements IJavaCompletionProposalComputer {
+
+ /** Icon for completion proposals. */
+ private final Image icon = JBossJaxrsUIPlugin.getDefault().createImage("url_mapping.gif");
+
+ /** {@inheritDoc} */
+ @Override
+ public void sessionStarted() {
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void sessionEnded() {
+ }
+
+ @Override
+ public List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context,
+ IProgressMonitor monitor) {
+ final List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
+ final JavaContentAssistInvocationContext javaContext = (JavaContentAssistInvocationContext) context;
+ try {
+ final IJavaProject project = javaContext.getProject();
+ final IJaxrsMetamodel metamodel = JaxrsMetamodelLocator.get(project);
+ // skip if the JAX-RS Nature is not configured for this project
+ if (metamodel == null) {
+ return Collections.emptyList();
+ }
+ final IJavaElement invocationElement = javaContext.getCompilationUnit().getElementAt(
+ context.getInvocationOffset());
+ if (invocationElement.getElementType() == IJavaElement.TYPE) {
+ final ITypedRegion region = new TypedRegion(javaContext.getInvocationOffset(), 0, null);
+ proposals.add(new MethodParametersCompletionProposal("Foo !", new StyledString("Foo!"), region, icon, (IMember) invocationElement));
+ }
+ } catch (Exception e) {
+ Logger.error("Failed to compute completion proposal", e);
+ }
+ return proposals;
+ }
+
+ /**
+ * Resolves the typed region for the given java content assist invocation context.
+ *
+ * @param javaContext
+ * the java content assist invocation context
+ * @return the typed region
+ */
+ private ITypedRegion getRegion(final JavaContentAssistInvocationContext javaContext) {
+ IDocument document = javaContext.getDocument();
+ IDocumentPartitioner documentPartitioner = ((IDocumentExtension3) document)
+ .getDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING);
+ return documentPartitioner.getPartition(javaContext.getInvocationOffset());
+ }
+
+
+
+ /** {@inheritDoc} */
+ @Override
+ public final List<IContextInformation> computeContextInformation(final ContentAssistInvocationContext context,
+ final IProgressMonitor monitor) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public final String getErrorMessage() {
+ return null;
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/contentassist/MethodParametersCompletionProposalComputer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/Logger.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/Logger.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/Logger.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -30,6 +30,9 @@
/** The debug name, matching the .options file. */
private static final String DEBUG = JBossJaxrsUIPlugin.PLUGIN_ID + "/debug";
+ /** The trace name, matching the .options file. */
+ private static final String TRACE = JBossJaxrsUIPlugin.PLUGIN_ID + "/trace";
+
private static final ThreadLocal<DateFormat> dateFormatter = new ThreadLocal<DateFormat>() {
@Override
protected DateFormat initialValue() {
@@ -101,27 +104,50 @@
}
/**
- * Outputs a debug message in the trace file (not the error view of the
- * runtime workbench). Traces must be activated for this plugin in order to
- * see the output messages.
+ * Outputs a 'debug' level message in the .log file (not the error view of
+ * the runtime workbench). Traces must be activated for this plugin in order
+ * to see the output messages.
*
* @param message
* the message to trace.
*/
public static void debug(final String message, Object... items) {
- String debugOption = Platform.getDebugOption(DEBUG);
- String valuedMessage = message;
- if (JBossJaxrsUIPlugin.getDefault() != null && JBossJaxrsUIPlugin.getDefault().isDebugging()
- && "true".equalsIgnoreCase(debugOption)) {
- if (items != null) {
- for (Object item : items) {
- valuedMessage = valuedMessage.replaceFirst("\\{\\}", (item != null ? item.toString() : "null"));
+ log(DEBUG, message, items);
+ }
+
+ /**
+ * Outputs a 'trace' level message in the .log file (not the error view of
+ * the runtime workbench). Traces must be activated for this plugin in order
+ * to see the output messages.
+ *
+ * @param message
+ * the message to trace.
+ */
+ public static void trace(final String message, final Object... items) {
+ log(TRACE, message, items);
+ }
+
+ private static void log(final String level, final String message, final Object... items) {
+ try {
+ String debugOption = Platform.getDebugOption(level);
+ String valuedMessage = message;
+ if (JBossJaxrsUIPlugin.getDefault() != null && JBossJaxrsUIPlugin.getDefault().isDebugging()
+ && "true".equalsIgnoreCase(debugOption)) {
+ if (items != null) {
+ for (Object item : items) {
+ valuedMessage = valuedMessage.replaceFirst("\\{\\}", (item != null ? item.toString()
+ .replaceAll("\\$", ".") : "null"));
+ }
}
+ System.out.println(dateFormatter.get().format(new Date()) + " [" + Thread.currentThread().getName()
+ + "] " + valuedMessage);
}
- System.out.println(dateFormatter.get().format(new Date()) + " [" + Thread.currentThread().getName() + "] "
- + valuedMessage);
+ } catch (RuntimeException e) {
+ System.err.println("Failed to write proper debug message with template:\n " + message + "\n and items:");
+ for (Object item : items) {
+ System.err.println(" " + item);
+ }
}
-
}
}
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/resources/web-2_3-with-servlet-mapping.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/resources/web-2_3-with-servlet-mapping.xml 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/resources/web-2_3-with-servlet-mapping.xml 2012-02-08 21:06:10 UTC (rev 38524)
@@ -4,6 +4,9 @@
"http://java.sun.com/dtd/web-app_2_3.dtd">
<!-- A sample web.xml file validated by the web-app DTD in version 2.3 -->
<web-app>
+ <servlet>
+ <servlet-class></servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/hello/*</url-pattern>
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessorTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessorTestCase.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JavaElementChangedProcessorTestCase.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -1874,9 +1874,9 @@
metamodel.add(resource);
// JAX-RS Resource Method
final IMethod method = getMethod(type, "getCustomer");
- final JavaMethodParameter pathParameter = new JavaMethodParameter("id", Integer.class.getName(), null);
+ final JavaMethodParameter pathParameter = new JavaMethodParameter("id", Integer.class.getName(), null, null);
final JavaMethodParameter contextParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(),
- Arrays.asList(createAnnotation(Context.class, null)));
+ Arrays.asList(createAnnotation(Context.class, null)), null);
final JaxrsResourceMethod resourceMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class))
.returnType(getType(Response.class.getName(), javaProject)).methodParameter(pathParameter)
@@ -1907,9 +1907,9 @@
// JAX-RS Resource Method
final IMethod method = getMethod(type, "getCustomer");
final JavaMethodParameter pathParameter = new JavaMethodParameter("id", Integer.class.getName(),
- Arrays.asList(createAnnotation(PathParam.class, "foo!")));
+ Arrays.asList(createAnnotation(PathParam.class, "foo!")), null);
final JavaMethodParameter contextParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(),
- Arrays.asList(createAnnotation(Context.class, null)));
+ Arrays.asList(createAnnotation(Context.class, null)), null);
final JaxrsResourceMethod resourceMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class))
.returnType(getType(Response.class.getName(), javaProject)).methodParameter(pathParameter)
@@ -1940,10 +1940,10 @@
// JAX-RS Resource Method
final IMethod method = getMethod(type, "updateCustomer");
final JavaMethodParameter pathParameter = new JavaMethodParameter("id", Integer.class.getName(),
- Arrays.asList(createAnnotation(PathParam.class, "id")));
+ Arrays.asList(createAnnotation(PathParam.class, "id")), null);
final JavaMethodParameter customerParameter = new JavaMethodParameter("update",
"org.jboss.tools.ws.jaxrs.sample.services.CustomerResource", Arrays.asList(createAnnotation(
- PathParam.class, "foo")));
+ PathParam.class, "foo")), null);
final JaxrsResourceMethod resourceMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, PUT.class)).returnType(getType("void", javaProject))
.methodParameter(pathParameter).methodParameter(customerParameter).build();
@@ -1973,9 +1973,9 @@
// JAX-RS Resource Method (size param is not declared)
final IMethod method = getMethod(type, "getCustomers");
final JavaMethodParameter startParameter = new JavaMethodParameter("start", "int",
- Arrays.asList(createAnnotation(QueryParam.class, "start")));
+ Arrays.asList(createAnnotation(QueryParam.class, "start")), null);
final JavaMethodParameter uriInfoParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(),
- Arrays.asList(createAnnotation(Context.class, null)));
+ Arrays.asList(createAnnotation(Context.class, null)), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class)).returnType(getType("java.util.List", javaProject))
.methodParameter(startParameter).methodParameter(uriInfoParameter).build();
@@ -2006,7 +2006,7 @@
// JAX-RS Resource Method (color param is not declared)
final IMethod method = getMethod(type, "getPicture");
final JavaMethodParameter pathParameter = new JavaMethodParameter("id", String.class.getName(),
- Arrays.asList(createAnnotation(PathParam.class, null)));
+ Arrays.asList(createAnnotation(PathParam.class, null)), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.pathTemplate(getAnnotation(method, Path.class)).methodParameter(pathParameter)
.returnType(getType("java.lang.Object", javaProject)).build();
@@ -2037,11 +2037,11 @@
// JAX-RS Resource Method (@QueryParam on 'size' param is not declared)
final IMethod method = getMethod(type, "getCustomers");
final JavaMethodParameter startParameter = new JavaMethodParameter("start", "int",
- Arrays.asList(createAnnotation(QueryParam.class, "start")));
+ Arrays.asList(createAnnotation(QueryParam.class, "start")), null);
final JavaMethodParameter sizeParameter = new JavaMethodParameter("size", "int",
- Arrays.asList(createAnnotation(DefaultValue.class, "2")));
+ Arrays.asList(createAnnotation(DefaultValue.class, "2")), null);
final JavaMethodParameter uriInfoParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(),
- Arrays.asList(createAnnotation(Context.class, null)));
+ Arrays.asList(createAnnotation(Context.class, null)), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class)).returnType(getType("java.util.List", javaProject))
.methodParameter(startParameter).methodParameter(sizeParameter).methodParameter(uriInfoParameter)
@@ -2073,11 +2073,11 @@
// "size" on second param)
final IMethod method = getMethod(type, "getCustomers");
final JavaMethodParameter startParameter = new JavaMethodParameter("start", "int",
- Arrays.asList(createAnnotation(QueryParam.class, "start")));
+ Arrays.asList(createAnnotation(QueryParam.class, "start")), null);
final JavaMethodParameter sizeParameter = new JavaMethodParameter("size", "int", Arrays.asList(
- createAnnotation(QueryParam.class, "length"), createAnnotation(DefaultValue.class, "2")));
+ createAnnotation(QueryParam.class, "length"), createAnnotation(DefaultValue.class, "2")), null);
final JavaMethodParameter uriInfoParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(),
- Arrays.asList(createAnnotation(Context.class, null)));
+ Arrays.asList(createAnnotation(Context.class, null)), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class)).returnType(getType("java.util.List", javaProject))
.methodParameter(startParameter).methodParameter(sizeParameter).methodParameter(uriInfoParameter)
@@ -2108,11 +2108,11 @@
// JAX-RS Resource Method (with an extra @Queryparam annotation on 'uriInfo' param)
final IMethod method = getMethod(type, "getCustomers");
final JavaMethodParameter startParameter = new JavaMethodParameter("start", "int",
- Arrays.asList(createAnnotation(QueryParam.class, "start")));
+ Arrays.asList(createAnnotation(QueryParam.class, "start")), null);
final JavaMethodParameter sizeParameter = new JavaMethodParameter("size", "int", Arrays.asList(
- createAnnotation(QueryParam.class, "size"), createAnnotation(DefaultValue.class, "2")));
+ createAnnotation(QueryParam.class, "size"), createAnnotation(DefaultValue.class, "2")), null);
final JavaMethodParameter uriInfoParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(),
- Arrays.asList(createAnnotation(QueryParam.class, "foo"), createAnnotation(Context.class, null)));
+ Arrays.asList(createAnnotation(QueryParam.class, "foo"), createAnnotation(Context.class, null)), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class)).returnType(getType("java.util.List", javaProject))
.methodParameter(startParameter).methodParameter(sizeParameter).methodParameter(uriInfoParameter)
@@ -2143,9 +2143,9 @@
// JAX-RS Resource Method (MatrixParam annotation on second parameter is not declared)
final IMethod method = getMethod(type, "getPicture");
final JavaMethodParameter startParameter = new JavaMethodParameter("id", Integer.class.getName(),
- Arrays.asList(createAnnotation(PathParam.class, "id")));
+ Arrays.asList(createAnnotation(PathParam.class, "id")), null);
final JavaMethodParameter sizeParameter = new JavaMethodParameter("color", String.class.getName(),
- new ArrayList<Annotation>());
+ new ArrayList<Annotation>(), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class)).returnType(getType("java.lang.Object", javaProject))
.methodParameter(startParameter).methodParameter(sizeParameter).build();
@@ -2175,9 +2175,9 @@
// JAX-RS Resource Method (MatrixParam value is different: "foo" vs "color" on second param)
final IMethod method = getMethod(type, "getPicture");
final JavaMethodParameter startParameter = new JavaMethodParameter("id", Integer.class.getName(),
- Arrays.asList(createAnnotation(PathParam.class, "id")));
+ Arrays.asList(createAnnotation(PathParam.class, "id")), null);
final JavaMethodParameter sizeParameter = new JavaMethodParameter("color", String.class.getName(),
- Arrays.asList(createAnnotation(MatrixParam.class, "foo")));
+ Arrays.asList(createAnnotation(MatrixParam.class, "foo")), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class)).returnType(getType("java.lang.Object", javaProject))
.methodParameter(startParameter).methodParameter(sizeParameter).build();
@@ -2207,7 +2207,7 @@
// JAX-RS Resource Method (an extra MatrixParam annotation on 'id' param)
final IMethod method = getMethod(type, "getProduct");
final JavaMethodParameter pathParameter = new JavaMethodParameter("id", Integer.class.getName(), Arrays.asList(
- createAnnotation(MatrixParam.class, "foo"), createAnnotation(PathParam.class, "id")));
+ createAnnotation(MatrixParam.class, "foo"), createAnnotation(PathParam.class, "id")), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class))
.returnType(getType("org.jboss.tools.ws.jaxrs.sample.domain.Book", javaProject))
@@ -2239,11 +2239,11 @@
// 'javax.ws.rs.Response')
final IMethod method = getMethod(type, "getCustomers");
final JavaMethodParameter startParameter = new JavaMethodParameter("start", "int",
- Arrays.asList(createAnnotation(QueryParam.class, "start")));
+ Arrays.asList(createAnnotation(QueryParam.class, "start")), null);
final JavaMethodParameter sizeParameter = new JavaMethodParameter("size", "int", Arrays.asList(
- createAnnotation(QueryParam.class, "size"), createAnnotation(DefaultValue.class, "2")));
+ createAnnotation(QueryParam.class, "size"), createAnnotation(DefaultValue.class, "2")), null);
final JavaMethodParameter uriInfoParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(),
- Arrays.asList(createAnnotation(Context.class, null)));
+ Arrays.asList(createAnnotation(Context.class, null)), null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.httpMethod(getAnnotation(method, GET.class))
.returnType(getType(Response.class.getName(), javaProject)).methodParameter(startParameter)
@@ -2278,10 +2278,10 @@
// JAX-RS Resource Method (@Context is not declared on 'uriInfo' param)
final IMethod method = getMethod(type, "getCustomers");
final JavaMethodParameter startParameter = new JavaMethodParameter("start", "int",
- Arrays.asList(createAnnotation(QueryParam.class, "start")));
+ Arrays.asList(createAnnotation(QueryParam.class, "start")), null);
final JavaMethodParameter sizeParameter = new JavaMethodParameter("size", "int", Arrays.asList(
- createAnnotation(QueryParam.class, "length"), createAnnotation(DefaultValue.class, "2")));
- final JavaMethodParameter uriInfoParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(), null);
+ createAnnotation(QueryParam.class, "length"), createAnnotation(DefaultValue.class, "2")), null);
+ final JavaMethodParameter uriInfoParameter = new JavaMethodParameter("uriInfo", UriInfo.class.getName(), null, null);
final JaxrsResourceMethod jaxrsMethod = new JaxrsResourceMethod.Builder(method, resource, metamodel)
.methodParameter(startParameter).methodParameter(sizeParameter).methodParameter(uriInfoParameter)
.build();
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessorTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessorTestCase.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelChangedProcessorTestCase.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -120,8 +120,8 @@
return httpMethod;
}
- private JaxrsEndpoint createEndpoint(JaxrsJavaApplication application, JaxrsHttpMethod httpMethod, JaxrsResourceMethod... resourceMethods) {
- JaxrsEndpoint endpoint = new JaxrsEndpoint(application, httpMethod, new LinkedList<JaxrsResourceMethod>(
+ private JaxrsEndpoint createEndpoint(JaxrsMetamodel metamodel, JaxrsHttpMethod httpMethod, JaxrsResourceMethod... resourceMethods) {
+ JaxrsEndpoint endpoint = new JaxrsEndpoint(metamodel, httpMethod, new LinkedList<JaxrsResourceMethod>(
Arrays.asList(resourceMethods)));
metamodel.add(endpoint);
return endpoint;
@@ -382,7 +382,7 @@
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("getCustomer", customerResource,
GET.class);
- final JaxrsEndpoint endpoint = createEndpoint(application, httpMethod, customerResourceMethod);
+ final JaxrsEndpoint endpoint = createEndpoint(metamodel, httpMethod, customerResourceMethod);
assertThat(endpoint.getUriPathTemplate(), equalTo("/app/customers/{id}"));
// operation
final Annotation annotation = getAnnotation(application.getJavaElement(), ApplicationPath.class, "/foo");
@@ -503,7 +503,7 @@
final JaxrsResource customerResource = createResource("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
final JaxrsResourceMethod customerResourceMethod = createResourceMethod("getCustomer", customerResource,
GET.class);
- final JaxrsEndpoint endpoint = createEndpoint(application, httpMethod, customerResourceMethod);
+ final JaxrsEndpoint endpoint = createEndpoint(metamodel, httpMethod, customerResourceMethod);
assertThat(endpoint.getUriPathTemplate(), equalTo("/app/customers/{id}"));
// operation : no 'application' left in the metamodel
metamodel.remove(application);
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidatorTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidatorTestCase.java 2012-02-08 20:47:32 UTC (rev 38523)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidatorTestCase.java 2012-02-08 21:06:10 UTC (rev 38524)
@@ -83,7 +83,7 @@
// operation
final List<ValidatorMessage> validationMessages = customerResource.validate();
// validation
- assertThat(validationMessages.size(), equalTo(1));
+ assertThat(validationMessages.size(), equalTo(2));
}
}
14 years, 2 months
JBoss Tools SVN: r38523 - in trunk/documentation/guides: MigrationGuide/en-US and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-02-08 15:47:32 -0500 (Wed, 08 Feb 2012)
New Revision: 38523
Added:
trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.ent
trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.xml
Removed:
trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0_Release_Notes.ent
trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0_Release_Notes.xml
Modified:
trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
trunk/documentation/guides/JBDS_Release_Notes/en-US/Features.xml
trunk/documentation/guides/MigrationGuide/en-US/Revision_History.xml
Log:
updated release notes
Added: trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.ent
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.ent (rev 0)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.ent 2012-02-08 20:47:32 UTC (rev 38523)
@@ -0,0 +1,4 @@
+<!ENTITY PRODUCT "JBoss Developer Studio">
+<!ENTITY BOOKID "5.0.0.Beta1_Release_Notes">
+<!ENTITY YEAR "2012">
+<!ENTITY HOLDER "Red Hat">
Property changes on: trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.ent
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.xml (rev 0)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.xml 2012-02-08 20:47:32 UTC (rev 38523)
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='utf-8' ?>
+
+<!-- This article will dsplay the release notes for version 4.0.0, and be found at http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html-single/... -->
+
+<article>
+ <xi:include href="Article_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <xi:include href="Overview.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <xi:include href="Component_Versions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <xi:include href="Features.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ </xi:include>
+ <!-- <xi:include href="Fixed_Issues.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include> -->
+<!-- <xi:include href="Known_Issues.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include> -->
+ <xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+</article>
Property changes on: trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0.Beta1_Release_Notes.xml
___________________________________________________________________
Added: svn:executable
+ *
Deleted: trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0_Release_Notes.ent
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0_Release_Notes.ent 2012-02-08 20:05:55 UTC (rev 38522)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0_Release_Notes.ent 2012-02-08 20:47:32 UTC (rev 38523)
@@ -1,4 +0,0 @@
-<!ENTITY PRODUCT "JBoss Developer Studio">
-<!ENTITY BOOKID "5.0.0_Release_Notes">
-<!ENTITY YEAR "2011">
-<!ENTITY HOLDER "Red Hat">
Deleted: trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0_Release_Notes.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0_Release_Notes.xml 2012-02-08 20:05:55 UTC (rev 38522)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/5.0.0_Release_Notes.xml 2012-02-08 20:47:32 UTC (rev 38523)
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-
-<!-- This article will dsplay the release notes for version 4.0.0, and be found at http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html-single/... -->
-
-<article>
- <xi:include href="Article_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- <xi:include href="Overview.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- <xi:include href="Component_Versions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- <xi:include href="Features.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
- </xi:include>
- <!-- <xi:include href="Fixed_Issues.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include> -->
-<!-- <xi:include href="Known_Issues.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include> -->
- <xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
-</article>
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2012-02-08 20:05:55 UTC (rev 38522)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2012-02-08 20:47:32 UTC (rev 38523)
@@ -3,12 +3,12 @@
<!-- Modify the title tag to change which book will be built -->
<articleinfo>
- <title>5.0.0 Release Notes</title>
+ <title>5.0.0.Beta1 Release Notes</title>
<subtitle>Information about the changes made for this release of the JBoss Developer Studio.</subtitle>
<productname>JBoss Developer Studio</productname>
<productnumber>5.0</productnumber>
<edition>0</edition>
- <pubsnumber>2</pubsnumber>
+ <pubsnumber>1</pubsnumber>
<abstract>
<para>
These release notes contain important information related to the JBoss Developer Studio. New features, known issues, resources, and other current issues are addressed here.
Modified: trunk/documentation/guides/JBDS_Release_Notes/en-US/Features.xml
===================================================================
--- trunk/documentation/guides/JBDS_Release_Notes/en-US/Features.xml 2012-02-08 20:05:55 UTC (rev 38522)
+++ trunk/documentation/guides/JBDS_Release_Notes/en-US/Features.xml 2012-02-08 20:47:32 UTC (rev 38523)
@@ -3,12 +3,33 @@
<title>
Features of version 5.0.0.Beta1
</title>
- <para>
-
- </para>
<!-- <para>
The following list highlights new features that have been added to this release, as well as listing notable bug fixes. You can find a complete list of bug fixes <ulink url="https://issues.jboss.org/browse/JBIDE">here</ulink>.
</para> -->
+ <formalpara>
+ <title>JBoss Central</title>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ JBoss Central is the new central hub for everything from getting started with JBoss, to keeping up with the latest news and even installing or updating JBoss Developer Studio and components.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>JBoss Perspective</title>
+ <para>
+ The JBoss Perspective is designed to incorporate the views most often used by developers using JBoss, while also changing standard menu items to reflect what a JBoss devleoper would want and need.
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>JBoss Enterprise Application Platform 6 tooling</title>
+ <para>
+ The tooling in JBoss Developer Studio 5.0.0.Beta1 works with the early access JBoss Enterprise Application Platform 6.0.0.Alpha2.
+ </para>
+ </formalpara>
<!-- <formalpara>
<title>BPEL</title>
<para>
@@ -21,49 +42,54 @@
</itemizedlist>
</para>
</formalpara> -->
-<!-- <formalpara>
+ <formalpara>
<title>Contexts and Dependency Injection (CDI)</title>
<para>
<itemizedlist>
<listitem>
<para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-9734">JBIDE-9734</ulink>: The CDI validator would treat <property>@Inject</property> and <property>@RestClient("...") ServiceInterface</property> injection as unstatisfied dependencies. This caused an incorrect warning message to appear. To fix the issue, the CDI Seam Core Rest files have been modified to correctly validate <property>@Inject</property> and <property>@RestClient("...") ServiceInterface</property> properties, ensuring the warning message no longer appears.
+ CDI Tools has become a major component for JBoss Developer Studio 5. A new CDI wizard is now available for appropriate project creation.
</para>
</listitem>
+ </itemizedlist>
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>Forge</title>
+ <para>
+ <itemizedlist>
<listitem>
<para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-9685">JBIDE-9685</ulink>: A new feature has been added to the CDI validator making it aware of JMS resource injections. This ensures correct validation of JMS injections that also have a JMS destination.
+ Forge allows you to use the command line to create and manage projects, from within JBoss Developer Studio.
</para>
</listitem>
- </itemizedlist>
- </para>
- </formalpara> -->
- <!-- Deltacloud is only shipped with JBoss.org -->
- <!--
+ </itemizedlist>
+ </para>
+ </formalpara>
<formalpara>
- <title>Deltacloud</title>
+ <title>Hibernate</title>
<para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Tooling for Hibernate 4 is now available within JBoss Developer Studio.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>OpenShift</title>
+ <para>
<itemizedlist>
<listitem>
<para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-0000">JBIDE-0000</ulink>:
+ New tooling is now available that allows you to interact with Red Hats cloud offering as if it were a local server.
</para>
</listitem>
</itemizedlist>
</para>
- </formalpara> -->
- <!-- <formalpara>
- <title>Drools</title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-0000">JBIDE-0000</ulink>:
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </formalpara> -->
+ </formalpara>
<!-- <formalpara>
<title>ESB</title>
<para>
@@ -102,18 +128,6 @@
</itemizedlist>
</para>
</formalpara>-->
- <!--<formalpara>
- <title>jBPM</title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-0000">JBIDE-0000</ulink>:
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </formalpara>-->
<!--<formalpara>
<title>JBoss Enterprise Portal Platform</title>
<para>
@@ -149,21 +163,19 @@
</listitem>
</itemizedlist>
</para>
- </formalpara>-->
- <!-- Include in JBT Release Notes only!!! -->
- <!--
+ </formalpara>-->
<formalpara>
<title>Maven</title>
<para>
<itemizedlist>
<listitem>
<para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-0000">JBIDE-0000</ulink>:
+ Maven is now a major component of JBoss Developer Studio 5. Creating a Maven-ready project allows you to utilize remote resources from Maven repositories.
</para>
</listitem>
</itemizedlist>
</para>
- </formalpara> -->
+ </formalpara>
<!--<formalpara>
<title>Portlet</title>
Modified: trunk/documentation/guides/MigrationGuide/en-US/Revision_History.xml
===================================================================
--- trunk/documentation/guides/MigrationGuide/en-US/Revision_History.xml 2012-02-08 20:05:55 UTC (rev 38522)
+++ trunk/documentation/guides/MigrationGuide/en-US/Revision_History.xml 2012-02-08 20:47:32 UTC (rev 38523)
@@ -6,7 +6,7 @@
<simpara>
<revhistory>
<revision>
- <revnumber>2</revnumber>
+ <revnumber>1-2</revnumber>
<date>Wed Jan 12 2011</date>
<author>
<firstname>Matthew</firstname>
@@ -20,7 +20,7 @@
</revdescription>
</revision>
<revision>
- <revnumber>1</revnumber>
+ <revnumber>1-1</revnumber>
<date>Wed Jun 09 2010</date>
<author>
<firstname>JBoss Tools</firstname>
@@ -34,7 +34,7 @@
</revdescription>
</revision>
<revision>
- <revnumber>0</revnumber>
+ <revnumber>1-0</revnumber>
<date>Fri Nov 20 2009</date>
<author>
<firstname>Isaac</firstname>
14 years, 2 months
JBoss Tools SVN: r38522 - in trunk/cdi/plugins: org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-02-08 15:05:55 -0500 (Wed, 08 Feb 2012)
New Revision: 38522
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
Log:
Wizard 'Specify CDI Bean for the Injection Point' does not compute correctly condition 'can finish' https://issues.jboss.org/browse/JBIDE-10637
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java 2012-02-08 18:45:50 UTC (rev 38521)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java 2012-02-08 20:05:55 UTC (rev 38522)
@@ -361,7 +361,7 @@
}else{
vq = new ValuedQualifier(q);
}
- if(vq.equals(valuedQualifier)){
+ if(vq.fullyEquals(valuedQualifier)){
return true;
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java 2012-02-08 18:45:50 UTC (rev 38521)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java 2012-02-08 20:05:55 UTC (rev 38522)
@@ -165,6 +165,13 @@
@Override
public boolean equals(Object obj) {
if(obj instanceof ValuedQualifier && getQualifier().getSourceType().getFullyQualifiedName().equals(((ValuedQualifier)obj).getQualifier().getSourceType().getFullyQualifiedName())){
+ return true;
+ }
+ return false;
+ }
+
+ public boolean fullyEquals(Object obj) {
+ if(obj instanceof ValuedQualifier && getQualifier().getSourceType().getFullyQualifiedName().equals(((ValuedQualifier)obj).getQualifier().getSourceType().getFullyQualifiedName())){
for(Pair pair : ((ValuedQualifier)obj).getValuePairs()){
if(!pair.value.equals(getValue(pair.name)) || pair.value == null){
return false;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java 2012-02-08 18:45:50 UTC (rev 38521)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java 2012-02-08 20:05:55 UTC (rev 38522)
@@ -26,7 +26,6 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
import org.eclipse.swt.SWT;
@@ -175,7 +174,7 @@
public void setDefaultSelection(){
if(getBeans().size() > 0){
- IBean defaultBean = getBeans().get(0);
+ IBean defaultBean = (IBean)tableViewer.getTable().getItem(0).getData();
tableViewer.setSelection(new StructuredSelection(defaultBean));
tableViewer.getTable().select(0);
addQualifiersPage.init(defaultBean);
14 years, 2 months
JBoss Tools SVN: r38521 - in trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target: classes/org/jboss/ide/eclipse/as/dmr and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-02-08 13:45:50 -0500 (Wed, 08 Feb 2012)
New Revision: 38521
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/classes/org/jboss/ide/eclipse/as/dmr/Activator.class
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/local-artifacts.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/maven-archiver/pom.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/org.jboss.ide.eclipse.as.dmr-2.3.0-SNAPSHOT-sources.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/org.jboss.ide.eclipse.as.dmr-2.3.0-SNAPSHOT.jar
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2artifacts.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2content.xml
Log:
remove target/ folder from SVN
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/MANIFEST.MF 2012-02-08 18:43:56 UTC (rev 38520)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/MANIFEST.MF 2012-02-08 18:45:50 UTC (rev 38521)
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.core.runtime
-Export-Package: org.jboss.dmr
-Bundle-Vendor: JBoss by Red Hat
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: jboss-dmr-1.1.1.Final.jar,.
-Bundle-Version: 2.3.0.v20120207-1253-Beta1
-Bundle-Name: JBoss AS Server Adapter Dynamic Model Representation
-Bundle-Activator: org.jboss.ide.eclipse.as.dmr.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.jboss.ide.eclipse.as.dmr;singleton:=true
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/classes/org/jboss/ide/eclipse/as/dmr/Activator.class
===================================================================
(Binary files differ)
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/local-artifacts.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/local-artifacts.properties 2012-02-08 18:43:56 UTC (rev 38520)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/local-artifacts.properties 2012-02-08 18:45:50 UTC (rev 38521)
@@ -1,5 +0,0 @@
-#Tue Feb 07 20:55:06 CST 2012
-artifact.attached.p2metadata=/home/rob/code/jbtools/jbosstools/trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2content.xml
-artifact.main=/home/rob/code/jbtools/jbosstools/trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/org.jboss.ide.eclipse.as.dmr-2.3.0-SNAPSHOT.jar
-artifact.attached.sources=/home/rob/code/jbtools/jbosstools/trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/org.jboss.ide.eclipse.as.dmr-2.3.0-SNAPSHOT-sources.jar
-artifact.attached.p2artifacts=/home/rob/code/jbtools/jbosstools/trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2artifacts.xml
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/maven-archiver/pom.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/maven-archiver/pom.properties 2012-02-08 18:43:56 UTC (rev 38520)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/maven-archiver/pom.properties 2012-02-08 18:45:50 UTC (rev 38521)
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Tue Feb 07 20:55:06 CST 2012
-version=2.3.0-SNAPSHOT
-groupId=org.jboss.tools.as.plugins
-artifactId=org.jboss.ide.eclipse.as.dmr
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/org.jboss.ide.eclipse.as.dmr-2.3.0-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/org.jboss.ide.eclipse.as.dmr-2.3.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2artifacts.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2artifacts.xml 2012-02-08 18:43:56 UTC (rev 38520)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2artifacts.xml 2012-02-08 18:45:50 UTC (rev 38521)
@@ -1,25 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<?artifactRepository version='1.1.0'?>
-<artifacts size='2'>
- <artifact classifier='osgi.bundle' id='org.jboss.ide.eclipse.as.dmr' version='2.3.0.v20120207-1253-Beta1'>
- <properties size='6'>
- <property name='artifact.size' value='89326'/>
- <property name='download.size' value='89326'/>
- <property name='download.md5' value='cbbe512a983b75c00d23f874571dcae0'/>
- <property name='maven-groupId' value='org.jboss.tools.as.plugins'/>
- <property name='maven-artifactId' value='org.jboss.ide.eclipse.as.dmr'/>
- <property name='maven-version' value='2.3.0-SNAPSHOT'/>
- </properties>
- </artifact>
- <artifact classifier='osgi.bundle' id='org.jboss.ide.eclipse.as.dmr.source' version='2.3.0.v20120207-1253-Beta1'>
- <properties size='7'>
- <property name='artifact.size' value='1371'/>
- <property name='download.size' value='1371'/>
- <property name='download.md5' value='5f2ffaddf15f39e5e33fb5b17d277e92'/>
- <property name='maven-groupId' value='org.jboss.tools.as.plugins'/>
- <property name='maven-artifactId' value='org.jboss.ide.eclipse.as.dmr'/>
- <property name='maven-version' value='2.3.0-SNAPSHOT'/>
- <property name='maven-classifier' value='sources'/>
- </properties>
- </artifact>
-</artifacts>
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2content.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2content.xml 2012-02-08 18:43:56 UTC (rev 38520)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/p2content.xml 2012-02-08 18:45:50 UTC (rev 38521)
@@ -1,58 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<units size='2'>
- <unit id='org.jboss.ide.eclipse.as.dmr' version='2.3.0.v20120207-1253-Beta1'>
- <update id='org.jboss.ide.eclipse.as.dmr' range='[0.0.0,2.3.0.v20120207-1253-Beta1)' severity='0'/>
- <properties size='5'>
- <property name='org.eclipse.equinox.p2.name' value='JBoss AS Server Adapter Dynamic Model Representation'/>
- <property name='org.eclipse.equinox.p2.provider' value='JBoss by Red Hat'/>
- <property name='maven-groupId' value='org.jboss.tools.as.plugins'/>
- <property name='maven-artifactId' value='org.jboss.ide.eclipse.as.dmr'/>
- <property name='maven-version' value='2.3.0-SNAPSHOT'/>
- </properties>
- <provides size='4'>
- <provided namespace='org.eclipse.equinox.p2.iu' name='org.jboss.ide.eclipse.as.dmr' version='2.3.0.v20120207-1253-Beta1'/>
- <provided namespace='osgi.bundle' name='org.jboss.ide.eclipse.as.dmr' version='2.3.0.v20120207-1253-Beta1'/>
- <provided namespace='java.package' name='org.jboss.dmr' version='0.0.0'/>
- <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
- </provides>
- <requires size='1'>
- <required namespace='osgi.bundle' name='org.eclipse.core.runtime' range='0.0.0'/>
- </requires>
- <artifacts size='1'>
- <artifact classifier='osgi.bundle' id='org.jboss.ide.eclipse.as.dmr' version='2.3.0.v20120207-1253-Beta1'/>
- </artifacts>
- <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
- <touchpointData size='1'>
- <instructions size='1'>
- <instruction key='manifest'>
- Bundle-SymbolicName: org.jboss.ide.eclipse.as.dmr;singleton:=true
Bundle-Version: 2.3.0.v20120207-1253-Beta1

- </instruction>
- </instructions>
- </touchpointData>
- </unit>
- <unit id='org.jboss.ide.eclipse.as.dmr.source' version='2.3.0.v20120207-1253-Beta1' singleton='false'>
- <update id='org.jboss.ide.eclipse.as.dmr.source' range='[0.0.0,2.3.0.v20120207-1253-Beta1)' severity='0'/>
- <properties size='4'>
- <property name='maven-groupId' value='org.jboss.tools.as.plugins'/>
- <property name='maven-artifactId' value='org.jboss.ide.eclipse.as.dmr'/>
- <property name='maven-version' value='2.3.0-SNAPSHOT'/>
- <property name='maven-classifier' value='sources'/>
- </properties>
- <provides size='3'>
- <provided namespace='org.eclipse.equinox.p2.iu' name='org.jboss.ide.eclipse.as.dmr.source' version='2.3.0.v20120207-1253-Beta1'/>
- <provided namespace='osgi.bundle' name='org.jboss.ide.eclipse.as.dmr.source' version='2.3.0.v20120207-1253-Beta1'/>
- <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='source' version='1.0.0'/>
- </provides>
- <artifacts size='1'>
- <artifact classifier='osgi.bundle' id='org.jboss.ide.eclipse.as.dmr.source' version='2.3.0.v20120207-1253-Beta1'/>
- </artifacts>
- <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
- <touchpointData size='1'>
- <instructions size='1'>
- <instruction key='manifest'>
- Bundle-SymbolicName: org.jboss.ide.eclipse.as.dmr.source
Bundle-Version: 2.3.0.v20120207-1253-Beta1

- </instruction>
- </instructions>
- </touchpointData>
- </unit>
-</units>
14 years, 2 months
JBoss Tools SVN: r38520 - trunk/as/plugins/org.jboss.ide.eclipse.as.dmr.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-02-08 13:43:56 -0500 (Wed, 08 Feb 2012)
New Revision: 38520
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/.gitignore
Log:
.gitignore file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/.gitignore
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/.gitignore (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/.gitignore 2012-02-08 18:43:56 UTC (rev 38520)
@@ -0,0 +1 @@
+target
14 years, 2 months