JBoss Tools SVN: r19166 - trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-12-09 16:02:54 -0500 (Wed, 09 Dec 2009)
New Revision: 19166
Modified:
trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF
Log:
remove duplicate Export-Package
Modified: trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF 2009-12-09 20:35:37 UTC (rev 19165)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF 2009-12-09 21:02:54 UTC (rev 19166)
@@ -19,6 +19,5 @@
org.eclipse.jdt.core;bundle-version="3.5.0",
org.eclipse.ltk.core.refactoring;bundle-version="3.5.0",
org.jboss.tools.common;bundle-version="2.0.0"
-Export-Package: org.jboss.tools.common.el.core.test
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
15 years, 1 month
JBoss Tools SVN: r19165 - trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-12-09 15:35:37 -0500 (Wed, 09 Dec 2009)
New Revision: 19165
Modified:
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5433 An exception is thrown when creating mavenized Seam Web project without test project
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java 2009-12-09 18:54:02 UTC (rev 19164)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java 2009-12-09 20:35:37 UTC (rev 19165)
@@ -183,6 +183,9 @@
private void configureTestProject(IDataModel m2FacetModel,
IDataModel seamFacetModel) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(testProjectName);
+ if (project == null || !project.exists()) {
+ return;
+ }
IFile pom = project.getFile(IMavenConstants.POM_FILE_NAME);
IJavaProject javaProject = JavaCore.create(project);
if (!pom.exists()) {
15 years, 1 month
JBoss Tools SVN: r19164 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-09 13:54:02 -0500 (Wed, 09 Dec 2009)
New Revision: 19164
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IDecorator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ITypeDeclaration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2009-12-09 18:43:34 UTC (rev 19163)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2009-12-09 18:54:02 UTC (rev 19164)
@@ -37,5 +37,10 @@
*/
IMember getParentMember();
- public IType getType();
+ /**
+ * Returns the corresponding IType of the annotation.
+ *
+ * @return the corresponding IType of the annotation
+ */
+ IType getType();
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IDecorator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IDecorator.java 2009-12-09 18:43:34 UTC (rev 19163)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IDecorator.java 2009-12-09 18:54:02 UTC (rev 19164)
@@ -12,8 +12,6 @@
import java.util.Set;
-import org.eclipse.jdt.core.IType;
-
/**
* Represents a decorator.
*
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2009-12-09 18:43:34 UTC (rev 19163)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2009-12-09 18:54:02 UTC (rev 19164)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.core;
import org.eclipse.jdt.core.IType;
@@ -2,2 +12,8 @@
+/**
+ * Represents a wrapper for IType object which could be parameted.
+ * For example if we have some method
+ * List<String> getList() {...}
+ * then IParametedType for return type of this method will wrap List<> and its signature.
+ */
public interface IParametedType {
@@ -12,9 +28,9 @@
IType getType();
/**
- * Returns signature of the declaration
+ * Returns signature of the declaration.
*
* @return signature of the declaration
*/
public String getSignature();
-}
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ITypeDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ITypeDeclaration.java 2009-12-09 18:43:34 UTC (rev 19163)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ITypeDeclaration.java 2009-12-09 18:54:02 UTC (rev 19164)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.cdi.core;
-import org.eclipse.jdt.core.IType;
import org.jboss.tools.common.text.ITextSourceReference;
/**
15 years, 1 month
JBoss Tools SVN: r19163 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-09 13:43:34 -0500 (Wed, 09 Dec 2009)
New Revision: 19163
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/TypeDeclaration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2009-12-09 18:31:16 UTC (rev 19162)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2009-12-09 18:43:34 UTC (rev 19163)
@@ -12,6 +12,8 @@
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
* Represents an annotation declaration. For example a qualifier or a scope
@@ -19,7 +21,7 @@
*
* @author Alexey Kazakov
*/
-public interface IAnnotationDeclaration extends ITypeDeclaration {
+public interface IAnnotationDeclaration extends ITextSourceReference {
/**
* Return the annotation declaration.
@@ -34,4 +36,6 @@
* @return the member which is annotated by this declaration
*/
IMember getParentMember();
+
+ public IType getType();
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2009-12-09 18:31:16 UTC (rev 19162)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2009-12-09 18:43:34 UTC (rev 19163)
@@ -10,4 +10,11 @@
* @return the corresponding IType of the declaration.
*/
IType getType();
+
+ /**
+ * Returns signature of the declaration
+ *
+ * @return signature of the declaration
+ */
+ public String getSignature();
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2009-12-09 18:31:16 UTC (rev 19162)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2009-12-09 18:43:34 UTC (rev 19163)
@@ -61,6 +61,7 @@
return annotationTypeName;
}
+
public IType getType() {
return type;
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java 2009-12-09 18:43:34 UTC (rev 19163)
@@ -0,0 +1,24 @@
+package org.jboss.tools.cdi.internal.core.impl;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IParametedType;
+
+public class ParametedType implements IParametedType {
+ protected IType type;
+ protected String signature;
+
+ public ParametedType() {}
+
+ public IType getType() {
+ return type;
+ }
+
+ public String getSignature() {
+ return signature;
+ }
+
+ public void setSignature(String signature) {
+ this.signature = signature;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/TypeDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/TypeDeclaration.java 2009-12-09 18:31:16 UTC (rev 19162)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/TypeDeclaration.java 2009-12-09 18:43:34 UTC (rev 19163)
@@ -3,8 +3,7 @@
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.ITypeDeclaration;
-public class TypeDeclaration implements ITypeDeclaration {
- IType type;
+public class TypeDeclaration extends ParametedType implements ITypeDeclaration {
int length;
int startPosition;
@@ -16,10 +15,6 @@
this.startPosition = startPosition;
}
- public IType getType() {
- return type;
- }
-
public int getLength() {
return length;
}
15 years, 1 month
JBoss Tools SVN: r19162 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/el and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-09 13:31:16 -0500 (Wed, 09 Dec 2009)
New Revision: 19162
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java
Removed:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IDecorator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ITypeDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Deleted: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -1,20 +0,0 @@
-package org.jboss.tools.cdi.core;
-
-import java.util.Set;
-import org.eclipse.jdt.core.IType;
-import org.jboss.tools.cdi.internal.core.impl.ClassBean;
-import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
-
-public class DecoratorBean extends ClassBean implements IDecorator {
-
- public DecoratorBean() {}
-
- public Set<IType> getDecoratedTypes() {
- return ((TypeDefinition)definition).getInheritedTypes();
- }
-
- public IAnnotationDeclaration getDecoratorAnnotation() {
- return decorator;
- }
-
-}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBean.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -53,7 +53,7 @@
*
* @return the legal types
*/
- Set<IType> getLegalTypes();
+ Set<IParametedType> getLegalTypes();
/**
* Obtains all the type declarations of the bean class or producer method or
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IDecorator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IDecorator.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IDecorator.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -33,5 +33,5 @@
*
* @return the set of decorated types
*/
- Set<IType> getDecoratedTypes();
+ Set<IParametedType> getDecoratedTypes();
}
\ No newline at end of file
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -0,0 +1,13 @@
+package org.jboss.tools.cdi.core;
+
+import org.eclipse.jdt.core.IType;
+
+public interface IParametedType {
+
+ /**
+ * Returns the corresponding IType of the declaration.
+ *
+ * @return the corresponding IType of the declaration.
+ */
+ IType getType();
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParametedType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ITypeDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ITypeDeclaration.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ITypeDeclaration.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -16,12 +16,6 @@
/**
* @author Alexey Kazakov
*/
-public interface ITypeDeclaration extends ITextSourceReference {
+public interface ITypeDeclaration extends IParametedType, ITextSourceReference {
- /**
- * Returns the corresponding IType of the declaration.
- *
- * @return the corresponding IType of the declaration.
- */
- IType getType();
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -33,6 +33,7 @@
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.common.EclipseUtil;
@@ -167,7 +168,7 @@
return Collections.emptySet();
}
- public Set<IType> getLegalTypes() {
+ public Set<IParametedType> getLegalTypes() {
return Collections.emptySet();
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -18,6 +18,7 @@
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
import org.jboss.tools.cdi.core.IObserverMethod;
+import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IProducer;
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
@@ -142,8 +143,8 @@
return result;
}
- public Set<IType> getLegalTypes() {
- // TODO Auto-generated method stub
+ public Set<IParametedType> getLegalTypes() {
+ // TODO
return null;
}
Copied: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java (from rev 19160, trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java)
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -0,0 +1,22 @@
+package org.jboss.tools.cdi.internal.core.impl;
+
+import java.util.Set;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IDecorator;
+import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+
+public class DecoratorBean extends ClassBean implements IDecorator {
+
+ public DecoratorBean() {}
+
+ public Set<IParametedType> getDecoratedTypes() {
+ return ((TypeDefinition)definition).getInheritedTypes();
+ }
+
+ public IAnnotationDeclaration getDecoratorAnnotation() {
+ return decorator;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DecoratorBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -14,6 +14,7 @@
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IProducerField;
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
@@ -47,7 +48,7 @@
return new HashSet<IInjectionPoint>();
}
- public Set<IType> getLegalTypes() {
+ public Set<IParametedType> getLegalTypes() {
// TODO
return null;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -13,6 +13,7 @@
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IProducerMethod;
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
@@ -53,7 +54,7 @@
return new HashSet<IInjectionPoint>();
}
- public Set<IType> getLegalTypes() {
+ public Set<IParametedType> getLegalTypes() {
// TODO Auto-generated method stub
return null;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java 2009-12-09 18:30:18 UTC (rev 19161)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java 2009-12-09 18:31:16 UTC (rev 19162)
@@ -5,12 +5,13 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
public class AbstractTypeDefinition extends AbstractMemberDefinition {
protected String qualifiedName;
protected IType type;
- protected Set<IType> inheritedTypes = new HashSet<IType>();
+ protected Set<IParametedType> inheritedTypes = new HashSet<IParametedType>();
public AbstractTypeDefinition() {}
@@ -33,10 +34,12 @@
qualifiedName = getType().getFullyQualifiedName();
String sc = type.getSuperclassTypeSignature();
if(sc != null) {
+ //TODO process parameter types correctly!!!
sc = EclipseJavaUtil.resolveType(contextType, sc);
if(sc != null && sc.length() > 0) {
IType t = EclipseJavaUtil.findType(contextType.getJavaProject(), sc);
- if(t != null) inheritedTypes.add(t);
+//TODO
+// if(t != null) inheritedTypes.add(t);
}
}
String[] is = type.getSuperInterfaceTypeSignatures();
@@ -44,12 +47,13 @@
String c = EclipseJavaUtil.resolveType(contextType, is[i]);
if(c != null && c.length() > 0) {
IType t = EclipseJavaUtil.findType(contextType.getJavaProject(), c);
- if(t != null) inheritedTypes.add(t);
+//TODO
+// if(t != null) inheritedTypes.add(t);
}
}
}
- public Set<IType> getInheritedTypes() {
+ public Set<IParametedType> getInheritedTypes() {
return inheritedTypes;
}
15 years, 1 month
JBoss Tools SVN: r19160 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-09 13:04:47 -0500 (Wed, 09 Dec 2009)
New Revision: 19160
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMethod.java
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/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -39,4 +39,6 @@
public String SPECIALIZES_ANNOTATION_TYPE_NAME = "javax.enterprise.inject.Specializes";
+ public String DELEGATE_STEREOTYPE_TYPE_NAME = "javax.decorator.Delegate";
+
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -0,0 +1,20 @@
+package org.jboss.tools.cdi.core;
+
+import java.util.Set;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.internal.core.impl.ClassBean;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+
+public class DecoratorBean extends ClassBean implements IDecorator {
+
+ public DecoratorBean() {}
+
+ public Set<IType> getDecoratedTypes() {
+ return ((TypeDefinition)definition).getInheritedTypes();
+ }
+
+ public IAnnotationDeclaration getDecoratorAnnotation() {
+ return decorator;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/DecoratorBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -15,6 +15,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.internal.core.impl.InterceptorBindingElement;
import org.jboss.tools.common.text.INodeReference;
/**
@@ -100,6 +101,23 @@
Set<IType> getStereotypes();
/**
+ * Returns stereotype model element for fully qualified name
+ * of stereotype annotation type
+ * @param qualifiedName
+ * @return stereotype model element for fully qualified name of stereotype annotation type
+ */
+ public IStereotype getStereotype(String qualifiedName);
+
+ /**
+ * Returns interceptor binding model element for fully qualified name
+ * of interceptor binding annotation type
+ * @param qualifiedName
+ * @return Returns interceptor binding model element for fully qualified name
+ * of interceptor binding annotation type
+ */
+ public InterceptorBindingElement getInterceptorBinding(String qualifiedName);
+
+ /**
* Returns the set of observers for an event which is injected by given
* injection point.
*
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -0,0 +1,82 @@
+package org.jboss.tools.cdi.internal.core.impl;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+
+public class AbstractBeanElement extends CDIElement {
+ protected AbstractMemberDefinition definition;
+ protected AnnotationDeclaration named;
+ protected AnnotationDeclaration alternative;
+ protected AnnotationDeclaration specializes;
+ protected AnnotationDeclaration typed;
+ protected AnnotationDeclaration decorator;
+ protected AnnotationDeclaration delegate;
+
+ public AbstractBeanElement() {}
+
+ public void setDefinition(AbstractMemberDefinition definition) {
+ this.definition = definition;
+ setAnnotations(definition.getAnnotations());
+ }
+
+ protected void setAnnotations(List<AnnotationDeclaration> ds) {
+ for (AnnotationDeclaration d: ds) {
+ String typeName = d.getTypeName();
+ if(CDIConstants.NAMED_QUALIFIER_TYPE_NAME.equals(typeName)) {
+ named = d;
+ } else if(CDIConstants.ALTERNATIVE_ANNOTATION_TYPE_NAME.equals(typeName)) {
+ alternative = d;
+ } else if(CDIConstants.SPECIALIZES_ANNOTATION_TYPE_NAME.equals(typeName)) {
+ specializes = d;
+ } else if(CDIConstants.TYPED_ANNOTATION_TYPE_NAME.equals(typeName)) {
+ typed = d;
+ } else if(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME.equals(typeName)) {
+ decorator = d;
+ } else if(CDIConstants.DELEGATE_STEREOTYPE_TYPE_NAME.equals(typeName)) {
+ delegate = d;
+ }
+ }
+ }
+
+ protected AnnotationDeclaration findNamedAnnotation() {
+ if(named != null) return named;
+ Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
+ for (IStereotypeDeclaration d: ds) {
+ StereotypeElement s = (StereotypeElement)d.getStereotype();
+ if(s == null) continue;
+ if(s.getNameDeclaration() != null) return s.getNameDeclaration();
+ }
+ return null;
+ }
+
+ public Set<IStereotypeDeclaration> getStereotypeDeclarations() {
+ Set<IStereotypeDeclaration> result = new HashSet<IStereotypeDeclaration>();
+ for (AnnotationDeclaration d: definition.getAnnotations()) {
+ if(d instanceof IStereotypeDeclaration) {
+ if(d instanceof IStereotypeDeclaration) {
+ result.add((IStereotypeDeclaration)d);
+ }
+ }
+ }
+ return result;
+ }
+
+ public Set<IAnnotationDeclaration> getQualifierDeclarations() {
+ Set<IAnnotationDeclaration> result = new HashSet<IAnnotationDeclaration>();
+ for(AnnotationDeclaration a: definition.getAnnotations()) {
+ int k = getCDIProject().getNature().getDefinitions().getAnnotationKind(a.getType());
+ if(k == AnnotationDefinition.QUALIFIER) {
+ result.add(a);
+ }
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -5,11 +5,13 @@
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
public class AnnotationDeclaration implements IAnnotationDeclaration {
+ protected CDICoreNature project;
protected IAnnotation annotation;
protected int startPosition = -1;
protected int length = 0;
@@ -18,6 +20,19 @@
public AnnotationDeclaration() {}
+ protected void copyTo(AnnotationDeclaration other) {
+ other.project = project;
+ other.annotation = annotation;
+ other.startPosition = startPosition;
+ other.length = length;
+ other.annotationTypeName = annotationTypeName;
+ other.type = type;
+ }
+
+ public void setProject(CDICoreNature project) {
+ this.project = project;
+ }
+
public void setDeclaration(IAnnotation annotation, IType declaringType) {
this.annotation = annotation;
try {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanField.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanField.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -6,15 +6,13 @@
import org.jboss.tools.cdi.internal.core.impl.definition.FieldDefinition;
public class BeanField extends BeanMember implements IBeanField {
- protected FieldDefinition definition;
protected IField field;
public BeanField() {}
public void setDefinition(FieldDefinition definition) {
- this.definition = definition;
+ super.setDefinition(definition);
setField(definition.getField());
- setAnnotations(definition.getAnnotations());
}
public IField getField() {
@@ -30,4 +28,7 @@
return getField();
}
+ public FieldDefinition getDefinition() {
+ return (FieldDefinition)definition;
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMember.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -1,25 +1,18 @@
package org.jboss.tools.cdi.internal.core.impl;
-import java.util.List;
-
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IBeanMember;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
-public abstract class BeanMember extends CDIElement implements IBeanMember {
+public abstract class BeanMember extends AbstractBeanElement implements IBeanMember {
protected IClassBean classBean;
protected ITypeDeclaration typeDeclaration;
- protected AnnotationDeclaration named;
- protected AnnotationDeclaration alternative;
- protected AnnotationDeclaration specializes;
- protected AnnotationDeclaration typed;
public BeanMember() {}
@@ -37,21 +30,6 @@
}
}
- protected void setAnnotations(List<AnnotationDeclaration> ds) {
- for (AnnotationDeclaration d: ds) {
- String typeName = d.getTypeName();
- if(CDIConstants.NAMED_QUALIFIER_TYPE_NAME.equals(typeName)) {
- named = d;
- } else if(CDIConstants.ALTERNATIVE_ANNOTATION_TYPE_NAME.equals(typeName)) {
- alternative = d;
- } else if(CDIConstants.SPECIALIZES_ANNOTATION_TYPE_NAME.equals(typeName)) {
- specializes = d;
- } else if(CDIConstants.TYPED_ANNOTATION_TYPE_NAME.equals(typeName)) {
- typed = d;
- }
- }
- }
-
public IClassBean getClassBean() {
return classBean;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMethod.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/BeanMethod.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -10,15 +10,15 @@
import org.jboss.tools.cdi.internal.core.impl.definition.MethodDefinition;
public class BeanMethod extends BeanMember implements IBeanMethod {
- protected MethodDefinition definition;
protected IMethod method;
+ protected AnnotationDeclaration inject;
public BeanMethod() {}
public void setDefinition(MethodDefinition definition) {
- this.definition = definition;
+ super.setDefinition(definition);
setMethod(definition.getMethod());
- setAnnotations(definition.getAnnotations());
+ inject = definition.getInjectAnnotation();
}
public IMethod getMethod() {
@@ -39,4 +39,7 @@
return new ArrayList<IParameter>();
}
+ public MethodDefinition getDefinition() {
+ return (MethodDefinition)definition;
+ }
}
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 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -17,11 +17,11 @@
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
-import org.jboss.tools.cdi.core.ICDIElement;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IObserverMethod;
+import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
import org.jboss.tools.common.text.INodeReference;
@@ -29,6 +29,7 @@
CDICoreNature n;
Map<String, StereotypeElement> stereotypes = new HashMap<String, StereotypeElement>();
+ Map<String, InterceptorBindingElement> interceptorBindings = new HashMap<String, InterceptorBindingElement>();
public CDIProject() {}
@@ -112,11 +113,8 @@
public Set<IType> getStereotypes() {
Set<IType> result = new HashSet<IType>();
- List<AnnotationDefinition> ds = n.getDefinitions().getAllAnnotations();
- for (AnnotationDefinition d: ds) {
- if(d.getKind() == AnnotationDefinition.STEREOTYPE) {
- result.add(d.getType());
- }
+ for (IStereotype d: stereotypes.values()) {
+ result.add(d.getSourceType());
}
return result;
}
@@ -230,19 +228,33 @@
return stereotypes.get(qualifiedName);
}
- public void rebuildStereotypes() {
+ public InterceptorBindingElement getInterceptorBinding(String qualifiedName) {
+ return interceptorBindings.get(qualifiedName);
+ }
+
+ public void rebuildAnnotationTypes() {
stereotypes.clear();
+ interceptorBindings.clear();
List<AnnotationDefinition> ds = n.getDefinitions().getAllAnnotations();
for (AnnotationDefinition d: ds) {
if(d.getKind() == AnnotationDefinition.STEREOTYPE) {
StereotypeElement s = new StereotypeElement();
s.setDefinition(d);
s.setParent(this);
- IResource r = d.getType().getResource();
+ IPath r = d.getType().getPath();
if(r != null) {
- s.setSourcePath(r.getFullPath());
+ s.setSourcePath(r);
}
stereotypes.put(d.getQualifiedName(), s);
+ } else if(d.getKind() == AnnotationDefinition.INTERCEPTOR_BINDING) {
+ InterceptorBindingElement s = new InterceptorBindingElement();
+ s.setDefinition(d);
+ s.setParent(this);
+ IPath r = d.getType().getPath();
+ if(r != null) {
+ s.setSourcePath(r);
+ }
+ interceptorBindings.put(d.getQualifiedName(), s);
}
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -1,50 +1,119 @@
package org.jboss.tools.cdi.internal.core.impl;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IBeanMethod;
-import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
import org.jboss.tools.cdi.core.IObserverMethod;
import org.jboss.tools.cdi.core.IProducer;
+import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.ITypeDeclaration;
+import org.jboss.tools.cdi.internal.core.impl.definition.FieldDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.MethodDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.common.text.ITextSourceReference;
-public class ClassBean extends CDIElement implements IClassBean {
+public class ClassBean extends AbstractBeanElement implements IClassBean {
+ protected List<BeanField> fields = new ArrayList<BeanField>();
+ protected List<BeanMethod> methods = new ArrayList<BeanMethod>();
public ClassBean() {}
+ public void setDefinition(TypeDefinition definition) {
+ super.setDefinition(definition);
+ setAnnotations(definition.getAnnotations());
+ List<MethodDefinition> ms = definition.getMethods();
+ for (MethodDefinition m: ms) {
+ BeanMethod bm = null;
+ if(m.getProducesAnnotation() != null) {
+ bm = new ProducerMethod();
+ } else {
+ //add observer case
+ bm = new BeanMethod();
+ }
+ bm.setDefinition(m);
+ methods.add(bm);
+ }
+ List<FieldDefinition> fs = definition.getFields();
+ for (FieldDefinition f: fs) {
+ BeanField bf = null;
+ if(f.getProducesAnnotation() != null) {
+ bf = new ProducerField();
+ } else if(f.getInjectAnnotation() != null) {
+ bf = new InjectionPointField();
+ } else {
+ //add observer case
+ bf = new BeanField();
+ }
+ bf.setDefinition(f);
+ fields.add(bf);
+ }
+ }
+
public Set<IBeanMethod> getBeanConstructor() {
- // TODO Auto-generated method stub
- return null;
+ Set<IBeanMethod> result = new HashSet<IBeanMethod>();
+ for (BeanMethod m: methods) {
+ if(m.getDefinition().isConstructor()) {
+ result.add(m);
+ }
+ }
+ return result;
}
public Set<IBeanMethod> getDisposers() {
- // TODO Auto-generated method stub
- return null;
+ // TODO
+ return new HashSet<IBeanMethod>();
}
public Set<IInterceptorBindingDeclaration> getInterceptorBindings() {
- // TODO Auto-generated method stub
- return null;
+ Set<IInterceptorBindingDeclaration> result = new HashSet<IInterceptorBindingDeclaration>();
+ List<AnnotationDeclaration> as = definition.getAnnotations();
+ for (AnnotationDeclaration a: as) {
+ if(a instanceof InterceptorBindingDeclaration) {
+ result.add((InterceptorBindingDeclaration)a);
+ }
+ }
+ return result;
}
public Set<IObserverMethod> getObserverMethods() {
- // TODO Auto-generated method stub
- return null;
+ Set<IObserverMethod> result = new HashSet<IObserverMethod>();
+ for (BeanMethod m: methods) {
+ if(m instanceof IObserverMethod) {
+ result.add((IObserverMethod)m);
+ }
+ }
+ return result;
}
public Set<IProducer> getProducers() {
- // TODO Auto-generated method stub
- return null;
+ Set<IProducer> result = new HashSet<IProducer>();
+ for (BeanMethod m: methods) {
+ if(m instanceof IProducer) {
+ result.add((IProducer)m);
+ }
+ }
+ for (BeanField f: fields) {
+ if(f instanceof IProducer) {
+ result.add((IProducer)f);
+ }
+ }
+ return result;
}
public Set<ITypeDeclaration> getAllTypeDeclarations() {
@@ -53,18 +122,24 @@
}
public IAnnotationDeclaration getAlternativeDeclaration() {
- // TODO Auto-generated method stub
- return null;
+ return alternative;
}
public IType getBeanClass() {
- // TODO Auto-generated method stub
- return null;
+ return ((TypeDefinition)definition).getType();
}
public Set<IInjectionPoint> getInjectionPoints() {
- // TODO Auto-generated method stub
- return null;
+ Set<IInjectionPoint> result = new HashSet<IInjectionPoint>();
+ for (BeanField f: fields) {
+ if(f instanceof IInjectionPoint) {
+ result.add((IInjectionPoint)f);
+ }
+ }
+ for (BeanMethod m: methods) {
+ //get parameters that are injection points
+ }
+ return result;
}
public Set<IType> getLegalTypes() {
@@ -73,20 +148,35 @@
}
public String getName() {
- // TODO Auto-generated method stub
- return null;
+ String name = ((TypeDefinition)definition).getQualifiedName();
+ if(name.length() > 0) {
+ name = name.substring(0, 1).toLowerCase() + name.substring(1);
+ }
+ if(named == null) {
+ return name;
+ }
+ IAnnotation a = named.getDeclaration();
+ try {
+ IMemberValuePair[] vs = a.getMemberValuePairs();
+ if(vs != null && vs.length > 0) {
+ Object value = vs[0].getValue();
+ if(value != null && value.toString().trim().length() > 0) {
+ return value.toString().trim();
+ }
+ }
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+ return name;
}
public ITextSourceReference getNameLocation() {
- // TODO Auto-generated method stub
+ if(named != null) {
+ return ValueInfo.getValueInfo(named.getDeclaration(), null);
+ }
return null;
}
- public Set<IAnnotationDeclaration> getQualifierDeclarations() {
- // TODO Auto-generated method stub
- return null;
- }
-
public Set<ITypeDeclaration> getRestrictedTypeDeclaratios() {
// TODO Auto-generated method stub
return null;
@@ -102,29 +192,28 @@
return null;
}
- public Set<IStereotypeDeclaration> getStereotypeDeclarations() {
- // TODO Auto-generated method stub
- return null;
- }
-
public boolean isAlternative() {
- // TODO Auto-generated method stub
+ if(alternative != null) return true;
+ Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
+ for (IStereotypeDeclaration d: ds) {
+ IStereotype s = d.getStereotype();
+ if(s != null && s.isAlternative()) return true;
+ }
return false;
}
public boolean isDependent() {
- // TODO Auto-generated method stub
- return false;
+ IType scope = getScope();
+ return scope != null && CDIConstants.DEPENDENT_ANNOTATION_TYPE_NAME.equals(scope.getFullyQualifiedName());
}
public boolean isEnabled() {
- // TODO Auto-generated method stub
+ // TODO
return false;
}
public boolean isSpecializing() {
- // TODO Auto-generated method stub
- return false;
+ return specializes != null;
}
public IType getScope() {
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -0,0 +1,23 @@
+package org.jboss.tools.cdi.internal.core.impl;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+
+public class InjectionPointField extends BeanField implements IInjectionPointField {
+
+ public InjectionPointField() {}
+
+ public IAnnotationDeclaration getDecoratorAnnotation() {
+ return decorator;
+ }
+
+ public IType getType() {
+ return typeDeclaration == null ? null : typeDeclaration.getType();
+ }
+
+ public boolean isDelegate() {
+ return delegate != null;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InjectionPointField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -0,0 +1,17 @@
+package org.jboss.tools.cdi.internal.core.impl;
+
+import org.jboss.tools.cdi.core.IInterceptorBinding;
+import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
+
+public class InterceptorBindingDeclaration extends AnnotationDeclaration
+ implements IInterceptorBindingDeclaration {
+
+ public InterceptorBindingDeclaration(AnnotationDeclaration d) {
+ d.copyTo(this);
+ }
+
+ public IInterceptorBinding getInterceptorBinding() {
+ return project.getDelegate().getInterceptorBinding(getTypeName());
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingDeclaration.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -0,0 +1,37 @@
+package org.jboss.tools.cdi.internal.core.impl;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IInterceptorBinding;
+import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
+
+public class InterceptorBindingElement extends CDIElement implements IInterceptorBinding {
+ AnnotationDefinition definition;
+
+ public InterceptorBindingElement() {}
+
+ public void setDefinition(AnnotationDefinition definition) {
+ this.definition = definition;
+// setAnnotations(definition.getAnnotations());
+ }
+
+ public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations() {
+ Set<IInterceptorBindingDeclaration> result = new HashSet<IInterceptorBindingDeclaration>();
+ List<AnnotationDeclaration> as = definition.getAnnotations();
+ for (AnnotationDeclaration a: as) {
+ if(a instanceof InterceptorBindingDeclaration) {
+ result.add((InterceptorBindingDeclaration)a);
+ }
+ }
+ return result;
+ }
+
+ public IType getSourceType() {
+ return definition.getType();
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/InterceptorBindingElement.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerField.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -5,10 +5,7 @@
import java.util.Set;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMemberValuePair;
-import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.CDIConstants;
@@ -18,10 +15,11 @@
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IProducerField;
+import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
-import org.jboss.tools.common.java.IJavaSourceReference;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.text.ITextSourceReference;
@@ -77,44 +75,11 @@
}
public ITextSourceReference getNameLocation() {
- final IField f = getField();
- return new IJavaSourceReference(){
-
- public int getStartPosition() {
- try {
- ISourceRange r = f.getSourceRange();
- return r == null ? -1 : r.getOffset();
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
- return -1;
- }
- }
-
- public int getLength() {
- try {
- ISourceRange r = f.getSourceRange();
- return r == null ? 0 : r.getLength();
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
- return 0;
- }
- }
-
- public IMember getSourceMember() {
- return f;
- }
- };
- }
-
- public Set<IAnnotationDeclaration> getQualifierDeclarations() {
- Set<IAnnotationDeclaration> result = new HashSet<IAnnotationDeclaration>();
- for(AnnotationDeclaration a: definition.getAnnotations()) {
- int k = getCDIProject().getNature().getDefinitions().getAnnotationKind(a.getType());
- if(k == AnnotationDefinition.QUALIFIER) {
- result.add(a);
- }
+ AnnotationDeclaration named = findNamedAnnotation();
+ if(named != null) {
+ return ValueInfo.getValueInfo(named.getDeclaration(), null);
}
- return result;
+ return null;
}
public Set<ITypeDeclaration> getRestrictedTypeDeclaratios() {
@@ -156,21 +121,14 @@
return null;
}
- public Set<IStereotypeDeclaration> getStereotypeDeclarations() {
- Set<IStereotypeDeclaration> result = new HashSet<IStereotypeDeclaration>();
- for (AnnotationDeclaration d: definition.getAnnotations()) {
- if(d instanceof IStereotypeDeclaration) {
- StereotypeDeclaration sd = (StereotypeDeclaration)d;
- StereotypeElement s = getCDIProject().getStereotype(d.getTypeName());
- sd.setStereotype(s);
- result.add(sd);
- }
- }
- return result;
- }
-
public boolean isAlternative() {
- return alternative != null;
+ if(alternative != null) return true;
+ Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
+ for (IStereotypeDeclaration d: ds) {
+ IStereotype s = d.getStereotype();
+ if(s != null && s.isAlternative()) return true;
+ }
+ return false;
}
public boolean isDependent() {
@@ -225,15 +183,4 @@
return result;
}
- public static Set<IAnnotationDeclaration> getStereotypeDeclarations(CDICoreNature n, List<? extends IAnnotationDeclaration> ds) {
- Set<IAnnotationDeclaration> result = new HashSet<IAnnotationDeclaration>();
- for (IAnnotationDeclaration d: ds) {
- int k = n.getDefinitions().getAnnotationKind(d.getType());
- if(k == AnnotationDefinition.STEREOTYPE) {
- result.add(d);
- }
- }
- return result;
- }
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -5,10 +5,7 @@
import java.util.Set;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMemberValuePair;
-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.jboss.tools.cdi.core.CDIConstants;
@@ -21,14 +18,21 @@
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.ITypeDeclaration;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
-import org.jboss.tools.common.java.IJavaSourceReference;
+import org.jboss.tools.cdi.internal.core.impl.definition.MethodDefinition;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.text.ITextSourceReference;
public class ProducerMethod extends BeanMethod implements IProducerMethod {
+ protected AnnotationDeclaration produces;
public ProducerMethod() {}
+ public void setDefinition(MethodDefinition definition) {
+ super.setDefinition(definition);
+ produces = definition.getProducesAnnotation();
+ }
+
public Set<ITypeDeclaration> getAllTypeDeclarations() {
Set<ITypeDeclaration> result = new HashSet<ITypeDeclaration>();
if(typeDeclaration != null) {
@@ -56,6 +60,7 @@
public String getName() {
String name = getMethod().getElementName();
+ AnnotationDeclaration named = findNamedAnnotation();
if(named == null) {
return name;
}
@@ -81,44 +86,11 @@
}
public ITextSourceReference getNameLocation() {
- final IMethod f = getMethod();
- return new IJavaSourceReference(){
-
- public int getStartPosition() {
- try {
- ISourceRange r = f.getSourceRange();
- return r == null ? -1 : r.getOffset();
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
- return -1;
- }
- }
-
- public int getLength() {
- try {
- ISourceRange r = f.getSourceRange();
- return r == null ? 0 : r.getLength();
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
- return 0;
- }
- }
-
- public IMember getSourceMember() {
- return f;
- }
- };
- }
-
- public Set<IAnnotationDeclaration> getQualifierDeclarations() {
- Set<IAnnotationDeclaration> result = new HashSet<IAnnotationDeclaration>();
- for(AnnotationDeclaration a: definition.getAnnotations()) {
- int k = getCDIProject().getNature().getDefinitions().getAnnotationKind(a.getType());
- if(k == AnnotationDefinition.QUALIFIER) {
- result.add(a);
- }
+ AnnotationDeclaration named = findNamedAnnotation();
+ if(named != null) {
+ return ValueInfo.getValueInfo(named.getDeclaration(), null);
}
- return result;
+ return null;
}
//similar to ProducerField.getRestrictedTypeDeclaratios
@@ -166,21 +138,14 @@
return specializes;
}
- public Set<IStereotypeDeclaration> getStereotypeDeclarations() {
- Set<IStereotypeDeclaration> result = new HashSet<IStereotypeDeclaration>();
- for (AnnotationDeclaration d: definition.getAnnotations()) {
- if(d instanceof IStereotypeDeclaration) {
- StereotypeDeclaration sd = (StereotypeDeclaration)d;
- StereotypeElement s = getCDIProject().getStereotype(d.getTypeName());
- sd.setStereotype(s);
- result.add(sd);
- }
- }
- return result;
- }
-
public boolean isAlternative() {
- return alternative != null;
+ if(alternative != null) return true;
+ Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
+ for (IStereotypeDeclaration d: ds) {
+ IStereotype s = d.getStereotype();
+ if(s != null && s.isAlternative()) return true;
+ }
+ return false;
}
public boolean isDependent() {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeDeclaration.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeDeclaration.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -4,22 +4,15 @@
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
public class StereotypeDeclaration extends AnnotationDeclaration implements IStereotypeDeclaration {
- protected StereotypeElement stereotype;
+ public StereotypeDeclaration() {}
+
public StereotypeDeclaration(AnnotationDeclaration d) {
- annotation = d.annotation;
- startPosition = d.startPosition;
- length = d.length;
- annotationTypeName = d.annotationTypeName;
- type = d.type;
+ d.copyTo(this);
}
public IStereotype getStereotype() {
- return stereotype;
+ return project.getDelegate().getStereotype(getTypeName());
}
- public void setStereotype(StereotypeElement stereotype) {
- this.stereotype = stereotype;
- }
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/StereotypeElement.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -36,13 +36,23 @@
}
}
- public IAnnotationDeclaration getAlternativeDeclaration() {
+ public AnnotationDeclaration getAlternativeDeclaration() {
return alternative;
}
+ public AnnotationDeclaration getNameDeclaration() {
+ return named;
+ }
+
public Set<IInterceptorBindingDeclaration> getInterceptorBindingDeclarations() {
- // TODO
- return new HashSet<IInterceptorBindingDeclaration>();
+ Set<IInterceptorBindingDeclaration> result = new HashSet<IInterceptorBindingDeclaration>();
+ List<AnnotationDeclaration> as = definition.getAnnotations();
+ for (AnnotationDeclaration a: as) {
+ if(a instanceof InterceptorBindingDeclaration) {
+ result.add((InterceptorBindingDeclaration)a);
+ }
+ }
+ return result;
}
public IAnnotation getNameLocation() {
@@ -65,7 +75,12 @@
public boolean isAlternative() {
if(alternative != null) return true;
- return alternative != null;
+ Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
+ for (IStereotypeDeclaration d: ds) {
+ IStereotype s = d.getStereotype();
+ if(s != null && s.isAlternative()) return true;
+ }
+ return false;
}
public IType getScope() {
@@ -75,7 +90,7 @@
}
Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
for (IStereotypeDeclaration d: ds) {
-
+ //TODO
}
return null;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -10,6 +10,7 @@
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
+import org.jboss.tools.cdi.internal.core.impl.InterceptorBindingDeclaration;
import org.jboss.tools.cdi.internal.core.impl.StereotypeDeclaration;
public abstract class AbstractMemberDefinition {
@@ -33,9 +34,12 @@
IAnnotation[] ts = member.getAnnotations();
for (int i = 0; i < ts.length; i++) {
AnnotationDeclaration a = new AnnotationDeclaration();
+ a.setProject(context.getProject());
a.setDeclaration(ts[i], contextType);
if(context.getAnnotationKind(a.getType()) == AnnotationDefinition.STEREOTYPE) {
a = new StereotypeDeclaration(a);
+ } else if(context.getAnnotationKind(a.getType()) == AnnotationDefinition.INTERCEPTOR_BINDING) {
+ a = new InterceptorBindingDeclaration(a);
}
annotations.add(a);
if(CDIConstants.INJECT_ANNOTATION_TYPE_NAME.equals(a.getTypeName())) {
@@ -54,4 +58,12 @@
return injectAnnotation != null || producesAnnotation != null;
}
+ public AnnotationDeclaration getProducesAnnotation() {
+ return producesAnnotation;
+ }
+
+ public AnnotationDeclaration getInjectAnnotation() {
+ return injectAnnotation;
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractTypeDefinition.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -1,11 +1,16 @@
package org.jboss.tools.cdi.internal.core.impl.definition;
+import java.util.HashSet;
+import java.util.Set;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
public class AbstractTypeDefinition extends AbstractMemberDefinition {
protected String qualifiedName;
- IType type;
+ protected IType type;
+ protected Set<IType> inheritedTypes = new HashSet<IType>();
public AbstractTypeDefinition() {}
@@ -26,6 +31,26 @@
this.type = contextType;
super.init(contextType, context);
qualifiedName = getType().getFullyQualifiedName();
+ String sc = type.getSuperclassTypeSignature();
+ if(sc != null) {
+ sc = EclipseJavaUtil.resolveType(contextType, sc);
+ if(sc != null && sc.length() > 0) {
+ IType t = EclipseJavaUtil.findType(contextType.getJavaProject(), sc);
+ if(t != null) inheritedTypes.add(t);
+ }
+ }
+ String[] is = type.getSuperInterfaceTypeSignatures();
+ if(is != null) for (int i = 0; i < is.length; i++) {
+ String c = EclipseJavaUtil.resolveType(contextType, is[i]);
+ if(c != null && c.length() > 0) {
+ IType t = EclipseJavaUtil.findType(contextType.getJavaProject(), c);
+ if(t != null) inheritedTypes.add(t);
+ }
+ }
}
+ public Set<IType> getInheritedTypes() {
+ return inheritedTypes;
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -46,6 +46,10 @@
return project;
}
+ public IJavaProject getJavaProject() {
+ return javaProject;
+ }
+
public void addType(IPath file, String typeName, AbstractTypeDefinition def) {
if(file != null) {
Set<String> ts = resources.get(file);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -3,6 +3,8 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
public class MethodDefinition extends AbstractMemberDefinition {
IMethod method;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2009-12-09 17:38:11 UTC (rev 19159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2009-12-09 18:04:47 UTC (rev 19160)
@@ -41,4 +41,12 @@
}
}
+ public List<FieldDefinition> getFields() {
+ return fields;
+ }
+
+ public List<MethodDefinition> getMethods() {
+ return methods;
+ }
+
}
15 years, 1 month
JBoss Tools SVN: r19159 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-09 12:38:11 -0500 (Wed, 09 Dec 2009)
New Revision: 19159
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java 2009-12-09 16:42:20 UTC (rev 19158)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java 2009-12-09 17:38:11 UTC (rev 19159)
@@ -14,6 +14,10 @@
import java.util.List;
import java.util.Properties;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.dom.Annotation;
import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jdt.core.dom.MemberValuePair;
@@ -21,6 +25,7 @@
import org.eclipse.jdt.core.dom.QualifiedName;
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import org.eclipse.jdt.core.dom.StringLiteral;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.project.ext.IValueInfo;
import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
import org.jboss.tools.common.xml.XMLUtilities;
@@ -68,6 +73,31 @@
}
return null;
}
+
+ public static ValueInfo getValueInfo(IAnnotation annotation, String name) {
+ if(name == null) name = "value"; //$NON-NLS-1$
+ ValueInfo result = new ValueInfo();
+ ISourceRange r = null;
+ IMemberValuePair[] ps = null;
+ try {
+ r = annotation.getSourceRange();
+ ps = annotation.getMemberValuePairs();
+ } catch (CoreException e) {
+ ModelPlugin.getDefault().logError(e);
+ }
+ if(r != null) {
+ result.valueStartPosition = r.getOffset();
+ result.valueLength = r.getLength();
+ }
+ if(ps != null) for (IMemberValuePair p: ps) {
+ if(name.equals(p.getMemberName())) {
+ Object v = p.getValue();
+ if(v != null) result.value = v.toString();
+ break;
+ }
+ }
+ return result;
+ }
public ValueInfo() {
}
15 years, 1 month
JBoss Tools SVN: r19158 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-12-09 11:42:20 -0500 (Wed, 09 Dec 2009)
New Revision: 19158
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5431 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF 2009-12-09 15:04:45 UTC (rev 19157)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF 2009-12-09 16:42:20 UTC (rev 19158)
@@ -8,6 +8,7 @@
Bundle-Localization: plugin
Require-Bundle: org.eclipse.jdt.ui,
org.eclipse.jdt.core,
+ org.eclipse.core.expressions,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.ui,
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2009-12-09 15:04:45 UTC (rev 19157)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2009-12-09 16:42:20 UTC (rev 19158)
@@ -66,21 +66,36 @@
<command commandId="org.hibernate.eclipse.jdt.ui.run_jpaaction"
id="org.hibernate.eclipse.jdt.ui.run_jpaaction" style="push">
<visibleWhen checkEnabled="false">
- <not>
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </not>
+ <or>
+ <with variable="activeEditorId">
+ <or>
+ <equals value="org.eclipse.jdt.ui.CompilationUnitEditor" />
+ </or>
+ </with>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <or>
+ <instanceof value="org.eclipse.jdt.core.ICompilationUnit"/>
+ <instanceof value="org.eclipse.jdt.internal.core.JavaProject"/>
+ <instanceof value="org.eclipse.jdt.internal.core.PackageFragment"/>
+ <and>
+ <instanceof value="org.eclipse.jdt.internal.core.JavaElement"/>
+ <not>
+ <or>
+ <instanceof value="org.eclipse.jdt.internal.core.ExternalPackageFragmentRoot"/>
+ <instanceof value="org.eclipse.jdt.internal.core.JarPackageFragmentRoot"/>
+ <instanceof value="org.eclipse.jdt.internal.core.ClassFile"/>
+ <instanceof value="org.eclipse.jdt.internal.core.ExternalJavaProject"/>
+ </or>
+ </not>
+ </and>
+ </or>
+ </iterate>
+ </with>
+ </or>
</visibleWhen>
- </command>
+ </command>
</menuContribution>
- <!-- next section will show Hibernate/JPA menu item in case of active XML editor -->
- <!--<menuContribution locationURI="menu:sourceMenuId?after=additions">
- <command commandId="org.hibernate.eclipse.jdt.ui.run_jpaaction"
- id="org.hibernate.eclipse.jdt.ui.run_jpaaction1" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.sse.ui.sseActiveContext.definition"></reference>
- </visibleWhen>
- </command>
- </menuContribution>-->
</extension>
<extension point="org.eclipse.ui.popupMenus">
<!-- java editor context menu -->
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2009-12-09 15:04:45 UTC (rev 19157)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2009-12-09 16:42:20 UTC (rev 19158)
@@ -10,9 +10,13 @@
******************************************************************************/
package org.hibernate.eclipse.jdt.ui.internal.jpa.actions;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.EvaluationContext;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
@@ -82,10 +86,28 @@
return false;
}
+ @SuppressWarnings("unchecked")
public void setEnabled(Object evaluationContext) {
- boolean enable = isCUSelected();
+ boolean enable = false;
actor.setSelection(null);
actor.clearSelectionCU();
+ if (!enable && evaluationContext instanceof EvaluationContext) {
+ EvaluationContext ec = (EvaluationContext)evaluationContext;
+ Object obj = ec.getDefaultVariable();
+ if (obj instanceof List) {
+ Iterator it = ((List)obj).iterator();
+ while (it.hasNext()) {
+ obj = it.next();
+ actor.processJavaElements(obj);
+ }
+ } else {
+ actor.processJavaElements(obj);
+ }
+ enable = actor.getSelectionCUSize() > 0;
+ }
+ if (!enable) {
+ enable = isCUSelected();
+ }
setBaseEnabled(enable);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-12-09 15:04:45 UTC (rev 19157)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2009-12-09 16:42:20 UTC (rev 19158)
@@ -370,7 +370,7 @@
* Process object - java element to collect all it's children CompilationUnits
* @param obj
*/
- protected void processJavaElements(Object obj) {
+ public void processJavaElements(Object obj) {
if (obj instanceof ICompilationUnit) {
ICompilationUnit cu = (ICompilationUnit)obj;
addCompilationUnit(cu);
@@ -473,4 +473,8 @@
public void setSelectionCU(Set<ICompilationUnit> selectionCU) {
this.selectionCU = selectionCU;
}
+
+ public int getSelectionCUSize() {
+ return selectionCU.size();
+ }
}
15 years, 1 month
JBoss Tools SVN: r19157 - in trunk/common: plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-09 10:04:45 -0500 (Wed, 09 Dec 2009)
New Revision: 19157
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath
Log:
https://jira.jboss.org/jira/browse/JBIDE-5232
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2009-12-09 13:56:46 UTC (rev 19156)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2009-12-09 15:04:45 UTC (rev 19157)
@@ -748,7 +748,7 @@
// token.getType() == ELOperandToken.EL_METHOD_TOKEN)
{
// return filtered methods + properties
- Set<TypeInfoCollector.MemberPresentation> proposalsToFilter = new TreeSet<TypeInfoCollector.MemberPresentation>(TypeInfoCollector.MEMBER_PRESENTATION_COMPARATOR);
+ Set<TypeInfoCollector.MemberPresentation> proposalsToFilter = new TreeSet<TypeInfoCollector.MemberPresentation>(TypeInfoCollector.MEMBER_PRESENTATION_COMPARATOR);
for (TypeInfoCollector.MemberInfo mbr : members) {
if(isSingularMember(mbr)) {
filterSingularMember(mbr, proposalsToFilter);
@@ -761,7 +761,7 @@
}
proposalsToFilter.addAll(infos.getMethodPresentations());
proposalsToFilter.addAll(infos.getPropertyPresentations(segment.getUnpairedGettersOrSetters()));
- segment.setMemberInfo(mbr);
+// segment.setMemberInfo(mbr);
}
for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
// We do expect nothing but name for method tokens (No round brackets)
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-12-09 13:56:46 UTC (rev 19156)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-12-09 15:04:45 UTC (rev 19157)
@@ -43,9 +43,11 @@
public List<ELSegment> findSegmentsByVariable(IVariable variable) {
ArrayList<ELSegment> list = new ArrayList<ELSegment>();
for(ELSegment segment : segments){
- for(IVariable var : segment.getVariables()){
- if(var.getName().equals(variable.getName())){
- list.add(segment);
+ if(segment.isResolved()) {
+ for(IVariable var : segment.getVariables()){
+ if(var.getName().equals(variable.getName())){
+ list.add(segment);
+ }
}
}
}
@@ -59,8 +61,12 @@
public List<ELSegment> findSegmentsByJavaElement(IJavaElement element) {
ArrayList<ELSegment> list = new ArrayList<ELSegment>();
for(ELSegment segment : segments){
- if(segment instanceof JavaMemberELSegment && ((JavaMemberELSegment)segment).getJavaElement() != null && ((JavaMemberELSegment)segment).getJavaElement().equals(element))
- list.add(segment);
+ if(segment.isResolved() && segment instanceof JavaMemberELSegment) {
+ JavaMemberELSegment javaSegment = (JavaMemberELSegment)segment;
+ if(javaSegment.getJavaElement() != null && javaSegment.getJavaElement().equals(element)) {
+ list.add(segment);
+ }
+ }
}
return list;
}
@@ -232,4 +238,20 @@
public void setValue(String value) {
this.value = value;
}
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ if(segments!=null) {
+ StringBuffer result = new StringBuffer("["); //$NON-NLS-1$
+ for (ELSegment segment : segments) {
+ result.append(segment.toString()).append(';');
+ }
+ result.append(']');
+ return result.toString();
+ }
+ return super.toString();
+ }
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java 2009-12-09 13:56:46 UTC (rev 19156)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELSegmentImpl.java 2009-12-09 15:04:45 UTC (rev 19157)
@@ -107,4 +107,12 @@
public void setVariables(List<IVariable> variables) {
this.variables = variables;
}
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return token!=null?token.getText() + "(" + resolved + ")": super.toString(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
\ No newline at end of file
Modified: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath 2009-12-09 13:56:46 UTC (rev 19156)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath 2009-12-09 15:04:45 UTC (rev 19157)
@@ -8,7 +8,7 @@
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.5.0_10">
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="jst.java"/>
</attributes>
15 years, 1 month
JBoss Tools SVN: r19156 - trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-09 08:56:46 -0500 (Wed, 09 Dec 2009)
New Revision: 19156
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-5099
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta 2009-12-09 13:56:08 UTC (rev 19155)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta 2009-12-09 13:56:46 UTC (rev 19156)
@@ -35,7 +35,7 @@
<XModelEntity
ImplementationLoadingClass="org.jboss.tools.jsf.jsf2.model.FileCompositeComponentLoader"
ImplementingClass="org.jboss.tools.common.model.filesystems.impl.SimpleFileImpl"
- ObjectEditorClass="%XML%" XMLSUBPATH="html" name="FileJSF2Component">
+ ObjectEditorClass="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor" XMLSUBPATH="html" name="FileJSF2Component">
<XChildrenEntities>
<XChildEntity maxCount="1" name="JSF2ComponentInterface" required="yes"/>
<XChildEntity name="JSF2ComponentImplementation"/>
15 years, 1 month