[jbosstools-commits] JBoss Tools SVN: r36077 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: core/extension/feature and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Oct 28 16:43:03 EDT 2011


Author: scabanovich
Date: 2011-10-28 16:43:03 -0400 (Fri, 28 Oct 2011)
New Revision: 36077

Added:
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanStoreFeature.java
Modified:
   trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.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/validation/CDIProjectTree.java
Log:
JBIDE-9244
https://issues.jboss.org/browse/JBIDE-9244
Provided loading of validation context in dependent projects.

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java	2011-10-28 19:51:52 UTC (rev 36076)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java	2011-10-28 20:43:03 UTC (rev 36077)
@@ -47,6 +47,7 @@
 import org.jboss.tools.common.util.FileUtil;
 import org.jboss.tools.common.validation.internal.ProjectValidationContext;
 import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
 import org.jboss.tools.jst.web.kb.WebKbPlugin;
 import org.w3c.dom.Element;
 
@@ -363,6 +364,7 @@
 		if(load) {
 			load();
 		} else {
+			loadProjectDependenciesFromKBProject();
 			isStorageResolved = true;
 		}
 	}
@@ -588,6 +590,7 @@
 				if(p == null || p.trim().length() == 0) continue;
 				IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(p);
 				if(project == null || !project.isAccessible()) continue;
+				KbProjectFactory.getKbProject(project, true, true);
 				CDICoreNature sp = CDICorePlugin.getCDI(project, false);
 				if(sp != null) {
 					addUsedCDIProject(sp);
@@ -604,6 +607,7 @@
 				if(p == null || p.trim().length() == 0) continue;
 				IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(p);
 				if(project == null || !project.isAccessible()) continue;
+				KbProjectFactory.getKbProject(project, true, true);
 				CDICoreNature sp = CDICorePlugin.getCDI(project, false);
 				if(sp != null) {
 					addDependentCDIProject(sp);

Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanStoreFeature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanStoreFeature.java	                        (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanStoreFeature.java	2011-10-28 20:43:03 UTC (rev 36077)
@@ -0,0 +1,29 @@
+/******************************************************************************* 
+ * Copyright (c) 2011 Red Hat, Inc. 
+ * Distributed under license by Red Hat, Inc. All rights reserved. 
+ * This program is made available under the terms of the 
+ * Eclipse Public License v1.0 which accompanies this distribution, 
+ * and is available at http://www.eclipse.org/legal/epl-v10.html 
+ * 
+ * Contributors: 
+ * Red Hat, Inc. - initial API and implementation 
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.extension.feature;
+
+import org.jboss.tools.cdi.core.ICDIProject;
+
+/**
+ * 
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface IBeanStoreFeature extends ICDIFeature {
+
+	/**
+	 * Updates all model caches that sort all available beans in a way that optimizes access to them. 
+	 *  
+	 * @return
+	 */
+	public void updateCaches(ICDIProject project);
+
+}


Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanStoreFeature.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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	2011-10-28 19:51:52 UTC (rev 36076)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java	2011-10-28 20:43:03 UTC (rev 36077)
@@ -59,6 +59,7 @@
 import org.jboss.tools.cdi.core.IStereotype;
 import org.jboss.tools.cdi.core.IStereotypeDeclaration;
 import org.jboss.tools.cdi.core.extension.feature.IAmbiguousBeanResolverFeature;
+import org.jboss.tools.cdi.core.extension.feature.IBeanStoreFeature;
 import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
 import org.jboss.tools.cdi.internal.core.event.CDIProjectChangeEvent;
 import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
@@ -1124,6 +1125,11 @@
 				bp.buildBeans(this);
 			}
 		}
+		
+		Set<IBeanStoreFeature> beanStores = n.getExtensionManager().getFeatures(IBeanStoreFeature.class);
+		for (IBeanStoreFeature bp: beanStores) {
+			bp.updateCaches(this);
+		}
 
 		if(updateDependent) {
 			CDICoreNature[] ps = n.getAllDependentProjects();

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectTree.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectTree.java	2011-10-28 19:51:52 UTC (rev 36076)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIProjectTree.java	2011-10-28 20:43:03 UTC (rev 36077)
@@ -53,7 +53,7 @@
 			allProjects.add(project);
 			if(!validatingProjects.contains(project)) {
 				validatingProjects.add(project);
-				CDICoreNature currentNature = CDICorePlugin.getCDI(project, false);
+				CDICoreNature currentNature = CDICorePlugin.getCDI(project, true); //because we do not store it
 				if(currentNature!=null) {
 					Set<CDICoreNature> roots = getRootProjects(currentNature);
 					for (CDICoreNature root : roots) {



More information about the jbosstools-commits mailing list