JBoss Tools SVN: r27829 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui: marker and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-12-30 10:36:42 -0500 (Thu, 30 Dec 2010)
New Revision: 27829
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeInjectedPointUnambiguousMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
Log:
https://issues.jboss.org/browse/JBIDE-7635
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-12-30 15:34:40 UTC (rev 27828)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-12-30 15:36:42 UTC (rev 27829)
@@ -87,6 +87,7 @@
public static String MAKE_INJECTED_POINT_UNAMBIGUOUS_TITLE;
public static String SELECT_BEAN_TITLE;
+ public static String SELECT_BEAN_WIZARD_TITLE;
public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE;
public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_AVAILABLE;
public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_IN_BEAN;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-12-30 15:34:40 UTC (rev 27828)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-12-30 15:36:42 UTC (rev 27829)
@@ -68,9 +68,10 @@
ADD_LOCAL_BEAN_MARKER_RESOLUTION_TITLE=Add @LocalBean annotation to ''{0}'' class
DELETE_ALL_DISPOSER_DUPLICANT_MARKER_RESOLUTION_TITLE=Delete @Disposes annotations from all methods except ''{0}'' method
DELETE_ALL_INJECTED_CONSTRUCTORS_MARKER_RESOLUTION_TITLE=Delete @Inject annotations from all constructors except ''{0}'' constructor
-MAKE_INJECTED_POINT_UNAMBIGUOUS_TITLE=Make injected point unambiguous by specifying ''{0}'' bean
+MAKE_INJECTED_POINT_UNAMBIGUOUS_TITLE=Specify ''{0}'' CDI Bean for the Injection Point
SELECT_BEAN_TITLE=Select CDI Bean to configure the Injection Point
+SELECT_BEAN_WIZARD_TITLE=Specify CDI Bean for the Injection Point
ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE=Add Qualifiers to the Bean
ADD_QUALIFIERS_TO_BEAN_WIZARD_AVAILABLE=Available:
ADD_QUALIFIERS_TO_BEAN_WIZARD_IN_BEAN=In the Bean:
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeInjectedPointUnambiguousMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeInjectedPointUnambiguousMarkerResolution.java 2010-12-30 15:34:40 UTC (rev 27828)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeInjectedPointUnambiguousMarkerResolution.java 2010-12-30 15:36:42 UTC (rev 27829)
@@ -14,36 +14,21 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeParameter;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IMarkerResolution2;
import org.eclipse.ui.internal.Workbench;
-import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IInjectionPoint;
-import org.jboss.tools.cdi.core.IInjectionPointField;
-import org.jboss.tools.cdi.core.IInjectionPointMethod;
-import org.jboss.tools.cdi.core.IInjectionPointParameter;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.ui.CDIUIMessages;
-import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.cdi.ui.wizard.AddQualifiersToBeanComposite;
import org.jboss.tools.cdi.ui.wizard.AddQualifiersToBeanWizard;
-import org.jboss.tools.common.EclipseUtil;
/**
* @author Daniel Azarov
@@ -75,7 +60,7 @@
return;
List<IQualifier> deployed = wizard.getDeployedQualifiers();
- addQualifiersToBean(deployed);
+ MarkerResolutionUtils.addQualifiersToBean(deployed, selectedBean);
try {
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
} catch (InterruptedException e) {
@@ -92,82 +77,9 @@
}
}
- addQualifiersToInjectedPoint();
+ MarkerResolutionUtils.addQualifiersToInjectedPoint(injectionPoint, selectedBean);
}
- private void addQualifiersToBean(List<IQualifier> deployed){
- IFile file = (IFile)selectedBean.getBeanClass().getResource();
- try{
- ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
- ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
-
- IType type = compilationUnit.findPrimaryType();
- if(type != null){
- for(IQualifier qualifier : deployed){
- String qualifierName = qualifier.getSourceType().getFullyQualifiedName();
- if(!qualifierName.equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME) && !qualifierName.equals(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME)){
- MarkerResolutionUtils.addAnnotation(qualifier.getSourceType().getFullyQualifiedName(), compilationUnit, type);
- }
-
- }
- }
-
- compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
- compilationUnit.discardWorkingCopy();
- }catch(CoreException ex){
- CDIUIPlugin.getDefault().logError(ex);
- }
- }
-
- private void addQualifiersToInjectedPoint(){
- try{
- ICompilationUnit original = injectionPoint.getClassBean().getBeanClass().getCompilationUnit();
- ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
-
- Set<IQualifier> qualifiers = selectedBean.getQualifiers();
- for(IQualifier qualifier : qualifiers){
- String qualifierName = qualifier.getSourceType().getFullyQualifiedName();
- if(!qualifierName.equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME) && !qualifierName.equals(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME)){
- IJavaElement element = getInjectedJavaElement(compilationUnit);
- MarkerResolutionUtils.addQualifier(qualifierName, compilationUnit, element);
- }
- }
-
- compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
- compilationUnit.discardWorkingCopy();
- }catch(CoreException ex){
- CDIUIPlugin.getDefault().logError(ex);
- }
- }
-
- private IJavaElement getInjectedJavaElement(ICompilationUnit compolationUnit){
- if(injectionPoint instanceof IInjectionPointField){
- IField field = ((IInjectionPointField)injectionPoint).getField();
- IType type = field.getDeclaringType();
- IType t = compolationUnit.getType(type.getElementName());
- IField f = t.getField(field.getElementName());
-
- return f;
- }else if(injectionPoint instanceof IInjectionPointMethod){
- IMethod method = ((IInjectionPointMethod)injectionPoint).getMethod();
- IType type = method.getDeclaringType();
- IType t = compolationUnit.getType(type.getElementName());
- IMethod m = t.getMethod(method.getElementName(), method.getParameterTypes());
-
- return m;
- }else if(injectionPoint instanceof IInjectionPointParameter){
- String paramName = ((IInjectionPointParameter)injectionPoint).getName();
- IMethod method = ((IInjectionPointParameter)injectionPoint).getBeanMethod().getMethod();
- IType type = method.getDeclaringType();
- IType t = compolationUnit.getType(type.getElementName());
- IMethod m = t.getMethod(method.getElementName(), method.getParameterTypes());
- ITypeParameter p = m.getTypeParameter(paramName);
-
- return p;
- }
- return null;
- }
-
private boolean checkBeans(){
Set<IQualifier> qualifiers = selectedBean.getQualifiers();
if(qualifiers.size() == 0)
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2010-12-30 15:34:40 UTC (rev 27828)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2010-12-30 15:36:42 UTC (rev 27829)
@@ -10,21 +10,37 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.marker;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IAnnotatable;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IImportDeclaration;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeParameter;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.cdi.core.IInjectionPointMethod;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
+import org.jboss.tools.cdi.ui.CDIUIPlugin;
+import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
/**
@@ -103,7 +119,7 @@
IAnnotation annotation = getAnnotation(element, qualifiedName);
if(annotation != null && annotation.exists())
return;
-
+
addImport(qualifiedName, compilationUnit);
String lineDelim = SPACE;
@@ -149,5 +165,125 @@
}
return null;
}
+
+ private static boolean contains(IQualifierDeclaration declaration, Set<IQualifier> qualifiers){
+ for(IQualifier qualifier : qualifiers){
+ if(declaration.getQualifier().getSourceType().getFullyQualifiedName().equals(qualifier.getSourceType().getFullyQualifiedName()))
+ return true;
+ }
+ return false;
+ }
+
+ public static void deleteQualifierAnnotation(ICompilationUnit compilationUnit, IJavaElement element, IQualifier qualifier) throws JavaModelException{
+ if(element instanceof IAnnotatable){
+ String fullName = qualifier.getSourceType().getFullyQualifiedName();
+ String shortName = getShortName(fullName);
+ IAnnotation annotation = ((IAnnotatable)element).getAnnotation(fullName);
+ if(annotation == null || !annotation.exists()){
+ annotation = ((IAnnotatable)element).getAnnotation(shortName);
+ }
+ if(annotation != null && annotation.exists()){
+ IBuffer buffer = compilationUnit.getBuffer();
+
+ buffer.replace(annotation.getSourceRange().getOffset(), annotation.getSourceRange().getLength(), "");
+
+ synchronized(compilationUnit) {
+ compilationUnit.reconcile(ICompilationUnit.NO_AST, true, null, null);
+ }
+ }
+ }
+ }
+ private static List<IQualifier> findQualifiersToDelete(IInjectionPoint injectionPoint, Set<IQualifier> qualifiers){
+ ArrayList<IQualifier> list = new ArrayList<IQualifier>();
+ Set<IQualifierDeclaration> declarations = injectionPoint.getQualifierDeclarations();
+ for(IQualifierDeclaration declaration : declarations){
+ if(!contains(declaration, qualifiers))
+ list.add(declaration.getQualifier());
+ }
+ return list;
+ }
+
+ public static void addQualifiersToInjectedPoint(IInjectionPoint injectionPoint, IBean bean){
+ try{
+ ICompilationUnit original = injectionPoint.getClassBean().getBeanClass().getCompilationUnit();
+ ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
+ IJavaElement element = getInjectedJavaElement(compilationUnit, injectionPoint);
+ Set<IQualifier> qualifiers = bean.getQualifiers();
+
+ // delete unneeded qualifiers
+
+ List<IQualifier> toDelete = findQualifiersToDelete(injectionPoint, qualifiers);
+
+ for(IQualifier qualifier : toDelete){
+ deleteQualifierAnnotation(compilationUnit, element, qualifier);
+ }
+
+ for(IQualifier qualifier : qualifiers){
+ String qualifierName = qualifier.getSourceType().getFullyQualifiedName();
+ if(!qualifierName.equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME) && !qualifierName.equals(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME)){
+ MarkerResolutionUtils.addQualifier(qualifierName, compilationUnit, element);
+ }
+ }
+
+ compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
+ compilationUnit.discardWorkingCopy();
+ }catch(CoreException ex){
+ CDIUIPlugin.getDefault().logError(ex);
+ }
+ }
+
+ public static void addQualifiersToBean(List<IQualifier> deployed, IBean bean){
+ IFile file = (IFile)bean.getBeanClass().getResource();
+ try{
+ ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
+ ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
+
+ IType type = compilationUnit.findPrimaryType();
+ if(type != null){
+ for(IQualifier qualifier : deployed){
+ String qualifierName = qualifier.getSourceType().getFullyQualifiedName();
+ if(!qualifierName.equals(CDIConstants.ANY_QUALIFIER_TYPE_NAME) && !qualifierName.equals(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME)){
+ MarkerResolutionUtils.addAnnotation(qualifier.getSourceType().getFullyQualifiedName(), compilationUnit, type);
+ }
+
+ }
+ }
+
+ compilationUnit.commitWorkingCopy(false, new NullProgressMonitor());
+ compilationUnit.discardWorkingCopy();
+ }catch(CoreException ex){
+ CDIUIPlugin.getDefault().logError(ex);
+ }
+ }
+
+ public static IJavaElement getInjectedJavaElement(ICompilationUnit compolationUnit, IInjectionPoint injectionPoint){
+ if(injectionPoint instanceof IInjectionPointField){
+ IField field = ((IInjectionPointField)injectionPoint).getField();
+ IType type = field.getDeclaringType();
+ IType t = compolationUnit.getType(type.getElementName());
+ IField f = t.getField(field.getElementName());
+
+ return f;
+ }else if(injectionPoint instanceof IInjectionPointMethod){
+ IMethod method = ((IInjectionPointMethod)injectionPoint).getMethod();
+ IType type = method.getDeclaringType();
+ IType t = compolationUnit.getType(type.getElementName());
+ IMethod m = t.getMethod(method.getElementName(), method.getParameterTypes());
+
+ return m;
+ }else if(injectionPoint instanceof IInjectionPointParameter){
+ String paramName = ((IInjectionPointParameter)injectionPoint).getName();
+ IMethod method = ((IInjectionPointParameter)injectionPoint).getBeanMethod().getMethod();
+ IType type = method.getDeclaringType();
+ IType t = compolationUnit.getType(type.getElementName());
+ IMethod m = t.getMethod(method.getElementName(), method.getParameterTypes());
+ ITypeParameter p = m.getTypeParameter(paramName);
+
+ return p;
+ }
+ return null;
+ }
+
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java 2010-12-30 15:34:40 UTC (rev 27828)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java 2010-12-30 15:36:42 UTC (rev 27829)
@@ -13,13 +13,17 @@
import java.util.List;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IMarkerResolution2;
import org.eclipse.ui.internal.Workbench;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.ui.CDIUIMessages;
import org.jboss.tools.cdi.ui.wizard.SelectBeanWizard;
@@ -48,7 +52,26 @@
int status = dialog.open();
if(status != WizardDialog.OK)
return;
-
+
+ IBean selectedBean = wizard.getBean();
+
+ List<IQualifier> deployed = wizard.getDeployedQualifiers();
+ MarkerResolutionUtils.addQualifiersToBean(deployed, selectedBean);
+ try {
+ Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ } catch (InterruptedException e) {
+ // do nothing
+ }
+ // reload selectedBean
+ ICDIProject cdiProject = selectedBean.getCDIProject();
+ IBean[] beans = cdiProject.getBeans();
+ for(IBean bean : beans){
+ if(bean.getBeanClass().getFullyQualifiedName().equals(selectedBean.getBeanClass().getFullyQualifiedName())){
+ selectedBean = bean;
+ break;
+ }
+ }
+ MarkerResolutionUtils.addQualifiersToInjectedPoint(injectionPoint, selectedBean);
}
public String getDescription() {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2010-12-30 15:34:40 UTC (rev 27828)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2010-12-30 15:36:42 UTC (rev 27829)
@@ -23,7 +23,7 @@
public AddQualifiersToBeanWizard(IInjectionPoint injectionPoint, List<IBean> beans, IBean bean){
super(injectionPoint, beans, bean);
- setWindowTitle(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE);
+ setWindowTitle(CDIUIMessages.SELECT_BEAN_WIZARD_TITLE);
setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_DEFAULT));
}
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 2010-12-30 15:34:40 UTC (rev 27828)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java 2010-12-30 15:36:42 UTC (rev 27829)
@@ -46,7 +46,7 @@
public SelectBeanWizard(IInjectionPoint injectionPoint, java.util.List<IBean> beans){
super(injectionPoint, beans);
- setWindowTitle(CDIUIMessages.SELECT_BEAN_TITLE);
+ setWindowTitle(CDIUIMessages.SELECT_BEAN_WIZARD_TITLE);
setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_DEFAULT));
}
14 years
JBoss Tools SVN: r27828 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-30 10:34:40 -0500 (Thu, 30 Dec 2010)
New Revision: 27828
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
Log:
JBIDE-8019
https://issues.jboss.org/browse/JBIDE-8019
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2010-12-30 15:31:51 UTC (rev 27827)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2010-12-30 15:34:40 UTC (rev 27828)
@@ -210,8 +210,15 @@
for (String jar: newJars.keySet()) {
Path path = new Path(jar);
IPackageFragmentRoot root = jp.getPackageFragmentRoot(jar);
+ if(root == null) continue;
+ if(!root.exists()) {
+ IFile f = EclipseResourceUtil.getFile(jar);
+ if(f != null && f.exists()) {
+ root = jp.getPackageFragmentRoot(f);
+ }
+ }
if (root == null || !root.exists())
- return;
+ continue;
IJavaElement[] es = root.getChildren();
for (IJavaElement e : es) {
if (e instanceof IPackageFragment) {
14 years
JBoss Tools SVN: r27827 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: schema and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-12-30 10:31:51 -0500 (Thu, 30 Dec 2010)
New Revision: 27827
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/schema/KbRequire.exsd
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireBuilder.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireDefinition.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IKBBuilderRequiredNature.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
Log:
JBIDE-8013
Move the acquirement for KB Builder requirements out of the nature(-s)
New extension point is used to declare KB Builder requirement.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2010-12-30 15:28:53 UTC (rev 27826)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2010-12-30 15:31:51 UTC (rev 27827)
@@ -5,6 +5,7 @@
<extension-point id="KbIncludeContext" name="Kb Include Context Buillder" schema="schema/include.exsd" />
<extension-point id="validator" name="KB Validator" schema="schema/validator.exsd"/>
<extension-point id="elValidationDelegate" name="EL Validation Delegate" schema="schema/elValidationDelegate.exsd"/>
+ <extension-point id="KbRequire" name="KB Builder Requirement" schema="schema/KbRequire.exsd"/>
<extension
id="kbbuilder"
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/schema/KbRequire.exsd
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/schema/KbRequire.exsd (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/schema/KbRequire.exsd 2010-12-30 15:31:51 UTC (rev 27827)
@@ -0,0 +1,125 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.jst.web.kb" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.jst.web.kb" id="KbRequire" name="KbRequire"/>
+ </appInfo>
+ <documentation>
+ The extension point allows the application to define Natures that require JBoss Tools Knowledge Base Builder to be present due to provide Validation and Content Assist facilities.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="require" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="require">
+ <complexType>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="forNature" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ V.3.2
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ <pre>
+ <extension-point id="KbRequire" name="KB Builder Requirement" />
+
+ <extension
+ id="org.jboss.tools.jsf.KbRequire"
+ point="org.jboss.tools.jst.web.kb.KbRequire">
+ <require
+ description="%KB_REQUIRED_FOR_JSF"
+ forNature="org.jboss.tools.jsf.jsfnature">
+ </require>
+ </extension>
+
+</pre>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ The baseline for API and extension point stability is RedHat Developer Studio
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ RedHat
+ </documentation>
+ </annotation>
+
+</schema>
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/schema/KbRequire.exsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IKBBuilderRequiredNature.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IKBBuilderRequiredNature.java 2010-12-30 15:28:53 UTC (rev 27826)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IKBBuilderRequiredNature.java 2010-12-30 15:31:51 UTC (rev 27827)
@@ -1,25 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2010 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.jst.web.kb.internal;
-
-/**
- * The interface is used by the nature which are require the KB Nature and Builder
- * to be installed due to the correct information to be provided for Content Assist
- * and/or Validation facilities
- *
- * @author Jeremy
- *
- */
-public interface IKBBuilderRequiredNature {
- boolean isKBBuilderRequired();
- String getNatureDescription();
-}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2010-12-30 15:28:53 UTC (rev 27826)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2010-12-30 15:31:51 UTC (rev 27827)
@@ -52,6 +52,8 @@
import org.jboss.tools.jst.web.kb.internal.taglib.composite.CompositeTagLibrary;
import org.jboss.tools.jst.web.kb.internal.taglib.myfaces.MyFacesTagLibrary;
import org.jboss.tools.jst.web.kb.internal.validation.ProjectValidationContext;
+import org.jboss.tools.jst.web.kb.require.KbRequireBuilder;
+import org.jboss.tools.jst.web.kb.require.KbRequireDefinition;
import org.jboss.tools.jst.web.kb.taglib.ICustomTagLibrary;
import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
import org.jboss.tools.jst.web.kb.validation.IProjectValidationContext;
@@ -870,18 +872,19 @@
private static String[] getKBBuilderRequiredNatureDescriptions(IProject project) {
ArrayList<String> natureDescriptions = new ArrayList<String>();
try {
- IProjectDescription projectDescription = project.getDescription();
- String[] ids = projectDescription.getNatureIds();
- if (ids == null) return (String[])natureDescriptions.toArray(new String[0]);
- for (String id : ids) {
- IProjectNature nature = project.getNature(id);
- if (nature instanceof IKBBuilderRequiredNature) {
- if (((IKBBuilderRequiredNature)nature).isKBBuilderRequired()) {
- String description = ((IKBBuilderRequiredNature)nature).getNatureDescription();
- if (description != null && description.length() > 0) {
- natureDescriptions.add(description);
- }
- }
+ List<KbRequireDefinition> definitions = KbRequireBuilder.getInstance().getKbRequireDefinitions();
+
+ if (definitions == null) return (String[])natureDescriptions.toArray(new String[0]);
+
+ for (KbRequireDefinition def : definitions) {
+ String forNature = def.getNatureId();
+
+ if (project.getNature(forNature) != null) {
+ String description = def.getDescription();
+ if (description == null)
+ description = forNature;
+
+ natureDescriptions.add(description);
}
}
} catch (CoreException ex) {
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireBuilder.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireBuilder.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireBuilder.java 2010-12-30 15:31:51 UTC (rev 27827)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.jst.web.kb.require;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.text.ext.util.xpl.RegistryReader;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.include.IncludeContextBuilder;
+
+/**
+ * KB Require Builder is used to read and store the information from the
+ * KbRequire schema.
+ *
+ * @author Victor Rubezhny
+ *
+ */
+public class KbRequireBuilder extends RegistryReader {
+
+ // extension point ID
+ public static final String PL_KB_REQUIRE = "KbRequire"; //$NON-NLS-1$
+
+ public static final String TAG_REQUIRE = "require"; //$NON-NLS-1$
+
+ public static final String ATT_ID = "id"; //$NON-NLS-1$
+ public static final String ATT_FOR_NATURE = "forNature"; //$NON-NLS-1$
+ public static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$
+
+ private static KbRequireBuilder fInstance;
+
+ protected String fTargetContributionElement;
+
+ List<KbRequireDefinition> fDefinitions = null;
+
+ /**
+ * returns singleton instance of KbRequireBuilder
+ *
+ * @return {@link IncludeContextBuilder}
+ */
+ public synchronized static KbRequireBuilder getInstance() {
+ if (fInstance == null) {
+ fInstance = new KbRequireBuilder();
+ }
+ return fInstance;
+ }
+
+ /* (non-Javadoc)
+ * @see com.ibm.sse.editor.internal.extension.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected boolean readElement(IConfigurationElement element) {
+ String tag = element.getName();
+
+ if (tag.equals(TAG_REQUIRE)) {
+ processRequireElement(element);
+ }
+
+ return false;
+ }
+
+ /**
+ * Reads the Tag element and stores the specific data
+ *
+ * @param element
+ * @return
+ */
+ private boolean processRequireElement(IConfigurationElement element) {
+ String forNature = element.getAttribute(ATT_FOR_NATURE);
+ String description = element.getAttribute(ATT_DESCRIPTION);
+
+ if (forNature != null && forNature.trim().length() > 0) {
+ if (fDefinitions == null)
+ fDefinitions = new ArrayList<KbRequireDefinition>();
+
+ fDefinitions.add(new KbRequireDefinition(forNature, description));
+
+ return true;
+ }
+
+ return false;
+ }
+
+ private void initCache() {
+ if (fDefinitions == null) {
+ readContributions(TAG_REQUIRE, PL_KB_REQUIRE);
+ }
+ }
+
+ /**
+ * Reads the contributions defined in the extension point
+ *
+ * @param element
+ * @param extensionPoint
+ */
+ protected void readContributions(String element, String extensionPoint) {
+ fTargetContributionElement = element;
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ readRegistry(registry, WebKbPlugin.PLUGIN_ID, extensionPoint);
+ }
+
+ /**
+ * Returns all the open on definition objects
+ *
+ * @return
+ */
+ public List<KbRequireDefinition> getKbRequireDefinitions() {
+ initCache();
+ return fDefinitions;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireDefinition.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireDefinition.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireDefinition.java 2010-12-30 15:31:51 UTC (rev 27827)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.jst.web.kb.require;
+
+/**
+ * KbRequireDefinition is used to store the definitions read from the KbRequire Schema
+ *
+ * @author Victor Rubezhny
+ *
+ */
+public class KbRequireDefinition {
+ private String fNatureId;
+ private String fDescription;
+
+ public KbRequireDefinition(String forId, String description) {
+ this.fNatureId = forId;
+ this.fDescription = description;
+ }
+
+ public String getNatureId () {
+ return fNatureId;
+ }
+
+ public String getDescription() {
+ return fDescription;
+ }
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/require/KbRequireDefinition.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27826 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: projects/CDITest1/lib and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-30 10:28:53 -0500 (Thu, 30 Dec 2010)
New Revision: 27826
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-api.jar
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-core.jar
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-se.jar
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/MyShellImpl.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/WeldJarTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
Log:
JBIDE-8019
https://issues.jboss.org/browse/JBIDE-8019
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/.classpath 2010-12-30 15:13:15 UTC (rev 27825)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/.classpath 2010-12-30 15:28:53 UTC (rev 27826)
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/cdi-api.jar"/>
<classpathentry kind="lib" path="lib/javax.inject.jar"/>
+ <classpathentry kind="lib" path="lib/weld-api.jar"/>
+ <classpathentry kind="lib" path="lib/weld-core.jar"/>
+ <classpathentry kind="lib" path="lib/weld-se.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-api.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-core.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-se.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/lib/weld-se.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/MyShellImpl.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/MyShellImpl.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/MyShellImpl.java 2010-12-30 15:28:53 UTC (rev 27826)
@@ -0,0 +1,14 @@
+package cdi.test;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.jboss.weld.environment.se.bindings.Parameters;
+
+public class MyShellImpl {
+
+ @Inject
+ @Parameters
+ private List<String> p4;
+
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/MyShellImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/.classpath 2010-12-30 15:13:15 UTC (rev 27825)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/.classpath 2010-12-30 15:28:53 UTC (rev 27826)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="lib/cdi-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/javax.inject.jar"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/CDITest1"/>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/.classpath 2010-12-30 15:13:15 UTC (rev 27825)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/.classpath 2010-12-30 15:28:53 UTC (rev 27826)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/CDITest2"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/.classpath 2010-12-30 15:13:15 UTC (rev 27825)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/.classpath 2010-12-30 15:28:53 UTC (rev 27826)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/CDITest2"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/.classpath 2010-12-30 15:13:15 UTC (rev 27825)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/.classpath 2010-12-30 15:28:53 UTC (rev 27826)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/CDITest4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2010-12-30 15:13:15 UTC (rev 27825)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2010-12-30 15:28:53 UTC (rev 27826)
@@ -93,6 +93,7 @@
suite.addTestSuite(CoreValidationTest.class);
suite.addTestSuite(ELValidationTest.class);
+ suiteAll.addTestSuite(WeldJarTest.class);
suiteAll.addTestSuite(BeansXMLTest.class);
suiteAll.addTestSuite(DependentProjectTest.class);
suiteAll.addTestSuite(EnableCDISupportForWarTest.class);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/WeldJarTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/WeldJarTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/WeldJarTest.java 2010-12-30 15:28:53 UTC (rev 27826)
@@ -0,0 +1,57 @@
+package org.jboss.tools.cdi.core.test;
+
+
+
+import java.io.IOException;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+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.core.runtime.Path;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ *
+ * @author V.Kabanovich
+ *
+ */
+public class WeldJarTest extends TestCase {
+ protected static String PLUGIN_ID = "org.jboss.tools.cdi.core.test";
+ IProject project1 = null;
+
+ public WeldJarTest() {}
+
+ public void setUp() throws Exception {
+ project1 = ResourcesUtils.importProject(PLUGIN_ID, "/projects/CDITest1");
+ project1.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ }
+
+ public void testWeldJar() throws CoreException, IOException {
+ ICDIProject cdi = CDICorePlugin.getCDIProject(project1, true);
+ Set<IBean> bs = cdi.getBeans(new Path("/CDITest1/src/cdi/test/MyShellImpl.java"));
+ assertFalse(bs.isEmpty());
+ IBean b = bs.iterator().next();
+ Set<IInjectionPoint> ps = b.getInjectionPoints();
+ IInjectionPoint p = ps.iterator().next();
+ Set<IBean> inbs = cdi.getBeans(false, p);
+ assertFalse(inbs.isEmpty());
+ }
+
+ public void tearDown() throws Exception {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
+ project1.delete(true, true, null);
+ JobUtils.waitForIdle();
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/WeldJarTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27825 - 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: 2010-12-30 10:13:15 -0500 (Thu, 30 Dec 2010)
New Revision: 27825
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java
Log:
JBIDE-8019
https://issues.jboss.org/browse/JBIDE-8019
Modified: 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 2010-12-30 14:40:30 UTC (rev 27824)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ParametedType.java 2010-12-30 15:13:15 UTC (rev 27825)
@@ -144,7 +144,7 @@
if(signature != null && signature.equals(other.signature)) {
return true;
}
- if(type == null || !type.equals(other.type)) {
+ if(type == null || other.type == null || !type.getFullyQualifiedName().equals(other.type.getFullyQualifiedName())) {
return false;
}
if(parameterTypes.size() != other.parameterTypes.size()) {
14 years
JBoss Tools SVN: r27824 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-30 09:40:30 -0500 (Thu, 30 Dec 2010)
New Revision: 27824
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
Log:
JBIDE-8019
https://issues.jboss.org/browse/JBIDE-8019
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2010-12-30 13:04:10 UTC (rev 27823)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2010-12-30 14:40:30 UTC (rev 27824)
@@ -60,7 +60,9 @@
XModelObject o = model.getByPath("FileSystems").getChildByPath(jsname); //$NON-NLS-1$
if(o == null) continue;
XModelObject b = o.getChildByPath("META-INF/beans.xml");
- if(b == null) continue;
+ if(b == null && !isWeldJar(fileName)) {
+ continue;
+ }
newJars.put(p, b);
}
@@ -68,6 +70,13 @@
return newJars;
}
+ private boolean isWeldJar(String fileName) {
+ if(!fileName.startsWith("weld-")) return false;
+ if(fileName.indexOf("-javadoc") > 0) return false;
+ if(fileName.indexOf("-sources") > 0) return false;
+ return true;
+ }
+
public IProject getProjectResource() {
return project.getProject();
}
14 years
JBoss Tools SVN: r27823 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: scanner/lib and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-30 08:04:10 -0500 (Thu, 30 Dec 2010)
New Revision: 27823
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
Log:
JBIDE-8024
https://issues.jboss.org/browse/JBIDE-8024
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2010-12-30 08:54:55 UTC (rev 27822)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2010-12-30 13:04:10 UTC (rev 27823)
@@ -735,6 +735,17 @@
//we need that, or registering will remove them
ds.getNamespaces().addAll(ns);
}
+
+ Iterator<ISeamComponentDeclaration> it = ds.getComponents().iterator();
+ while(it.hasNext()) {
+ ISeamComponentDeclaration d = it.next();
+ if(d instanceof ISeamJavaComponentDeclaration) {
+ ISeamJavaComponentDeclaration sd = (ISeamJavaComponentDeclaration)d;
+ if(sd.getClassName() == null) {
+ it.remove();
+ }
+ }
+ }
registerComponents(ds, path);
long t2 = System.currentTimeMillis();
@@ -1335,6 +1346,9 @@
*/
public Set<ISeamComponent> getComponentsByClass(String className) {
Set<ISeamComponent> result = new HashSet<ISeamComponent>();
+ if(className == null) {
+ return result;
+ }
Set<SeamComponentDeclaration> ds = components.getDeclarationsByClasName(className);
if(ds == null) return result;
for (SeamComponentDeclaration d: ds) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2010-12-30 08:54:55 UTC (rev 27822)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2010-12-30 13:04:10 UTC (rev 27823)
@@ -13,7 +13,6 @@
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -159,14 +158,16 @@
List<SeamProject> getSeamProjects(IProject project) throws CoreException {
List<SeamProject> list = new ArrayList<SeamProject>();
- IJavaProject javaProject = JavaCore.create(project);
- IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
- for (int i = 0; i < es.length; i++) {
- if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
- if(p == null || !p.isAccessible()) continue;
- ISeamProject sp = SeamCorePlugin.getSeamProject(p, false);
- if(sp != null) list.add((SeamProject)sp);
+ if(project.isAccessible() && project.hasNature(JavaCore.NATURE_ID)) {
+ IJavaProject javaProject = JavaCore.create(project);
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
+ if(p == null || !p.isAccessible()) continue;
+ ISeamProject sp = SeamCorePlugin.getSeamProject(p, false);
+ if(sp != null) list.add((SeamProject)sp);
+ }
}
}
return list;
14 years
JBoss Tools SVN: r27822 - trunk/common/features/org.jboss.tools.common.ui.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-12-30 03:54:55 -0500 (Thu, 30 Dec 2010)
New Revision: 27822
Modified:
trunk/common/features/org.jboss.tools.common.ui.feature/feature.xml
Log:
org.jboss.tools.common.ui.sidebyside removed from feature
Modified: trunk/common/features/org.jboss.tools.common.ui.feature/feature.xml
===================================================================
--- trunk/common/features/org.jboss.tools.common.ui.feature/feature.xml 2010-12-30 08:40:27 UTC (rev 27821)
+++ trunk/common/features/org.jboss.tools.common.ui.feature/feature.xml 2010-12-30 08:54:55 UTC (rev 27822)
@@ -52,10 +52,4 @@
install-size="0"
version="0.0.0"/>
- <plugin
- id="org.jboss.tools.common.ui.sidebyside"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
</feature>
14 years
JBoss Tools SVN: r27821 - in trunk/common/features: org.jboss.tools.common.text.ext.feature and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-12-30 03:40:27 -0500 (Thu, 30 Dec 2010)
New Revision: 27821
Modified:
trunk/common/features/org.jboss.tools.common.feature/feature.xml
trunk/common/features/org.jboss.tools.common.text.ext.feature/feature.xml
trunk/common/features/org.jboss.tools.common.ui.feature/feature.xml
Log:
https://issues.jboss.org/browse/JBIDE-8023 JSF component build missing test plugins from JST and VPE components
update common features to include missing plugins
Modified: trunk/common/features/org.jboss.tools.common.feature/feature.xml
===================================================================
--- trunk/common/features/org.jboss.tools.common.feature/feature.xml 2010-12-30 08:10:04 UTC (rev 27820)
+++ trunk/common/features/org.jboss.tools.common.feature/feature.xml 2010-12-30 08:40:27 UTC (rev 27821)
@@ -21,17 +21,34 @@
source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
Raleigh NC 27606 USA.
</license>
+ <requires>
+ <import feature="org.eclipse.wst.common_core.feature"
+ version="0.0.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.wst.common_ui.feature"
+ version="0.0.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.jboss.tools.common.el.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
- <includes
- id="org.eclipse.wst.common_core.feature"
+ <plugin
+ id="org.jboss.tools.common.el.ui"
+ download-size="0"
+ install-size="0"
version="0.0.0"/>
- <includes
- id="org.eclipse.wst.common_ui.feature"
+ <plugin
+ id="org.jboss.tools.common.resref.core"
+ download-size="0"
+ install-size="0"
version="0.0.0"/>
- <requires>
- <import feature="org.jboss.tools.common.text.ext.feature" version="0.0.0" match="greaterOrEqual"/>
- </requires>
-
+ <plugin
+ id="org.jboss.tools.common.resref.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
</feature>
Modified: trunk/common/features/org.jboss.tools.common.text.ext.feature/feature.xml
===================================================================
--- trunk/common/features/org.jboss.tools.common.text.ext.feature/feature.xml 2010-12-30 08:10:04 UTC (rev 27820)
+++ trunk/common/features/org.jboss.tools.common.text.ext.feature/feature.xml 2010-12-30 08:40:27 UTC (rev 27821)
@@ -23,7 +23,12 @@
</license>
<requires>
- <import feature="org.jboss.tools.common.core.feature" version="2.0.0" match="greaterOrEqual"/>
+ <import feature="org.jboss.tools.common.core.feature"
+ version="0.0.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.wst.common_core.feature"
+ version="0.0.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.wst.common_ui.feature"
+ version="0.0.0" match="greaterOrEqual"/>
</requires>
<plugin
Modified: trunk/common/features/org.jboss.tools.common.ui.feature/feature.xml
===================================================================
--- trunk/common/features/org.jboss.tools.common.ui.feature/feature.xml 2010-12-30 08:10:04 UTC (rev 27820)
+++ trunk/common/features/org.jboss.tools.common.ui.feature/feature.xml 2010-12-30 08:40:27 UTC (rev 27821)
@@ -46,4 +46,16 @@
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.jboss.tools.common.model.ui.capabilities"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.ui.sidebyside"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
14 years
JBoss Tools SVN: r27820 - trunk/jst/features/org.jboss.tools.jst.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-12-30 03:10:04 -0500 (Thu, 30 Dec 2010)
New Revision: 27820
Modified:
trunk/jst/features/org.jboss.tools.jst.feature/feature.xml
Log:
https://issues.jboss.org/browse/JBIDE-8023 JSF component build missing test plugins from JST and VPE components
Missing plugins are added to jst feature
Modified: trunk/jst/features/org.jboss.tools.jst.feature/feature.xml
===================================================================
--- trunk/jst/features/org.jboss.tools.jst.feature/feature.xml 2010-12-30 02:16:07 UTC (rev 27819)
+++ trunk/jst/features/org.jboss.tools.jst.feature/feature.xml 2010-12-30 08:10:04 UTC (rev 27820)
@@ -29,6 +29,12 @@
version="0.0.0"/>
<plugin
+ id="org.jboss.tools.jst.web.kb"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
id="org.jboss.tools.jst.web.ui"
download-size="0"
install-size="0"
@@ -53,4 +59,18 @@
version="0.0.0"
unpack="false" />
+ <plugin
+ id="org.jboss.tools.jst.text.ext"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false" />
+
+ <plugin
+ id="org.jboss.tools.jst.css"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false" />
+
</feature>
14 years