You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by st...@apache.org on 2013/10/28 15:16:23 UTC

svn commit: r1536362 - in /sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal: SlingBundleModuleFactory.java SlingContentModuleFactory.java

Author: stefanegli
Date: Mon Oct 28 14:16:23 2013
New Revision: 1536362

URL: http://svn.apache.org/r1536362
Log:
SLING-3211 : clear module cache on changes in .settings - to catch changes in facets and allow add/remove of the project to a server without an eclipse restart.

Modified:
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java?rev=1536362&r1=1536361&r2=1536362&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java (original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java Mon Oct 28 14:16:23 2013
@@ -29,6 +29,7 @@ import org.eclipse.core.resources.IResou
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.IJavaProject;
@@ -44,6 +45,16 @@ import org.eclipse.wst.server.core.util.
 public class SlingBundleModuleFactory extends ProjectModuleFactoryDelegate {
 
     static final String SLING_BUNDLE_FACET_ID = "sling.bundle";
+	private static final IPath[] SETTINGS_PATHS = new IPath[] {new Path(".settings")};
+    
+    @Override
+    protected IPath[] getListenerPaths() {
+    	// returning the .settings path instead of null (as done by the parent)
+    	// results in clearing the cache on changes to .settings - which in turn
+    	// results in re-evaluating facet changes.
+    	// we could be more specific here but .settings changes are infrequent anyway.
+    	return SETTINGS_PATHS;
+    }
 
     @Override
     public ModuleDelegate getModuleDelegate(IModule module) {

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java?rev=1536362&r1=1536361&r2=1536362&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java (original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java Mon Oct 28 14:16:23 2013
@@ -12,6 +12,7 @@ import org.eclipse.core.resources.IResou
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.common.project.facet.core.IFacetedProject;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
@@ -26,6 +27,16 @@ import org.eclipse.wst.server.core.util.
 public class SlingContentModuleFactory extends ProjectModuleFactoryDelegate {
 
     static final String SLING_CONTENT_FACET_ID = "sling.content";
+	private static final IPath[] SETTINGS_PATHS = new IPath[] {new Path(".settings")};
+    
+    @Override
+    protected IPath[] getListenerPaths() {
+    	// returning the .settings path instead of null (as done by the parent)
+    	// results in clearing the cache on changes to .settings - which in turn
+    	// results in re-evaluating facet changes.
+    	// we could be more specific here but .settings changes are infrequent anyway.
+    	return SETTINGS_PATHS;
+    }
 
     @Override
     public ModuleDelegate getModuleDelegate(IModule module) {