JBoss Tools SVN: r2139 - trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-06-15 20:41:24 -0400 (Fri, 15 Jun 2007)
New Revision: 2139
Modified:
trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java
Log:
server target combo assumed an AS instance was already defined
Modified: trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java
===================================================================
--- trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java 2007-06-15 18:40:47 UTC (rev 2138)
+++ trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java 2007-06-16 00:41:24 UTC (rev 2139)
@@ -139,8 +139,11 @@
protected void hideOrShowWarning() {
int index = serverTargetCombo.getSelectionIndex();
- String runtimeName = serverTargetCombo.getItem(index);
- org.eclipse.wst.server.core.IRuntime rt = ServerCore.findRuntime(runtimeName);
- warningLabel.setVisible(!EJB30SupportVerifier.verify(rt));
+ if (index > 0)
+ {
+ String runtimeName = serverTargetCombo.getItem(index);
+ org.eclipse.wst.server.core.IRuntime rt = ServerCore.findRuntime(runtimeName);
+ warningLabel.setVisible(!EJB30SupportVerifier.verify(rt));
+ }
}
}
\ No newline at end of file
17 years, 6 months
JBoss Tools SVN: r2138 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 14:40:47 -0400 (Fri, 15 Jun 2007)
New Revision: 2138
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
Log:
removed print statements
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-06-15 18:40:03 UTC (rev 2137)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-06-15 18:40:47 UTC (rev 2138)
@@ -159,11 +159,9 @@
boolean delete = concreteRelative.equals(emrModRelative);
if( delete ) {
- System.out.println("safe-deleting " + destPath.toOSString());
FileUtil.safeDelete(destPath.toFile(), listener);
} else {
// copy
- System.out.println("safe-copying " + destPath.toOSString());
FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
}
}
@@ -179,7 +177,6 @@
if( !changedFiles.contains(concrete)) {
changedFiles.add(concrete);
IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
- System.out.println("safe-copying " + destPath.toOSString());
FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
}
return;
17 years, 6 months
JBoss Tools SVN: r2137 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 14:40:03 -0400 (Fri, 15 Jun 2007)
New Revision: 2137
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/WarArchiveType.java
Log:
small change
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/WarArchiveType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/WarArchiveType.java 2007-06-15 17:04:35 UTC (rev 2136)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/WarArchiveType.java 2007-06-15 18:40:03 UTC (rev 2137)
@@ -75,11 +75,11 @@
IArchiveFolder lib = addFolder(project, webinf, LIB);
IArchiveFolder classes = addFolder(project, webinf, CLASSES);
addReferencedProjectsAsLibs(project, lib);
+ addLibFileset(project, lib, true);
addClassesFileset(project, classes);
if( mod == null ) {
addWebinfFileset(project, webinf);
- addLibFileset(project, lib, true);
} else {
addWebContentFileset(project, topLevel);
}
@@ -131,7 +131,7 @@
}
protected void addReferencedProjectsAsLibs(IProject project, IArchiveFolder folder) {
IJavaProject jp = JavaCore.create(project);
- if( jp != null ) {
+ if( jp != null && jp.exists()) {
try {
IClasspathEntry[] entries = jp.getRawClasspath();
for( int i = 0; i < entries.length; i++ ) {
17 years, 6 months
JBoss Tools SVN: r2136 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: publishers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 13:04:35 -0400 (Fri, 15 Jun 2007)
New Revision: 2136
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
Log:
turning IArchives into modules reworked, publishing now complies
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java 2007-06-15 17:03:39 UTC (rev 2135)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java 2007-06-15 17:04:35 UTC (rev 2136)
@@ -68,8 +68,6 @@
}
public void cleanArchive(IArchive pkg) {
- PackagedModuleDelegate del = getModuleDelegate(pkg);
- del.reset();
}
@@ -80,12 +78,8 @@
}
public void fileRemoved(IArchive topLevelPackage, IArchiveFileSet fileset, IPath filePath) {
- PackagedModuleDelegate del = getModuleDelegate(topLevelPackage);
- del.fileRemoved(filePath, fileset);
}
public void fileUpdated(IArchive topLevelPackage, IArchiveFileSet fileset, IPath filePath) {
- PackagedModuleDelegate del = getModuleDelegate(topLevelPackage);
- del.fileUpdated(filePath, fileset);
}
// If we're supposed to auto-deploy, get on it
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java 2007-06-15 17:03:39 UTC (rev 2135)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java 2007-06-15 17:04:35 UTC (rev 2136)
@@ -21,12 +21,9 @@
*/
package org.jboss.ide.eclipse.as.core.packages;
-import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Date;
import java.util.HashMap;
-import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -34,19 +31,18 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.internal.ModuleFactory;
import org.eclipse.wst.server.core.internal.ModuleFile;
-import org.eclipse.wst.server.core.internal.ModuleFolder;
import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.server.core.model.IModuleFolder;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.ModuleDelegate;
import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
-import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModelCore;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
@@ -114,7 +110,7 @@
prefs.flush();
} catch( BackingStoreException bse ) {
}
- return MODULE_ID_PROPERTY_KEY + "." + nextArchiveId;
+ return "" + nextArchiveId;
} else if( propVal == null ) {
return null;
}
@@ -242,173 +238,257 @@
IArchive[] archives = (IArchive[])projectToPackages.get(proj);
IModule mod;
projectToPackages.remove(proj);
- for( int i = 0; i < archives.length; i++ ) {
- mod = (IModule)packageToModule.get(archives[i]);
- packageToModule.remove(archives[i]);
- moduleDelegates.remove(mod);
+ if( archives != null ) {
+ for( int i = 0; i < archives.length; i++ ) {
+ mod = (IModule)packageToModule.get(archives[i]);
+ packageToModule.remove(archives[i]);
+ moduleDelegates.remove(mod);
+ }
}
createModules(proj);
+ System.out.println("clearing cache");
clearModuleCache();
}
}
- protected static interface IExtendedModuleResource {
- public IPath getPath();
+ public static interface IExtendedModuleResource extends IModuleResource {
+ public IPath getSourcePath();
public IArchiveNode getNode();
public IPath getDeepDestination();
+ public IPath getConcreteDestFile();
}
- public class PackagedModuleDelegate extends ModuleDelegate {
+ public class DelegateInitVisitor implements IArchiveNodeVisitor {
+
private IArchive pack;
- private HashMap members;
- private IArchiveNodeVisitor initVisitor;
- public PackagedModuleDelegate(IArchive pack) {
+ private HashMap members; // node -> imoduleresource
+ private HashMap pathToNode; // path -> node
+ public DelegateInitVisitor(IArchive pack) {
this.pack = pack;
- initVisitor = createInitVisitor();
+ reset();
}
- private IArchiveNodeVisitor createInitVisitor() {
- return new IArchiveNodeVisitor() {
- public boolean visit(IArchiveNode node) {
- if( node.getNodeType() == IArchiveNode.TYPE_ARCHIVE ) {
- IPath rel = ((IArchive)node).getRootArchiveRelativePath();
- members.put(rel, new ArchiveFolderModuleFolder(((IArchive)node).getName(), rel, node));
- } else if( node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
- IPath rel = ((IArchiveFolder)node).getRootArchiveRelativePath();
- members.put(rel, new ArchiveFolderModuleFolder(((IArchiveFolder)node).getName(), rel, node));
- } else if( node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET) {
- IArchiveFileSet fs = (IArchiveFileSet)node;
- IPath[] paths = fs.findMatchingPaths();
- File tmp = null;
- IPath archiveRelative;
- for( int i = 0; i < paths.length; i++ ) {
- archiveRelative = fs.getRootArchiveRelativePath(paths[i]);
- tmp = paths[i].toFile();
- ExtendedModuleFile emf = new ExtendedModuleFile(tmp.getName(), archiveRelative, tmp.lastModified(), paths[i], fs);
- members.put(archiveRelative, emf);
- IPath tmp2 = archiveRelative.removeFirstSegments(fs.getRootArchiveRelativePath().segmentCount()).removeLastSegments(1);
- if( tmp2.segmentCount() > 0 )
- addFoldersFor(fs, tmp2);
- }
- }
- return true;
- }
- };
+ public void reset() {
+ members = new HashMap();
+ pathToNode = new HashMap();
}
- protected void addFoldersFor(IArchiveFileSet fs, IPath fsRelative) {
- IPath fsBase = fs.getRootArchiveRelativePath();
- IPath folderPath = null;
- IPath tmpRelative;
- for( int i = 0; i < fsRelative.segmentCount(); i++ ) {
- tmpRelative = fsRelative.removeLastSegments(i);
- folderPath = fsBase.append(tmpRelative);
- if( !members.containsKey(folderPath))
- members.put(folderPath, new FilesetModuleFolder(folderPath.lastSegment(), folderPath, fs, fs.getGlobalSourcePath().append(tmpRelative)));
+ public boolean visit(IArchiveNode node) {
+ int type = node.getNodeType();
+ if( type == IArchiveNode.TYPE_ARCHIVE && ((IArchive)node).isTopLevel()) {
+ IPath rel = ((IArchive)node).getRootArchiveRelativePath();
+ members.put(node, new ArchiveContainerResource(((IArchive)node).getName(), node, rel));
+ pathToNode.put(rel, node);
+ } else if( type == IArchiveNode.TYPE_ARCHIVE || type == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
+ String name = type == IArchiveNode.TYPE_ARCHIVE ? ((IArchive)node).getName() : ((IArchiveFolder)node).getName();
+ // if we're any other archive or a folder, create us and add to parent
+ IArchiveNode parent = node.getParent();
+ ArchiveContainerResource parentAsResource = (ArchiveContainerResource)members.get(parent);
+ IPath rel = node.getRootArchiveRelativePath();
+ members.put(node, new ArchiveContainerResource(name, node, rel));
+ pathToNode.put(rel, node);
+ parentAsResource.addChild((IModuleResource)members.get(node));
+ } else if( type == IArchiveNode.TYPE_ARCHIVE_FILESET ) {
+ ArchiveContainerResource parentAsResource = (ArchiveContainerResource)members.get(node.getParent());
+ parentAsResource.addFilesetAsChild((IArchiveFileSet)node);
}
+
+ return true;
}
- public IArchive getPackage() {
- return pack;
+
+ public IModuleResource getRootResource() {
+ return (IModuleResource)members.get(pack);
}
- public IModule[] getChildModules() {
- return new IModule[0];
- }
- public void reset() {
- members = null;
+ public IModuleResource getResourceForNode(IArchiveNode node) {
+ return (IModuleResource)members.get(node);
}
+ }
+
+ public class ArchiveContainerResource implements IModuleFolder, IExtendedModuleResource {
- protected void init() {
+ protected IPath moduleRelativePath;
+ protected IArchiveNode node;
+ protected String name;
+ private HashMap members;
+
+ // represents source folder on disk. only used if node is fileset
+ private IPath folderGlobalPath = null;
+ public ArchiveContainerResource(String name,IArchiveNode node,IPath moduleRelativePath ) {
+ this.name = name;
+ this.node = node;
+ this.moduleRelativePath = moduleRelativePath;
members = new HashMap();
- pack.accept(initVisitor);
+ if( node instanceof IArchiveFileSet) {
+ IPath tmp = moduleRelativePath.removeFirstSegments(node.getParent().getRootArchiveRelativePath().segmentCount());
+ folderGlobalPath = ((IArchiveFileSet)node).getGlobalSourcePath().append(tmp);
+ }
}
+
+ public int hashCode() {
+ return name.hashCode() * 37 + moduleRelativePath.hashCode();
+ }
- public IModuleResource[] members() throws CoreException {
- init();
- Collection c = members.values();
- return (IModuleResource[]) c.toArray(new IModuleResource[c.size()]);
+ public boolean equals(Object other) {
+ if (other instanceof IModuleFolder) {
+ IModuleFolder resource = (IModuleFolder) other;
+ return resource.getModuleRelativePath().equals(getModuleRelativePath());
+ }
+ return false;
}
+
+ public void addChild(IModuleResource resource) {
+ members.put(resource.getModuleRelativePath(), resource);
+ }
- public void fileUpdated(IPath changedFile, IArchiveFileSet fs) {
- IPath archiveRelative = fs.getRootArchiveRelativePath(changedFile);
- long stamp = new Date().getTime();
- ExtendedModuleFile emf = new ExtendedModuleFile(changedFile.lastSegment(), archiveRelative, stamp, changedFile, fs);
- members.put(archiveRelative, emf);
+ public void removeChild(IPath moduleRelativePath) {
+ members.remove(moduleRelativePath);
}
- public void fileRemoved(IPath removedFile, IArchiveFileSet fs) {
- IPath archiveRelative = fs.getRootArchiveRelativePath(removedFile);
- members.remove(archiveRelative);
+ public IModuleResource getChild(IPath path) {
+ return (IModuleResource)members.get(path);
}
-
- public class ExtendedModuleFile extends ModuleFile implements IExtendedModuleResource {
- private IPath srcPath;
- private IArchiveFileSet node;
- public ExtendedModuleFile(String name, IPath relativePath, long stamp,
- IPath srcPath, IArchiveFileSet fs) {
- super(name, relativePath, stamp);
- this.srcPath = srcPath;
- this.node = fs;
- System.out.println("adding emfile " + srcPath);
+ public void addFilesetAsChild(IArchiveFileSet fs) {
+ IPath[] paths = fs.findMatchingPaths(); // file-system based source paths
+ IPath globalSource = fs.getGlobalSourcePath();
+ for( int i = 0; i < paths.length; i++ ) {
+ addFilesetPathAsChild(fs, globalSource, paths[i]);
}
- public IPath getPath() { return srcPath; }
- public IArchiveNode getNode() { return node; }
- public IPath getDeepDestination() {
- return node.getRootArchive().getDestinationPath().append(node.getRootArchiveRelativePath(path));
+ }
+
+ public void addFilesetPathAsChild(IArchiveFileSet fs, IPath globalSource, IPath path) {
+ IPath archiveRelative = fs.getRootArchiveRelativePath(path);
+ IPath fsRelative = path.removeFirstSegments(globalSource.segmentCount());
+ ArchiveContainerResource parent = find(fs, globalSource, fsRelative.removeLastSegments(1), true);
+ ExtendedModuleFile emf = new ExtendedModuleFile(archiveRelative.lastSegment(), archiveRelative, path.toFile().lastModified(), path, fs);
+ parent.addChild(emf);
+ }
+
+ public void removeFilesetPathAsChild(IArchiveFileSet fs, IPath path) {
+ IPath archiveRelative = fs.getRootArchiveRelativePath(path);
+ IPath globalSource = fs.getGlobalSourcePath();
+ IPath fsRelative = path.removeFirstSegments(globalSource.segmentCount());
+ ArchiveContainerResource parent = find(fs, globalSource, fsRelative.removeLastSegments(1), false);
+ if( parent != null )
+ parent.removeFilesetPathAsChild(fs, path);
+ }
+
+ protected ArchiveContainerResource find(IArchiveFileSet fs, IPath globalSource, IPath fsRelative, boolean create) {
+ ArchiveContainerResource resource = this;
+ ArchiveContainerResource tmpResource;
+ IPath tmpPath = fs.getRootArchiveRelativePath();
+ int count = fsRelative.segmentCount();
+ for( int i = 0; i < count; i++ ) {
+ tmpPath = tmpPath.append(fsRelative.segment(i));
+ tmpResource = (ArchiveContainerResource)resource.getChild(tmpPath);
+ if( tmpResource == null ) {
+ if( !create )
+ return null;
+ tmpResource = new ArchiveContainerResource(tmpPath.lastSegment(), fs, tmpPath);
+ resource.addChild(tmpResource);
+ }
+ resource = tmpResource;
}
+ return resource;
}
+
+ public IModuleResource[] members() {
+ Collection c = members.values();
+ return (IModuleResource[]) c.toArray(new IModuleResource[c.size()]);
+ }
- public class FilesetModuleFolder extends ModuleFolder implements IExtendedModuleResource {
+ public IPath getModuleRelativePath() {
+ return moduleRelativePath;
+ }
- private IArchiveFileSet node;
- private IPath srcPath;
- public FilesetModuleFolder(String name, IPath path, IArchiveFileSet fs, IPath srcPath) {
- super(name, path);
- this.node = fs;
- this.srcPath = srcPath;
- }
- public IPath getPath() { return srcPath; }
- public IArchiveNode getNode() { return node; }
- public IPath getDeepDestination() {
- return node.getRootArchive().getDestinationPath().append(node.getRootArchiveRelativePath(path));
- }
+ public String getName() {
+ return name;
}
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public IPath getDeepDestination() {
+ IPath tmp = node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET ?
+ ((IArchiveFileSet)node).getRootArchiveRelativePath(folderGlobalPath) : node.getRootArchiveRelativePath();
+ return node.getRootArchive().getGlobalDestinationPath().append(tmp);
+ }
+ public IPath getConcreteDestFile() {
+ return ModelUtil.getBaseDestinationFile(node,folderGlobalPath);
+ }
+ public IArchiveNode getNode() {
+ return node;
+ }
+
+ public IPath getSourcePath() {
+ return null;
+ }
- public class ArchiveFolderModuleFolder extends ModuleFolder implements IExtendedModuleResource {
- private IArchiveNode node;
- private IPath srcPath;
- public ArchiveFolderModuleFolder(String name, IPath path, IArchiveNode node) {
- super(name, path);
- this.node = node;
- this.srcPath = null;
- }
- public IPath getPath() { return srcPath; }
- public IArchiveNode getNode() { return node; }
- public IPath getDeepDestination() {
- return node.getRootArchive().getDestinationPath().append(node.getRootArchiveRelativePath());
- }
+ }
+
+ public class ExtendedModuleFile extends ModuleFile implements IExtendedModuleResource {
+ private IPath srcPath;
+ private IArchiveFileSet node;
+ public ExtendedModuleFile(String name, IPath relativePath, long stamp,
+ IPath srcPath, IArchiveFileSet fs) {
+ super(name, relativePath, stamp);
+ this.srcPath = srcPath;
+ this.node = fs;
}
+ public int hashCode() {
+ return name.hashCode() * 37 + path.hashCode();
+ }
- public IPath getSourceFile(IModuleResource mf) {
- if( mf instanceof IExtendedModuleResource ) {
- return ((IExtendedModuleResource)mf).getPath();
+ public IPath getPath() { return srcPath; }
+ public IArchiveNode getNode() { return node; }
+ public IPath getDeepDestination() {
+ return node.getRootArchive().getGlobalDestinationPath().append(node.getRootArchiveRelativePath(path));
+ }
+ public IPath getSourcePath() {
+ return this.srcPath;
+ }
+
+ public IPath getConcreteDestFile() {
+ return ModelUtil.getBaseDestinationFile(node, srcPath);
+ }
+
+ public boolean equals(Object other) {
+ if (other instanceof IModuleFile) {
+ IModuleFile resource = (IModuleFile) other;
+ return resource.getModuleRelativePath().equals(getModuleRelativePath());
}
- return null;
+ return false;
}
- public IPath getConcreteDestFile(IModuleResource mr) {
- if( mr instanceof IExtendedModuleResource ) {
- IExtendedModuleResource emf =(IExtendedModuleResource)mr;
- return ModelUtil.getBaseDestinationFile(emf.getNode(), emf.getPath());
- }
- return null;
+ }
+
+
+ public class PackagedModuleDelegate extends ModuleDelegate {
+ private IArchive pack;
+ private IModuleResource rootResource;
+ private DelegateInitVisitor initVisitor;
+ public PackagedModuleDelegate(IArchive pack) {
+ this.pack = pack;
+ initVisitor = new DelegateInitVisitor(pack);
}
+
+ public IArchive getPackage() {
+ return pack;
+ }
+ public IModule[] getChildModules() {
+ return new IModule[0];
+ }
+
+ protected void init() {
+ initVisitor.reset();
+ pack.accept(initVisitor);
+ rootResource = initVisitor.getRootResource();
+ }
- public IPath getDeepDestFile(IModuleResource mf) {
- if( mf instanceof IExtendedModuleResource ) {
- return ((IExtendedModuleResource)mf).getDeepDestination();
- }
- return null;
+ public IModuleResource[] members() throws CoreException {
+ init();
+ return new IModuleResource[] { rootResource };
}
-
+
public IStatus validate() {
return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
0, "", null);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-06-15 17:03:39 UTC (rev 2135)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-06-15 17:04:35 UTC (rev 2136)
@@ -21,7 +21,6 @@
*/
package org.jboss.ide.eclipse.as.core.publishers;
-import java.io.File;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Set;
@@ -39,7 +38,6 @@
import org.eclipse.wst.server.core.internal.ModuleFile;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-06-15 17:03:39 UTC (rev 2135)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-06-15 17:04:35 UTC (rev 2136)
@@ -31,11 +31,13 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleFolder;
+import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.ExtendedModuleFile;
+import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.IExtendedModuleResource;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.PackagedModuleDelegate;
import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublishEvent;
import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublisherFileUtilListener;
@@ -104,14 +106,13 @@
protected void publishModule(IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
- System.out.println("*********** publishing");
PublishEvent event = PublisherEventLogger.createSingleModuleTopEvent(eventRoot, module, kind, deltaKind);
IArchive pack = getPackage(module);
IPath sourcePath = pack.getArchiveFilePath();
IPath destPathRoot = new Path(server.getDeployDirectory());
// if destination is deploy directory... no need to re-copy!
- if( destPathRoot.toOSString().equals(pack.getDestinationPath().toOSString())) {
+ if( destPathRoot.toOSString().equals(pack.getGlobalDestinationPath().toOSString())) {
// fire null publish event
return;
}
@@ -132,30 +133,79 @@
}
protected void publishFromDelta(IModule module, IPath destPathRoot, IPath sourcePrefix,
IModuleResourceDelta[] delta, PublisherFileUtilListener listener) {
- PackagedModuleDelegate delegate = (PackagedModuleDelegate)module.loadAdapter(PackagedModuleDelegate.class, new NullProgressMonitor());
- IPath concrete = null, destPath;
- for( int j = 0; j < delta.length; j++ ) {
- switch(delta[j].getKind()) {
- case IModuleResourceDelta.ADDED:
- case IModuleResourceDelta.CHANGED:
- concrete = delegate.getConcreteDestFile(delta[j].getModuleResource());
- destPath = destPathRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
- if( delta[j].getModuleResource() instanceof IModuleFolder ) {
- System.out.println("mkdirs " + destPath.toOSString());
- destPath.toFile().mkdirs();
+ ArrayList changedFiles = new ArrayList();
+ for( int i = 0; i < delta.length; i++ ) {
+ publishFromDeltaHandle(delta[i], destPathRoot, sourcePrefix, changedFiles, listener);
+ }
+ }
+ protected void publishFromDeltaHandle(IModuleResourceDelta delta, IPath destRoot,
+ IPath sourcePrefix, ArrayList changedFiles, PublisherFileUtilListener listener) {
+ switch( delta.getKind()) {
+ case IModuleResourceDelta.REMOVED:
+ // removed might not be IExtendedModuleResource
+ IModuleResource imr = delta.getModuleResource();
+ if( imr instanceof IExtendedModuleResource) {
+ IExtendedModuleResource emr = ((IExtendedModuleResource)imr);
+ IPath concrete = emr.getConcreteDestFile();
+ if( !changedFiles.contains(concrete)) {
+ IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
+
+ // file hasnt been updated yet.
+ // But we don't know whether to delete or copy this file.
+ // depends where it is in the tree and what's exploded.
+ changedFiles.add(concrete);
+ IPath concreteRelative = concrete.removeFirstSegments(sourcePrefix.segmentCount()).setDevice(null);
+ IPath emrModRelative = emr.getModuleRelativePath();
+ boolean delete = concreteRelative.equals(emrModRelative);
+
+ if( delete ) {
+ System.out.println("safe-deleting " + destPath.toOSString());
+ FileUtil.safeDelete(destPath.toFile(), listener);
} else {
+ // copy
System.out.println("safe-copying " + destPath.toOSString());
FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
}
- break;
- case IModuleResourceDelta.REMOVED:
- concrete = delegate.getConcreteDestFile(delta[j].getModuleResource());
- destPath = destPathRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
- System.out.println("safe-deleting " + destPath.toOSString());
- FileUtil.safeDelete(destPath.toFile(), listener);
- break;
+ }
+ return;
+ } else {
+ System.out.println("not an extended module resource. need help here");
+ return;
}
+ case IModuleResourceDelta.ADDED:
+ imr = delta.getModuleResource();
+ if( imr instanceof IExtendedModuleResource) {
+ IPath concrete = ((IExtendedModuleResource)imr).getConcreteDestFile();
+ if( !changedFiles.contains(concrete)) {
+ changedFiles.add(concrete);
+ IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
+ System.out.println("safe-copying " + destPath.toOSString());
+ FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
+ }
+ return;
+ } else {
+ System.out.println("not an extended module resource. need help here");
+ return;
+ }
+ case IModuleResourceDelta.CHANGED:
+ imr = delta.getModuleResource();
+ if( imr instanceof ExtendedModuleFile ) {
+ IPath concrete = ((ExtendedModuleFile)imr).getConcreteDestFile();
+ if( !changedFiles.contains(concrete)) {
+ changedFiles.add(concrete);
+ IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
+ FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
+ }
+ }
+ break;
}
+
+ IModuleResourceDelta[] children = delta.getAffectedChildren();
+ if( children != null ) {
+ for( int i = 0; i < children.length; i++ ) {
+ publishFromDeltaHandle(children[i], destRoot, sourcePrefix, changedFiles, listener);
+ }
+ }
}
protected IArchive getPackage(IModule module) {
17 years, 6 months
JBoss Tools SVN: r2135 - trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 13:03:39 -0400 (Fri, 15 Jun 2007)
New Revision: 2135
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java
Log:
complies with API change in IArchiveFileSet
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java 2007-06-15 17:03:18 UTC (rev 2134)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java 2007-06-15 17:03:39 UTC (rev 2135)
@@ -89,7 +89,7 @@
private String getPackageText (IArchive pkg) {
String text = pkg.getName();
if (PrefsInitializer.getBoolean( PrefsInitializer.PREF_SHOW_PACKAGE_OUTPUT_PATH)) {
- text += " [" + pkg.getDestinationPath() + "]";
+ text += " [" + pkg.getGlobalDestinationPath() + "]";
}
return text;
}
17 years, 6 months
JBoss Tools SVN: r2134 - trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 13:03:18 -0400 (Fri, 15 Jun 2007)
New Revision: 2134
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
Log:
ui cleanup
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2007-06-15 17:01:54 UTC (rev 2133)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2007-06-15 17:03:18 UTC (rev 2134)
@@ -1,6 +1,7 @@
package org.jboss.ide.eclipse.archives.ui.wizards.pages;
import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -141,13 +142,16 @@
if (archive.isTopLevel()) {
// TODO: FIX THIS
- destinationComposite.setPackageNodeDestination(archive.getDestinationPath());
+ IContainer container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(archive.getGlobalDestinationPath());
+ if( container != null )
+ destinationComposite.setPackageNodeDestination(container);
+ else
+ destinationComposite.setPackageNodeDestination(archive.getGlobalDestinationPath());
} else {
destinationComposite.setPackageNodeDestination(archive.getParent());
}
- if (archive.isExploded())
- {
+ if (archive.isExploded()) {
explodedButton.setEnabled(true);
} else {
compressedButton.setEnabled(true);
@@ -194,7 +198,7 @@
for( int i = 0; i < packages.length; i++ ) {
IArchive pkg = (IArchive) packages[i];
if (pkg.getName().equals(packageNameText.getText())
- && (pkg.getDestinationPath() != null && pkg.getDestinationPath().equals(container.getFullPath()))
+ && (pkg.getGlobalDestinationPath() != null && pkg.getGlobalDestinationPath().equals(container.getFullPath()))
&& (!pkg.equals(this.archive)))
{
setErrorMessage(
@@ -212,7 +216,7 @@
for( int i = 0; i < packages.length; i++ ) {
IArchive pkg = (IArchive) packages[i];
if (pkg.getName().equals(packageNameText.getText())
- && (pkg.getDestinationPath() != null && pkg.getDestinationPath().equals(path))
+ && (pkg.getGlobalDestinationPath() != null && pkg.getGlobalDestinationPath().equals(path))
&& (!pkg.equals(this.archive)))
{
setErrorMessage(
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2007-06-15 17:01:54 UTC (rev 2133)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2007-06-15 17:03:18 UTC (rev 2134)
@@ -155,8 +155,8 @@
Label projectImageLabel = new Label(rootProjectVal, SWT.NONE);
rootProjectLabel = new Label(rootProjectVal, SWT.NONE);
- projectImageLabel.setLayoutData(createFormData(0,0,null,0,0,5, null,0));
- rootProjectLabel.setLayoutData(createFormData(0,0,null,0,projectImageLabel, 5, 100,-5));
+ projectImageLabel.setLayoutData(createFormData(0,0,null,0,0,0, null,0));
+ rootProjectLabel.setLayoutData(createFormData(0,0,null,0,projectImageLabel, 10, 100,-5));
rootProjectKey.setLayoutData(createFormData(destinationComposite,5,null,0,null,5,0,max));
rootProjectVal.setLayoutData(createFormData(destinationComposite,5, null, 0, destinationKey, 5, 100, -5));
17 years, 6 months
JBoss Tools SVN: r2133 - trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 13:01:54 -0400 (Fri, 15 Jun 2007)
New Revision: 2133
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveNodeDestinationComposite.java
Log:
ui cleanup
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveNodeDestinationComposite.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveNodeDestinationComposite.java 2007-06-15 16:59:40 UTC (rev 2132)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveNodeDestinationComposite.java 2007-06-15 17:01:54 UTC (rev 2133)
@@ -58,15 +58,15 @@
Composite browseComposite = new Composite(this, SWT.NONE);
// set up their layout positioning
- destinationImage.setLayoutData(createFormData(0,5,null, 0, 0, 5, null, 0));
- destinationText.setLayoutData(createFormData(0, 5, null, 0, destinationImage, 5, browseComposite, -5));
+ destinationImage.setLayoutData(createFormData(0,5,null, 0, 0, 0, null, 0));
+ destinationText.setLayoutData(createFormData(0, 5, null, 0, destinationImage, 5, destinationImage, 205));
// set text, add listeners, etc
destinationText.setEditable(false);
browseComposite.setLayout(new FillLayout());
- browseComposite.setLayoutData(createFormData(0,0,null,0,null,0,100,-5));
+ browseComposite.setLayoutData(createFormData(0,0,null,0,destinationText,5,100,-5));
fillBrowseComposite(browseComposite);
// call other functions required for startup
@@ -113,7 +113,7 @@
protected void openDestinationDialog ()
{
- ArchiveNodeDestinationDialog dialog = new ArchiveNodeDestinationDialog(getShell(), nodeDestination, false, true);
+ ArchiveNodeDestinationDialog dialog = new ArchiveNodeDestinationDialog(getShell(), nodeDestination, true, true);
if (nodeDestination != null)
dialog.setInitialSelection(nodeDestination);
17 years, 6 months
JBoss Tools SVN: r2132 - in trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core: project and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 12:59:40 -0400 (Fri, 15 Jun 2007)
New Revision: 2132
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ArchivesBuilder.java
Log:
complies with API change in IArchiveFileSet
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java 2007-06-15 16:58:13 UTC (rev 2131)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java 2007-06-15 16:59:40 UTC (rev 2132)
@@ -32,7 +32,7 @@
if( pack.isDestinationInWorkspace() ) {
// refresh the root package node
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IResource res = root.getContainerForLocation(pack.getDestinationPath());
+ IResource res = root.getContainerForLocation(pack.getGlobalDestinationPath());
if( res != null ) {
try {
res.getParent().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ArchivesBuilder.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ArchivesBuilder.java 2007-06-15 16:58:13 UTC (rev 2131)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ArchivesBuilder.java 2007-06-15 16:59:40 UTC (rev 2132)
@@ -94,7 +94,7 @@
IArchiveModelNode root = ArchivesModel.instance().getRoot(p);
IArchiveNode[] nodes = root.getChildren(IArchiveNode.TYPE_ARCHIVE);
for( int i = 0; i < nodes.length; i++ ) {
- IPath path = ((IArchive)nodes[i]).getDestinationPath();
+ IPath path = ((IArchive)nodes[i]).getGlobalDestinationPath();
TrueZipUtil.deleteAll(path);
}
}
17 years, 6 months
JBoss Tools SVN: r2131 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/events.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 12:58:13 -0400 (Fri, 15 Jun 2007)
New Revision: 2131
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/events/EventManager.java
Log:
Try/catch blocks no longer around the loop, inside instead
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/events/EventManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/events/EventManager.java 2007-06-15 16:57:23 UTC (rev 2130)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/events/EventManager.java 2007-06-15 16:58:13 UTC (rev 2131)
@@ -39,68 +39,77 @@
public class EventManager {
public static void cleanProjectBuild(IPath project) {
- try {
IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ )
- listeners[i].cleanProject(project);
- } catch(Exception e ) {}
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].cleanProject(project);
+ } catch(Exception e ) {}
+ }
}
public static void cleanArchiveBuild(IArchive archive) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners(archive);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners(archive);
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].cleanArchive(archive);
- } catch(Exception e ) {}
+ } catch( Exception e) {
+ }
+ }
}
public static void startedBuild(IPath project) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].startedBuild(project);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
public static void finishedBuild(IPath project) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].finishedBuild(project);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
public static void startedBuildingArchive(IArchive archive) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners(archive);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].startedBuildingArchive(archive);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
public static void finishedBuildingArchive(IArchive archive) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners(archive);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].finishedBuildingArchive(archive);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
public static void startedCollectingFileSet(IArchiveFileSet fileset) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners(fileset);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].startedCollectingFileSet(fileset);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
public static void finishedCollectingFileSet(IArchiveFileSet fileset) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners(fileset);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].finishedCollectingFileSet(fileset);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
// Bulk events
@@ -118,19 +127,21 @@
}
public static void fileUpdated(IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners(topLevelArchive);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].fileUpdated(topLevelArchive, fileset, filePath);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
public static void fileRemoved(IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners(topLevelArchive);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].fileRemoved(topLevelArchive, fileset, filePath);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
// one file removed matching multiple filesets
@@ -147,11 +158,12 @@
}
public static void buildFailed(IArchive pkg, IStatus status) {
- try {
- IArchiveBuildListener[] listeners = getBuildListeners(pkg);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].buildFailed(pkg, status);
- } catch(Exception e ) {}
+ } catch(Exception e ) {}
+ }
}
@@ -162,13 +174,14 @@
*/
public static void fireDelta(IArchiveNodeDelta delta) {
- try {
- IArchiveNode node = delta.getPostNode() == null ? delta.getPreNode() : delta.getPostNode();
- IArchiveModelListener[] listeners = getModelListeners(node);
- for( int i = 0; i < listeners.length; i++ )
+ IArchiveNode node = delta.getPostNode() == null ? delta.getPreNode() : delta.getPostNode();
+ IArchiveModelListener[] listeners = getModelListeners(node);
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
listeners[i].modelChanged(delta);
- } catch(Exception e ) {
- e.printStackTrace();
+ } catch(Exception e ) {
+ e.printStackTrace();
+ }
}
}
17 years, 6 months
JBoss Tools SVN: r2130 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-15 12:57:23 -0400 (Fri, 15 Jun 2007)
New Revision: 2130
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
Log:
import cleanup
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2007-06-15 16:56:54 UTC (rev 2129)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2007-06-15 16:57:23 UTC (rev 2130)
@@ -22,6 +22,8 @@
package org.jboss.ide.eclipse.archives.core.model;
import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
import org.apache.tools.ant.DirectoryScanner;
import org.eclipse.core.runtime.IPath;
17 years, 6 months