JBoss Tools SVN: r2067 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-23 19:13:21 -0400 (Wed, 23 May 2007)
New Revision: 2067
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveDeltaPreNodeFactory.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveNodeDeltaImpl.java
Log:
delta pre nodes were not attached to a model so event manager didn't know where to fire events
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveDeltaPreNodeFactory.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveDeltaPreNodeFactory.java 2007-05-23 23:12:56 UTC (rev 2066)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveDeltaPreNodeFactory.java 2007-05-23 23:13:21 UTC (rev 2067)
@@ -28,6 +28,7 @@
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModelNode;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveNodeDeltaImpl.NodeDelta;
import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbFileSet;
@@ -55,13 +56,13 @@
switch(postChange.getNodeType()) {
case IArchiveNode.TYPE_ARCHIVE_FILESET:
XbFileSet fs = createFileset((ArchiveFileSetImpl)postChange, attributeChanges, propertyChanges);
- return new DeltaFileset(fs, parentDelta, postChange.getProjectPath());
+ return new DeltaFileset(fs, parentDelta, postChange);
case IArchiveNode.TYPE_ARCHIVE_FOLDER:
XbFolder folder = createFolder((ArchiveFolderImpl)postChange, attributeChanges, propertyChanges);
- return new DeltaFolder(folder, parentDelta, postChange.getProjectPath());
+ return new DeltaFolder(folder, parentDelta, postChange);
case IArchiveNode.TYPE_ARCHIVE:
XbPackage pack = createPackage((ArchiveImpl)postChange, attributeChanges, propertyChanges);
- return new DeltaArchive(pack, parentDelta, postChange.getProjectPath());
+ return new DeltaArchive(pack, parentDelta, postChange);
}
return null;
@@ -152,18 +153,21 @@
public static class DeltaFileset extends ArchiveFileSetImpl {
// everything goes through the delegate or the parent. Simple
private ArchiveNodeDeltaImpl parentDelta;
- private IPath project;
- public DeltaFileset(XbFileSet fileset, ArchiveNodeDeltaImpl parentDelta, IPath project){
+ private ArchiveNodeImpl impl;
+ public DeltaFileset(XbFileSet fileset, ArchiveNodeDeltaImpl parentDelta, ArchiveNodeImpl impl){
super(fileset);
this.parentDelta = parentDelta;
- this.project = project;
+ this.impl = impl;
}
public IArchiveNode getParent() {
return parentDelta == null ? null : parentDelta.getPreNode();
}
public IPath getProjectPath() {
- return project;
+ return impl.getProjectPath();
}
+ public IArchiveModelNode getModel() {
+ return impl.getModel();
+ }
}
/**
@@ -171,18 +175,21 @@
*/
public static class DeltaFolder extends ArchiveFolderImpl {
private ArchiveNodeDeltaImpl parentDelta;
- private IPath project;
- public DeltaFolder(XbFolder folder, ArchiveNodeDeltaImpl parentDelta, IPath project){
+ private ArchiveNodeImpl impl;
+ public DeltaFolder(XbFolder folder, ArchiveNodeDeltaImpl parentDelta, ArchiveNodeImpl impl){
super(folder);
this.parentDelta = parentDelta;
- this.project = project;
+ this.impl = impl;
}
public IArchiveNode getParent() {
return parentDelta == null ? null : parentDelta.getPreNode();
}
public IPath getProjectPath() {
- return project;
+ return impl.getProjectPath();
}
+ public IArchiveModelNode getModel() {
+ return impl.getModel();
+ }
}
/**
@@ -190,17 +197,20 @@
*/
public static class DeltaArchive extends ArchiveImpl {
private ArchiveNodeDeltaImpl parentDelta;
- private IPath project;
- public DeltaArchive(XbPackage pack, ArchiveNodeDeltaImpl parentDelta, IPath project){
+ private ArchiveNodeImpl impl;
+ public DeltaArchive(XbPackage pack, ArchiveNodeDeltaImpl parentDelta, ArchiveNodeImpl impl){
super(pack);
this.parentDelta = parentDelta;
- this.project = project;
+ this.impl = impl;
}
public IArchiveNode getParent() {
return parentDelta == null ? null : parentDelta.getPreNode();
}
public IPath getProjectPath() {
- return project;
+ return impl.getProjectPath();
}
+ public IArchiveModelNode getModel() {
+ return impl.getModel();
+ }
}
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveNodeDeltaImpl.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveNodeDeltaImpl.java 2007-05-23 23:12:56 UTC (rev 2066)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveNodeDeltaImpl.java 2007-05-23 23:13:21 UTC (rev 2067)
@@ -26,6 +26,7 @@
import java.util.HashMap;
import java.util.Iterator;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModelListenerManager;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
17 years, 7 months
JBoss Tools SVN: r2066 - 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-05-23 19:12:56 -0400 (Wed, 23 May 2007)
New Revision: 2066
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java
Log:
API duplication removed
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2007-05-22 17:46:17 UTC (rev 2065)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2007-05-23 23:12:56 UTC (rev 2066)
@@ -190,13 +190,13 @@
return getProjectArchives(project, false, new NullProgressMonitor());
}
public IArchive[] getProjectArchives(IPath project, boolean register, IProgressMonitor monitor) {
- IArchiveModelNode root = getRoot(project);
+ IArchiveModelNode root = getRoot(project, register, monitor);
if( root != null ) {
- List list = Arrays.asList( getRoot(project).getAllChildren());
+ List list = Arrays.asList( getRoot(project, register, monitor).getAllChildren());
return (IArchive[]) list.toArray(new IArchive[list.size()]);
} else {
registerProject(project, monitor);
- List list = Arrays.asList( getRoot(project).getAllChildren());
+ List list = Arrays.asList( getRoot(project, register, monitor).getAllChildren());
return (IArchive[]) list.toArray(new IArchive[list.size()]);
}
}
@@ -208,6 +208,7 @@
public void registerProject(IPath project, IProgressMonitor monitor) {
// if the file exists, read it in
+ if( monitor == null ) monitor = new NullProgressMonitor();
monitor.beginTask("Loading configuration...", XMLBinding.NUM_UNMARSHAL_MONITOR_STEPS + 2);
ArchivesCore.getInstance().preRegister(project);
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java 2007-05-22 17:46:17 UTC (rev 2065)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java 2007-05-23 23:12:56 UTC (rev 2066)
@@ -58,24 +58,7 @@
}
public static IArchive[] getProjectPackages (IPath project, IProgressMonitor monitor, boolean forceInit) {
- if (monitor == null) monitor = new NullProgressMonitor();
-
- monitor.beginTask("Fetching packages for \"" + project.lastSegment() + "\"...", 2);
- IArchive[] packages = ArchivesModel.instance().getProjectArchives(project);
- monitor.worked(1);
-
- if (packages == null) {
- if (forceInit && packageFileExists(project)) {
- ArchivesModel.instance().registerProject(project, monitor);
- packages = ArchivesModel.instance().getProjectArchives(project);
- }
-
- if (packages == null) return new IArchive[0];
- }
-
- monitor.worked(1);
- monitor.done();
- return packages;
+ return ArchivesModel.instance().getProjectArchives(project, forceInit, monitor);
}
public static boolean packageFileExists (IPath project) {
17 years, 7 months
JBoss Tools SVN: r2065 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-05-22 13:46:17 -0400 (Tue, 22 May 2007)
New Revision: 2065
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
Log:
all properties that end with ".dir" are copied into the system and the classloader
is now setup correctly so the truezip and xerces jars are loaded appropriately
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2007-05-22 16:58:47 UTC (rev 2064)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2007-05-22 17:46:17 UTC (rev 2065)
@@ -1,5 +1,7 @@
package org.jboss.ide.eclipse.archives.core.ant;
+import java.util.Iterator;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.eclipse.core.runtime.IPath;
@@ -10,13 +12,14 @@
import org.jboss.ide.eclipse.archives.core.StandaloneArchivesCore;
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.internal.xb.XMLBinding;
public class GenerateArchivesTask extends Task {
private String projectPath;
public void init() throws BuildException {
-// Force standalone mode
+ // Force standalone mode
ArchivesCore standalone = new StandaloneArchivesCore();
}
@@ -24,8 +27,23 @@
IPath projectPath = new Path(this.projectPath);
IProgressMonitor monitor = new NullProgressMonitor();
+ for (Iterator iter = getProject().getProperties().keySet().iterator(); iter.hasNext(); )
+ {
+ String property = (String) iter.next();
+ if (property.endsWith(".dir")) {
+ System.setProperty(property, getProject().getProperty(property));
+ }
+ }
+
+ // needed so the correct XML binding / TrueZIP jars are loaded
+ ClassLoader original = Thread.currentThread().getContextClassLoader();
+ ClassLoader myCL = getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(myCL);
+
ArchivesModel.instance().registerProject(projectPath, monitor);
ArchivesModelCore.buildProject(projectPath, monitor);
+
+ Thread.currentThread().setContextClassLoader(original);
}
public String getProjectPath() {
17 years, 7 months
JBoss Tools SVN: r2064 - in trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src: main/org/jboss/ide/eclipse/archives/core/model/internal/xb and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-22 12:58:47 -0400 (Tue, 22 May 2007)
New Revision: 2064
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/ArchivesCorePlugin.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java
Log:
moved xb's initialization into the binding itself
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/ArchivesCorePlugin.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/ArchivesCorePlugin.java 2007-05-22 16:50:00 UTC (rev 2063)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/ArchivesCorePlugin.java 2007-05-22 16:58:47 UTC (rev 2064)
@@ -54,9 +54,6 @@
// Load the workspace version of ArchivesCore
ArchivesCore core = new WorkspaceArchivesCore();
-
- // force JBossXB initialization
- XMLBinding.init();
}
/*
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java 2007-05-22 16:50:00 UTC (rev 2063)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java 2007-05-22 16:58:47 UTC (rev 2064)
@@ -49,6 +49,8 @@
private static URL log4jxml = ArchivesCore.getInstance().getVariables().getBindingLog4j();
private static SchemaBinding binding;
+ private static boolean initialized = false;
+
static {
System.setProperty("log4j.configuration", log4jxml.toString());
}
@@ -60,6 +62,7 @@
binding = XsdBinder.bind(stream, "UTF-8", null);
stream.close();
+ initialized = true;
} catch (IOException e) {
Trace.trace(XMLBinding.class, e);
}
@@ -78,6 +81,7 @@
public static XbPackages unmarshal (final InputStream in, final IProgressMonitor monitor)
{
+ if( !initialized) init();
element = null;
binderSandbox(new Runnable() {
@@ -103,6 +107,7 @@
public static void marshal (final XbPackages element, final Writer writer, final IProgressMonitor monitor)
{
+ if( !initialized) init();
binderSandbox(new Runnable() {
public void run () {
try {
17 years, 7 months
JBoss Tools SVN: r2063 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-05-22 12:50:00 -0400 (Tue, 22 May 2007)
New Revision: 2063
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.classpath
Log:
removed sourcepath entries
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.classpath
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.classpath 2007-05-22 16:29:57 UTC (rev 2062)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.classpath 2007-05-22 16:50:00 UTC (rev 2063)
@@ -4,9 +4,9 @@
<classpathentry kind="src" path="src/xml"/>
<classpathentry kind="src" path="src/eclipse"/>
<classpathentry exported="true" kind="lib" path="lib/concurrent.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/truezip-6.jar" sourcepath="C:/code/truezip/truezip-6/src"/>
+ <classpathentry exported="true" kind="lib" path="lib/truezip-6.jar" />
<classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/jboss-common-4.0.4.jar" sourcepath="C:/Users/Marshall/Downloads/jbossxb-1.0.1.TEST-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jboss-common-4.0.4.jar" />
<classpathentry exported="true" kind="lib" path="lib/jbossxb-1.0.1.TEST.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
17 years, 7 months
JBoss Tools SVN: r2062 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-05-22 12:29:57 -0400 (Tue, 22 May 2007)
New Revision: 2062
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
Log:
d'oh, forgot to add getter/setter
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2007-05-22 16:05:15 UTC (rev 2061)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2007-05-22 16:29:57 UTC (rev 2062)
@@ -15,7 +15,6 @@
private String projectPath;
- @Override
public void init() throws BuildException {
// Force standalone mode
ArchivesCore standalone = new StandaloneArchivesCore();
@@ -28,4 +27,12 @@
ArchivesModel.instance().registerProject(projectPath, monitor);
ArchivesModelCore.buildProject(projectPath, monitor);
}
+
+ public String getProjectPath() {
+ return projectPath;
+ }
+
+ public void setProjectPath(String projectPath) {
+ this.projectPath = projectPath;
+ }
}
17 years, 7 months
JBoss Tools SVN: r2061 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-05-22 12:05:15 -0400 (Tue, 22 May 2007)
New Revision: 2061
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
Log:
force standalone core in init()
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2007-05-22 15:50:30 UTC (rev 2060)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2007-05-22 16:05:15 UTC (rev 2061)
@@ -15,10 +15,13 @@
private String projectPath;
+ @Override
+ public void init() throws BuildException {
+// Force standalone mode
+ ArchivesCore standalone = new StandaloneArchivesCore();
+ }
+
public void execute() throws BuildException {
- // Force standalone mode
- ArchivesCore standalone = new StandaloneArchivesCore();
-
IPath projectPath = new Path(this.projectPath);
IProgressMonitor monitor = new NullProgressMonitor();
17 years, 7 months
JBoss Tools SVN: r2060 - 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-05-22 11:50:30 -0400 (Tue, 22 May 2007)
New Revision: 2060
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
Log:
imports reorganized
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2007-05-22 15:47:32 UTC (rev 2059)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2007-05-22 15:50:30 UTC (rev 2060)
@@ -40,7 +40,6 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.Trace;
-import org.jboss.ide.eclipse.archives.core.build.ModelChangeListenerWithRefresh;
import org.jboss.ide.eclipse.archives.core.model.events.EventManager;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveFileSetImpl;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveFolderImpl;
17 years, 7 months
JBoss Tools SVN: r2059 - in trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src: eclipse/org/jboss/ide/eclipse/archives/core/build and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-22 11:47:32 -0400 (Tue, 22 May 2007)
New Revision: 2059
Added:
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/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java
Removed:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveType.java
Log:
RefreshLocal preserved in a subclass ModelChangeListenerWithRefresh.
Core constructors add appropriate listener.
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2007-05-22 15:01:59 UTC (rev 2058)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2007-05-22 15:47:32 UTC (rev 2059)
@@ -4,6 +4,8 @@
import org.eclipse.core.runtime.IPath;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.build.ModelChangeListenerWithRefresh;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.other.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.other.IPreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.other.IRuntimeVariables;
@@ -17,6 +19,7 @@
public WorkspaceArchivesCore ()
{
super(WORKSPACE);
+ ArchivesModel.instance().addModelListener(new ModelChangeListenerWithRefresh());
}
protected IExtensionManager createExtensionManager() {
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java 2007-05-22 15:01:59 UTC (rev 2058)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java 2007-05-22 15:47:32 UTC (rev 2059)
@@ -1,187 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.build;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.jboss.ide.eclipse.archives.core.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
-import org.jboss.ide.eclipse.archives.core.model.events.EventManager;
-import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
-import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
-import org.jboss.ide.eclipse.archives.core.util.internal.ModelTruezipBridge;
-
-/**
- * This class responds to model change events.
- * It is given a delta as to what nodes are added, removed, or changed.
- * It then keeps the output file for the top level archive in sync with
- * the changes to the model.
- *
- * If the automatic builder is not enabled for this project, the listener
- * does nothing.
- *
- * @author Rob Stryker (rob.stryker(a)redhat.com)
- *
- */
-public class ModelChangeListener implements IArchiveModelListener {
-
- /**
- * This is the entry point for model change events.
- * It immediately passes the delta to be handled.
- */
- public void modelChanged(IArchiveNodeDelta delta) {
- // if we're not building, get out
- if( !ArchivesCore.getInstance().getPreferenceManager().isBuilderEnabled(delta.getPostNode().getProjectPath()))
- return;
-
- try {
- handle(delta);
- } catch( Exception e ) {
- e.printStackTrace();
- }
- }
-
- /**
- * This can handle any type of node / delta, not just
- * root elements. If the node is added or removed, it
- * will handle those segments and return without checking
- * the children at all. IT is the responsibility of the add
- * and remove methods to go through the children.
- *
- * Otherwise, it will simply handle attribute children and then
- * move on to the children.
- *
- * @param delta
- */
- private void handle(IArchiveNodeDelta delta) {
- if( (delta.getKind() & IArchiveNodeDelta.REMOVED) != 0 ) {
- nodeRemoved(delta.getPreNode());
- return;
- } else if( (delta.getKind() & IArchiveNodeDelta.ADDED) != 0 ) {
- nodeAdded(delta.getPostNode());
- return;
- } else if( (delta.getKind() & IArchiveNodeDelta.ATTRIBUTE_CHANGED) != 0) {
- boolean shouldHandleChildren = handleAttributeChange(delta);
- if( shouldHandleChildren ) {
- IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
- for( int i = 0; i < children.length; i++ ) {
- handle(children[i]);
- }
- }
- } else if( descendentChanged(delta.getKind()) ) {
- IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
- for( int i = 0; i < children.length; i++ ) {
- handle(children[i]);
- }
- }
- }
- protected boolean descendentChanged(int kind) {
- return (kind & IArchiveNodeDelta.DESCENDENT_CHANGED) != 0 ||
- (kind & IArchiveNodeDelta.CHILD_ADDED) != 0 ||
- (kind & IArchiveNodeDelta.CHILD_REMOVED) != 0;
- }
-
- /**
- * Handle changes in this node
- * @param delta
- * @return Whether or not the caller should also handle the children
- */
- private boolean handleAttributeChange(IArchiveNodeDelta delta) {
- switch( delta.getPostNode().getNodeType()) {
- case IArchiveNode.TYPE_ARCHIVE_FOLDER:
- return handleFolderAttributeChanged(delta);
- case IArchiveNode.TYPE_ARCHIVE_FILESET:
- return handleFilesetAttributeChanged(delta);
- case IArchiveNode.TYPE_ARCHIVE:
- return handlePackageAttributeChanged(delta);
- }
- return false;
- }
-
- private boolean handleFolderAttributeChanged(IArchiveNodeDelta delta) {
- nodeRemoved(delta.getPreNode());
- nodeAdded(delta.getPostNode());
- return false;
- }
-
- private boolean handleFilesetAttributeChanged(IArchiveNodeDelta delta) {
- nodeRemoved(delta.getPreNode());
- nodeAdded(delta.getPostNode());
- return false;
- }
-
- private boolean handlePackageAttributeChanged(IArchiveNodeDelta delta) {
- nodeRemoved(delta.getPreNode());
- nodeAdded(delta.getPostNode());
- return false;
- }
-
-
-
-
- private void nodeAdded(IArchiveNode added) {
- if( added.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
- // create the package
- ModelTruezipBridge.createFile(added);
- } else if( added.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER ) {
- // create hte folder
- ModelTruezipBridge.createFile(added);
- }
- IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(added);
- for( int i = 0; i < filesets.length; i++ ) {
- ModelTruezipBridge.fullFilesetBuild(filesets[i]);
- IPath[] paths = filesets[i].findMatchingPaths();
- EventManager.filesUpdated(filesets[i].getRootArchive(), filesets[i], paths);
- }
- refreshLocal(added);
- }
-
-
- private void nodeRemoved(IArchiveNode removed) {
- if( removed.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
- ModelTruezipBridge.deleteArchive((IArchive)removed);
- refreshLocal(removed);
- return;
- } else if( removed.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER ){
- IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(((IArchiveFolder)removed));
- for( int i = 0; i < filesets.length; i++ ) {
- IPath[] removedPaths = ModelTruezipBridge.fullFilesetRemove(((IArchiveFileSet)removed), false);
- EventManager.filesRemoved(removedPaths, ((IArchiveFileSet)removed));
- }
- refreshLocal(removed);
- return;
- }
-
- IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(removed);
- for( int i = 0; i < filesets.length; i++ ) {
- IPath[] removedPaths = ModelTruezipBridge.fullFilesetRemove(((IArchiveFileSet)removed), false);
- EventManager.filesRemoved(removedPaths, ((IArchiveFileSet)removed));
- }
- refreshLocal(removed);
- }
-
-
- // refresh the file tree structure
- private void refreshLocal(IArchiveNode node) {
- IArchive pack = node.getRootArchive();
- if( pack != null && pack.isDestinationInWorkspace() ) {
- // refresh the root package node
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IResource res = root.getContainerForLocation(pack.getDestinationPath());
- if( res != null ) {
- try {
- res.getParent().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- } catch( CoreException ce ) {
- }
- }
- }
-
- }
-}
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java (from rev 2057, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListenerWithRefresh.java 2007-05-22 15:47:32 UTC (rev 2059)
@@ -0,0 +1,40 @@
+package org.jboss.ide.eclipse.archives.core.build;
+
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+
+/**
+ * This class responds to model change events.
+ * It is given a delta as to what nodes are added, removed, or changed.
+ * It then keeps the output file for the top level archive in sync with
+ * the changes to the model.
+ *
+ * If the automatic builder is not enabled for this project, the listener
+ * does nothing.
+ *
+ * @author Rob Stryker (rob.stryker(a)redhat.com)
+ *
+ */
+public class ModelChangeListenerWithRefresh extends ModelChangeListener {
+
+ protected void postChange(IArchiveNode node) {
+ IArchive pack = node.getRootArchive();
+ if( pack != null && pack.isDestinationInWorkspace() ) {
+ // refresh the root package node
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource res = root.getContainerForLocation(pack.getDestinationPath());
+ if( res != null ) {
+ try {
+ res.getParent().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ } catch( CoreException ce ) {
+ }
+ }
+ }
+ }
+}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java 2007-05-22 15:01:59 UTC (rev 2058)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java 2007-05-22 15:47:32 UTC (rev 2059)
@@ -1,6 +1,8 @@
package org.jboss.ide.eclipse.archives.core;
import org.eclipse.core.runtime.IPath;
+import org.jboss.ide.eclipse.archives.core.build.ModelChangeListener;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.other.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.other.IPreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.other.IRuntimeVariables;
@@ -13,6 +15,7 @@
public StandaloneArchivesCore ()
{
super(STANDALONE);
+ ArchivesModel.instance().addModelListener(new ModelChangeListener());
}
protected IExtensionManager createExtensionManager() {
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java (from rev 2057, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java 2007-05-22 15:47:32 UTC (rev 2059)
@@ -0,0 +1,180 @@
+package org.jboss.ide.eclipse.archives.core.build;
+
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
+import org.jboss.ide.eclipse.archives.core.model.events.EventManager;
+import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
+import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
+import org.jboss.ide.eclipse.archives.core.util.internal.ModelTruezipBridge;
+
+/**
+ * This class responds to model change events.
+ * It is given a delta as to what nodes are added, removed, or changed.
+ * It then keeps the output file for the top level archive in sync with
+ * the changes to the model.
+ *
+ * If the automatic builder is not enabled for this project, the listener
+ * does nothing.
+ *
+ * @author Rob Stryker (rob.stryker(a)redhat.com)
+ *
+ */
+public class ModelChangeListener implements IArchiveModelListener {
+
+ /**
+ * This is the entry point for model change events.
+ * It immediately passes the delta to be handled.
+ */
+ public void modelChanged(IArchiveNodeDelta delta) {
+ // if we're not building, get out
+ if( !ArchivesCore.getInstance().getPreferenceManager().isBuilderEnabled(delta.getPostNode().getProjectPath()))
+ return;
+
+ try {
+ handle(delta);
+ } catch( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * This can handle any type of node / delta, not just
+ * root elements. If the node is added or removed, it
+ * will handle those segments and return without checking
+ * the children at all. IT is the responsibility of the add
+ * and remove methods to go through the children.
+ *
+ * Otherwise, it will simply handle attribute children and then
+ * move on to the children.
+ *
+ * @param delta
+ */
+ private void handle(IArchiveNodeDelta delta) {
+ if( (delta.getKind() & IArchiveNodeDelta.REMOVED) != 0 ) {
+ nodeRemoved(delta.getPreNode());
+ return;
+ } else if( (delta.getKind() & IArchiveNodeDelta.ADDED) != 0 ) {
+ nodeAdded(delta.getPostNode());
+ return;
+ } else if( (delta.getKind() & IArchiveNodeDelta.ATTRIBUTE_CHANGED) != 0) {
+ boolean shouldHandleChildren = handleAttributeChange(delta);
+ if( shouldHandleChildren ) {
+ IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
+ for( int i = 0; i < children.length; i++ ) {
+ handle(children[i]);
+ }
+ }
+ } else if( descendentChanged(delta.getKind()) ) {
+ IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
+ for( int i = 0; i < children.length; i++ ) {
+ handle(children[i]);
+ }
+ }
+ }
+ protected boolean descendentChanged(int kind) {
+ return (kind & IArchiveNodeDelta.DESCENDENT_CHANGED) != 0 ||
+ (kind & IArchiveNodeDelta.CHILD_ADDED) != 0 ||
+ (kind & IArchiveNodeDelta.CHILD_REMOVED) != 0;
+ }
+
+ /**
+ * Handle changes in this node
+ * @param delta
+ * @return Whether or not the caller should also handle the children
+ */
+ private boolean handleAttributeChange(IArchiveNodeDelta delta) {
+ switch( delta.getPostNode().getNodeType()) {
+ case IArchiveNode.TYPE_ARCHIVE_FOLDER:
+ return handleFolderAttributeChanged(delta);
+ case IArchiveNode.TYPE_ARCHIVE_FILESET:
+ return handleFilesetAttributeChanged(delta);
+ case IArchiveNode.TYPE_ARCHIVE:
+ return handlePackageAttributeChanged(delta);
+ }
+ return false;
+ }
+
+ private boolean handleFolderAttributeChanged(IArchiveNodeDelta delta) {
+ nodeRemoved(delta.getPreNode());
+ nodeAdded(delta.getPostNode());
+ return false;
+ }
+
+ private boolean handleFilesetAttributeChanged(IArchiveNodeDelta delta) {
+ nodeRemoved(delta.getPreNode());
+ nodeAdded(delta.getPostNode());
+ return false;
+ }
+
+ private boolean handlePackageAttributeChanged(IArchiveNodeDelta delta) {
+ nodeRemoved(delta.getPreNode());
+ nodeAdded(delta.getPostNode());
+ return false;
+ }
+
+
+
+
+ private void nodeAdded(IArchiveNode added) {
+ if( added.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
+ // create the package
+ ModelTruezipBridge.createFile(added);
+ } else if( added.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER ) {
+ // create hte folder
+ ModelTruezipBridge.createFile(added);
+ }
+ IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(added);
+ for( int i = 0; i < filesets.length; i++ ) {
+ ModelTruezipBridge.fullFilesetBuild(filesets[i]);
+ IPath[] paths = filesets[i].findMatchingPaths();
+ EventManager.filesUpdated(filesets[i].getRootArchive(), filesets[i], paths);
+ }
+ postChange(added);
+ }
+
+
+ private void nodeRemoved(IArchiveNode removed) {
+ if( removed.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
+ ModelTruezipBridge.deleteArchive((IArchive)removed);
+ postChange(removed);
+ return;
+ } else if( removed.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER ){
+ IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(((IArchiveFolder)removed));
+ for( int i = 0; i < filesets.length; i++ ) {
+ IPath[] removedPaths = ModelTruezipBridge.fullFilesetRemove(((IArchiveFileSet)removed), false);
+ EventManager.filesRemoved(removedPaths, ((IArchiveFileSet)removed));
+ }
+ postChange(removed);
+ return;
+ }
+
+ IArchiveFileSet[] filesets = ModelUtil.findAllDescendentFilesets(removed);
+ for( int i = 0; i < filesets.length; i++ ) {
+ IPath[] removedPaths = ModelTruezipBridge.fullFilesetRemove(((IArchiveFileSet)removed), false);
+ EventManager.filesRemoved(removedPaths, ((IArchiveFileSet)removed));
+ }
+ postChange(removed);
+ }
+
+
+ protected void postChange(IArchiveNode node) {
+// IArchive pack = node.getRootArchive();
+// if( pack != null && pack.isDestinationInWorkspace() ) {
+// // refresh the root package node
+// IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+// IResource res = root.getContainerForLocation(pack.getDestinationPath());
+// if( res != null ) {
+// try {
+// res.getParent().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+// } catch( CoreException ce ) {
+// }
+// }
+// }
+ }
+}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2007-05-22 15:01:59 UTC (rev 2058)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2007-05-22 15:47:32 UTC (rev 2059)
@@ -40,7 +40,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.Trace;
-import org.jboss.ide.eclipse.archives.core.build.ModelChangeListener;
+import org.jboss.ide.eclipse.archives.core.build.ModelChangeListenerWithRefresh;
import org.jboss.ide.eclipse.archives.core.model.events.EventManager;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveFileSetImpl;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveFolderImpl;
@@ -87,7 +87,6 @@
archivesRoot = new HashMap();
buildListeners = new ArrayList();
modelListeners = new ArrayList();
- addModelListener(new ModelChangeListener());
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveType.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveType.java 2007-05-22 15:01:59 UTC (rev 2058)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveType.java 2007-05-22 15:47:32 UTC (rev 2059)
@@ -21,7 +21,6 @@
*/
package org.jboss.ide.eclipse.archives.core.model;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
/**
17 years, 7 months
JBoss Tools SVN: r2058 - in trunk/core/plugins/org.jboss.ide.eclipse.archives.core: src/eclipse/org/jboss/ide/eclipse/archives/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-05-22 11:01:59 -0400 (Tue, 22 May 2007)
New Revision: 2058
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCore.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
Log:
Add nature moved to eclipse-specific code
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF 2007-05-22 14:54:49 UTC (rev 2057)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF 2007-05-22 15:01:59 UTC (rev 2058)
@@ -28,6 +28,5 @@
org.jboss.ide.eclipse.archives.core.model.internal.xb;x-friends:="org.jboss.ide.eclipse.archives.test",
org.jboss.ide.eclipse.archives.core.model.other,
org.jboss.ide.eclipse.archives.core.model.other.internal;x-friends:="org.jboss.ide.eclipse.archives.test",
- org.jboss.ide.eclipse.archives.core.project;x-friends:="org.jboss.ide.eclipse.archives.test",
org.jboss.ide.eclipse.archives.core.util;x-friends:="org.jboss.ide.eclipse.archives.test",
org.jboss.ide.eclipse.archives.core.util.internal;x-friends:="org.jboss.ide.eclipse.archives.test"
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2007-05-22 14:54:49 UTC (rev 2057)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2007-05-22 15:01:59 UTC (rev 2058)
@@ -2,6 +2,7 @@
+import org.eclipse.core.runtime.IPath;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.other.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.other.IPreferenceManager;
@@ -9,6 +10,7 @@
import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspacePreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariables;
+import org.jboss.ide.eclipse.archives.core.project.ProjectUtils;
public class WorkspaceArchivesCore extends ArchivesCore {
@@ -28,4 +30,9 @@
protected IRuntimeVariables createVariables() {
return new WorkspaceVariables();
}
+
+ public void preRegister(IPath project) {
+ ProjectUtils.addProjectNature(project);
+ }
+
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCore.java 2007-05-22 14:54:49 UTC (rev 2057)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCore.java 2007-05-22 15:01:59 UTC (rev 2058)
@@ -1,5 +1,6 @@
package org.jboss.ide.eclipse.archives.core;
+import org.eclipse.core.runtime.IPath;
import org.jboss.ide.eclipse.archives.core.model.other.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.other.IPreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.other.IRuntimeVariables;
@@ -47,4 +48,6 @@
public IPreferenceManager getPreferenceManager() {
return preferenceManager;
}
+
+ public abstract void preRegister(IPath project);
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java 2007-05-22 14:54:49 UTC (rev 2057)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java 2007-05-22 15:01:59 UTC (rev 2058)
@@ -1,5 +1,6 @@
package org.jboss.ide.eclipse.archives.core;
+import org.eclipse.core.runtime.IPath;
import org.jboss.ide.eclipse.archives.core.model.other.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.other.IPreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.other.IRuntimeVariables;
@@ -26,4 +27,7 @@
return new StandaloneVariables();
}
+ public void preRegister(IPath project) {
+
+ }
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2007-05-22 14:54:49 UTC (rev 2057)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2007-05-22 15:01:59 UTC (rev 2058)
@@ -55,7 +55,6 @@
import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackages;
import org.jboss.ide.eclipse.archives.core.model.other.IArchiveBuildListener;
import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
-import org.jboss.ide.eclipse.archives.core.project.ProjectUtils;
/**
* The root model which keeps track of registered projects
@@ -209,20 +208,12 @@
return archivesRoot.containsValue(node);
}
- private void addNature(IPath project) {
- try {
- ProjectUtils.addProjectNature(project);
- } catch(Exception e) {
- }
- }
public void registerProject(IPath project, IProgressMonitor monitor) {
// if the file exists, read it in
monitor.beginTask("Loading configuration...", XMLBinding.NUM_UNMARSHAL_MONITOR_STEPS + 2);
-
- if( ArchivesCore.getInstance().isWorkspaceRuntype()) {
- addNature(project);
- }
+ ArchivesCore.getInstance().preRegister(project);
+
ArchiveModelNode root;
IPath packagesFile = project.append(PROJECT_PACKAGES_FILE);
if (packagesFile.toFile().exists())
17 years, 7 months