Author: rob.stryker(a)jboss.com
Date: 2009-09-22 17:03:06 -0400 (Tue, 22 Sep 2009)
New Revision: 17696
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/modules/JBTProjectModuleFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceListVirtualFolder.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java
Log:
Ongoing slight cleanup when testing all the pieces that should go into a new project
structure. Fixes include incorrect variable used in FilesetVirtualComponent, module
factory superclass requires to state files that mandate a re-cache, etc
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/modules/JBTProjectModuleFactory.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/modules/JBTProjectModuleFactory.java 2009-09-22
20:14:27 UTC (rev 17695)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/modules/JBTProjectModuleFactory.java 2009-09-22
21:03:06 UTC (rev 17696)
@@ -6,8 +6,11 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.StructureEdit;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
@@ -101,6 +104,13 @@
}
}
+ protected IPath[] getListenerPaths() {
+ return new IPath[] { new Path(".project"), // nature
+ new Path(StructureEdit.MODULE_META_FILE_NAME), // component
+ new Path(".settings/org.eclipse.wst.common.project.facet.core.xml") //
facets
+ };
+ }
+
protected abstract JBTProjectModuleDelegate createDelegate(IProject project);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceListVirtualFolder.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceListVirtualFolder.java 2009-09-22
20:14:27 UTC (rev 17695)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceListVirtualFolder.java 2009-09-22
21:03:06 UTC (rev 17696)
@@ -16,9 +16,6 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-// TODO THis class is fucked and incorrectly works.
-// The first instance (top) treats 'resources' as folders to search
-// Others try to treat it as items that are inside. This is bad.
public class ResourceListVirtualFolder extends VirtualFolder {
private ArrayList<IResource> children;
@@ -35,7 +32,7 @@
IProject aComponentProject,
IPath aRuntimePath, IContainer[] underlyingContainers) {
this(aComponentProject, aRuntimePath);
- this.underlying.addAll(Arrays.asList(underlyingContainers));
+ addUnderlyingResource(underlyingContainers);
}
public ResourceListVirtualFolder(
@@ -43,11 +40,11 @@
IPath aRuntimePath, IContainer[] underlyingContainers,
IResource[] looseResources) {
this(aComponentProject, aRuntimePath, underlyingContainers);
- this.children.addAll(Arrays.asList(looseResources));
+ addChildren(looseResources);
}
protected void addUnderlyingResource(IResource resource) {
- if( underlying instanceof IContainer ) {
+ if( resource instanceof IContainer ) {
underlying.add((IContainer)resource);
try {
IResource[] newChildren = ((IContainer)resource).members();
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java 2009-09-22
20:14:27 UTC (rev 17695)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java 2009-09-22
21:03:06 UTC (rev 17696)
@@ -63,6 +63,7 @@
}
public IVirtualFolder getRootFolder() {
+ // Creates a new instance each time to ensure it's not cached
IContainer[] containers = getUnderlyingContainers();
IResource[] looseResources = getLooseResources();
ResourceListVirtualFolder folder =