JBoss Tools SVN: r6192 - in trunk/core/plugins/org.jboss.ide.eclipse.archives.core: src/main/org/jboss/ide/eclipse/archives/core/build and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-07 18:02:21 -0500 (Thu, 07 Feb 2008)
New Revision: 6192
Added:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/EventManager.java
Removed:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/events/EventManager.java
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/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/model/ArchivesModel.java
Log:
Preparing to break / destroy archives! awesome for API refactors
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 2008-02-07 22:57:19 UTC (rev 6191)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF 2008-02-07 23:02:21 UTC (rev 6192)
@@ -25,7 +25,6 @@
org.jboss.ide.eclipse.archives.core,
org.jboss.ide.eclipse.archives.core.build,
org.jboss.ide.eclipse.archives.core.model,
- org.jboss.ide.eclipse.archives.core.model.events;x-friends:="org.jboss.ide.eclipse.archives.test",
org.jboss.ide.eclipse.archives.core.model.internal;x-friends:="org.jboss.ide.eclipse.archives.test",
org.jboss.ide.eclipse.archives.core.model.internal.xb;x-friends:="org.jboss.ide.eclipse.archives.test",
org.jboss.ide.eclipse.archives.core.util;x-friends:="org.jboss.ide.eclipse.archives.test",
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2008-02-07 22:57:19 UTC (rev 6191)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2008-02-07 23:02:21 UTC (rev 6192)
@@ -27,12 +27,12 @@
import org.eclipse.core.runtime.IPath;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.EventManager;
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.events.EventManager;
import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
import org.jboss.ide.eclipse.archives.core.util.internal.ModelTruezipBridge;
import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/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 2008-02-07 22:57:19 UTC (rev 6191)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java 2008-02-07 23:02:21 UTC (rev 6192)
@@ -3,6 +3,7 @@
import org.eclipse.core.runtime.IPath;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.model.EventManager;
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;
@@ -10,7 +11,6 @@
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.IArchiveNodeDelta;
-import org.jboss.ide.eclipse.archives.core.model.events.EventManager;
import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
import org.jboss.ide.eclipse.archives.core.util.internal.ModelTruezipBridge;
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 2008-02-07 22:57:19 UTC (rev 6191)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2008-02-07 23:02:21 UTC (rev 6192)
@@ -34,7 +34,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
-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;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveImpl;
@@ -70,14 +69,15 @@
return instance;
}
- private HashMap xbPackages; // maps an IPath (of a project) to XbPackages
- private HashMap archivesRoot; // maps an IPath (of a project) to PackageModelNode, aka root
- private ArrayList buildListeners, modelListeners;
+ private HashMap<IPath, XbPackages> xbPackages; // maps an IPath (of a project) to XbPackages
+ private HashMap<IPath, ArchiveModelNode> archivesRoot; // maps an IPath (of a project) to PackageModelNode, aka root
+ private ArrayList<IArchiveBuildListener> buildListeners;
+ private ArrayList<IArchiveModelListener> modelListeners;
public ArchivesModel() {
- xbPackages = new HashMap();
- archivesRoot = new HashMap();
- buildListeners = new ArrayList();
- modelListeners = new ArrayList();
+ xbPackages = new HashMap<IPath, XbPackages>();
+ archivesRoot = new HashMap<IPath, ArchiveModelNode>();
+ buildListeners = new ArrayList<IArchiveBuildListener>();
+ modelListeners = new ArrayList<IArchiveModelListener>();
}
@@ -104,7 +104,7 @@
buildListeners.remove(listener);
}
public IArchiveBuildListener[] getBuildListeners() {
- return (IArchiveBuildListener[]) buildListeners.toArray(new IArchiveBuildListener[buildListeners.size()]);
+ return buildListeners.toArray(new IArchiveBuildListener[buildListeners.size()]);
}
public void addModelListener(IArchiveModelListener listener) {
@@ -125,7 +125,7 @@
modelListeners.remove(listener);
}
public IArchiveModelListener[] getModelListeners() {
- return (IArchiveModelListener[]) modelListeners.toArray(new IArchiveModelListener[modelListeners.size()]);
+ return modelListeners.toArray(new IArchiveModelListener[modelListeners.size()]);
}
@@ -134,7 +134,7 @@
public XbPackages getXbPackages(IPath project) {
- return (XbPackages)(xbPackages.get(project));
+ return (xbPackages.get(project));
}
/**
@@ -146,7 +146,7 @@
public XbPackages getXbPackages(IPath project, IProgressMonitor monitor) {
if( !xbPackages.containsKey(project))
registerProject(project, monitor);
- return (XbPackages)(xbPackages.get(project));
+ return (xbPackages.get(project));
}
/**
@@ -173,10 +173,10 @@
*/
protected ArchiveModelNode[] getAllArchives() {
ArchiveModelNode[] ret = new ArchiveModelNode[archivesRoot.keySet().size()];
- Iterator i = archivesRoot.keySet().iterator();
+ Iterator<IPath> i = archivesRoot.keySet().iterator();
int x = 0;
while(i.hasNext()) {
- ret[x++] = (ArchiveModelNode)archivesRoot.get(i.next());
+ ret[x++] = archivesRoot.get(i.next());
}
return ret;
}
@@ -194,7 +194,7 @@
if( archivesRoot.get(project) == null && register ) {
registerProject(project, monitor);
}
- return (IArchiveModelNode)(archivesRoot.get(project));
+ return (archivesRoot.get(project));
}
public IArchive[] getProjectArchives(IPath project) {
@@ -203,12 +203,12 @@
public IArchive[] getProjectArchives(IPath project, boolean register, IProgressMonitor monitor) {
IArchiveModelNode root = getRoot(project, register, monitor);
if( root != null ) {
- List list = Arrays.asList( getRoot(project, register, monitor).getAllChildren());
- return (IArchive[]) list.toArray(new IArchive[list.size()]);
+ List<IArchiveNode> list = Arrays.asList( getRoot(project, register, monitor).getAllChildren());
+ return list.toArray(new IArchive[list.size()]);
} else if( register) {
registerProject(project, monitor);
- List list = Arrays.asList( getRoot(project, register, monitor).getAllChildren());
- return (IArchive[]) list.toArray(new IArchive[list.size()]);
+ List<IArchiveNode> list = Arrays.asList( getRoot(project, register, monitor).getAllChildren());
+ return list.toArray(new IArchive[list.size()]);
} else {
return new IArchive[] {};
}
@@ -241,7 +241,7 @@
return;
}
root = new ArchiveModelNode(project, packages, this);
- ArchiveModelNode oldRoot = (ArchiveModelNode)archivesRoot.get(project);
+ ArchiveModelNode oldRoot = archivesRoot.get(project);
xbPackages.put(project, packages);
archivesRoot.put(project, root);
createPackageNodeImpl(project, packages, null);
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/EventManager.java (from rev 6189, 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/EventManager.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/EventManager.java 2008-02-07 23:02:21 UTC (rev 6192)
@@ -0,0 +1,201 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.archives.core.model;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+
+/**
+ * The event manager to fire events
+ * @author <a href="rob.stryker(a)redhat.com">Rob Stryker</a>
+ */
+public class EventManager {
+
+ public static void cleanProjectBuild(IPath project) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].cleanProject(project);
+ } catch(Exception e ) {}
+ }
+ }
+
+ public static void cleanArchiveBuild(IArchive archive) {
+ IArchiveBuildListener[] listeners = getBuildListeners(archive);
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].cleanArchive(archive);
+ } catch( Exception e) {
+ }
+ }
+ }
+
+ public static void startedBuild(IPath project) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].startedBuild(project);
+ } catch(Exception e ) {}
+ }
+ }
+
+ public static void finishedBuild(IPath project) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].finishedBuild(project);
+ } catch(Exception e ) {}
+ }
+ }
+
+ public static void startedBuildingArchive(IArchive archive) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].startedBuildingArchive(archive);
+ } catch(Exception e ) {}
+ }
+ }
+
+ public static void finishedBuildingArchive(IArchive archive) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].finishedBuildingArchive(archive);
+ } catch(Exception e ) {}
+ }
+ }
+
+
+
+ public static void startedCollectingFileSet(IArchiveFileSet fileset) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].startedCollectingFileSet(fileset);
+ } catch(Exception e ) {}
+ }
+ }
+ public static void finishedCollectingFileSet(IArchiveFileSet fileset) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].finishedCollectingFileSet(fileset);
+ } catch(Exception e ) {}
+ }
+ }
+
+ // Bulk events
+ public static void filesUpdated(IArchive topLevelArchive, IArchiveFileSet fileset, IPath[] filePath) {
+ for( int i = 0; i < filePath.length; i++ ) {
+ fileUpdated(topLevelArchive, fileset, filePath[i]);
+ }
+ }
+
+ // one file updated matching multiple filesets
+ public static void fileUpdated(IPath path, IArchiveFileSet[] matchingFilesets) {
+ for( int i = 0; i < matchingFilesets.length; i++ ) {
+ fileUpdated(matchingFilesets[i].getRootArchive(), matchingFilesets[i], path);
+ }
+ }
+
+ public static void fileUpdated(IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].fileUpdated(topLevelArchive, fileset, filePath);
+ } catch(Exception e ) {}
+ }
+ }
+
+ public static void fileRemoved(IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].fileRemoved(topLevelArchive, fileset, filePath);
+ } catch(Exception e ) {}
+ }
+ }
+
+ // one file removed matching multiple filesets
+ public static void fileRemoved(IPath path, IArchiveFileSet[] matchingFilesets) {
+ for( int i = 0; i < matchingFilesets.length; i++ ) {
+ fileRemoved(matchingFilesets[i].getRootArchive(), matchingFilesets[i], path);
+ }
+ }
+
+ public static void filesRemoved(IPath[] paths, IArchiveFileSet fileset) {
+ for( int i = 0; i < paths.length; i++ ) {
+ fileRemoved(fileset.getRootArchive(), fileset, paths[i]);
+ }
+ }
+
+ public static void buildFailed(IArchive pkg, IStatus status) {
+ IArchiveBuildListener[] listeners = getBuildListeners();
+ for( int i = 0; i < listeners.length; i++ ) {
+ try {
+ listeners[i].buildFailed(pkg, status);
+ } catch(Exception e ) {}
+ }
+ }
+
+
+
+ /**
+ * Fire events dealing with model changes
+ * @param delta
+ */
+
+ public static void fireDelta(IArchiveNodeDelta delta) {
+ 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();
+ }
+ }
+ }
+
+
+ private static IArchiveModelListener[] getModelListeners(IArchiveNode node) {
+ IArchiveModelNode model = node.getModel();
+ if( model != null && model.getManager() != null ) {
+ return model.getManager().getModelListeners();
+ }
+ return new IArchiveModelListener[]{};
+ }
+
+ // get workspace default ones
+ private static IArchiveBuildListener[] getBuildListeners() {
+ return ArchivesModel.instance().getBuildListeners();
+ }
+ private static IArchiveBuildListener[] getBuildListeners(IArchiveNode node) {
+ IArchiveModelNode model = node.getModel();
+ if( model != null && model.getManager() != null ) {
+ return model.getManager().getBuildListeners();
+ }
+ return new IArchiveBuildListener[]{};
+ }
+
+}
Deleted: 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 2008-02-07 22:57:19 UTC (rev 6191)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/events/EventManager.java 2008-02-07 23:02:21 UTC (rev 6192)
@@ -1,209 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.archives.core.model.events;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveBuildListener;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveModelListener;
-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.IArchiveNodeDelta;
-
-/**
- * The event manager to fire events
- * @author <a href="rob.stryker(a)redhat.com">Rob Stryker</a>
- */
-public class EventManager {
-
- public static void cleanProjectBuild(IPath project) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].cleanProject(project);
- } catch(Exception e ) {}
- }
- }
-
- public static void cleanArchiveBuild(IArchive archive) {
- IArchiveBuildListener[] listeners = getBuildListeners(archive);
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].cleanArchive(archive);
- } catch( Exception e) {
- }
- }
- }
-
- public static void startedBuild(IPath project) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].startedBuild(project);
- } catch(Exception e ) {}
- }
- }
-
- public static void finishedBuild(IPath project) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].finishedBuild(project);
- } catch(Exception e ) {}
- }
- }
-
- public static void startedBuildingArchive(IArchive archive) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].startedBuildingArchive(archive);
- } catch(Exception e ) {}
- }
- }
-
- public static void finishedBuildingArchive(IArchive archive) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].finishedBuildingArchive(archive);
- } catch(Exception e ) {}
- }
- }
-
-
-
- public static void startedCollectingFileSet(IArchiveFileSet fileset) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].startedCollectingFileSet(fileset);
- } catch(Exception e ) {}
- }
- }
- public static void finishedCollectingFileSet(IArchiveFileSet fileset) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].finishedCollectingFileSet(fileset);
- } catch(Exception e ) {}
- }
- }
-
- // Bulk events
- public static void filesUpdated(IArchive topLevelArchive, IArchiveFileSet fileset, IPath[] filePath) {
- for( int i = 0; i < filePath.length; i++ ) {
- fileUpdated(topLevelArchive, fileset, filePath[i]);
- }
- }
-
- // one file updated matching multiple filesets
- public static void fileUpdated(IPath path, IArchiveFileSet[] matchingFilesets) {
- for( int i = 0; i < matchingFilesets.length; i++ ) {
- fileUpdated(matchingFilesets[i].getRootArchive(), matchingFilesets[i], path);
- }
- }
-
- public static void fileUpdated(IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].fileUpdated(topLevelArchive, fileset, filePath);
- } catch(Exception e ) {}
- }
- }
-
- public static void fileRemoved(IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].fileRemoved(topLevelArchive, fileset, filePath);
- } catch(Exception e ) {}
- }
- }
-
- // one file removed matching multiple filesets
- public static void fileRemoved(IPath path, IArchiveFileSet[] matchingFilesets) {
- for( int i = 0; i < matchingFilesets.length; i++ ) {
- fileRemoved(matchingFilesets[i].getRootArchive(), matchingFilesets[i], path);
- }
- }
-
- public static void filesRemoved(IPath[] paths, IArchiveFileSet fileset) {
- for( int i = 0; i < paths.length; i++ ) {
- fileRemoved(fileset.getRootArchive(), fileset, paths[i]);
- }
- }
-
- public static void buildFailed(IArchive pkg, IStatus status) {
- IArchiveBuildListener[] listeners = getBuildListeners();
- for( int i = 0; i < listeners.length; i++ ) {
- try {
- listeners[i].buildFailed(pkg, status);
- } catch(Exception e ) {}
- }
- }
-
-
-
- /**
- * Fire events dealing with model changes
- * @param delta
- */
-
- public static void fireDelta(IArchiveNodeDelta delta) {
- 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();
- }
- }
- }
-
-
- private static IArchiveModelListener[] getModelListeners(IArchiveNode node) {
- IArchiveModelNode model = node.getModel();
- if( model != null && model.getManager() != null ) {
- return model.getManager().getModelListeners();
- }
- return new IArchiveModelListener[]{};
- }
-
- // get workspace default ones
- private static IArchiveBuildListener[] getBuildListeners() {
- return ArchivesModel.instance().getBuildListeners();
- }
- private static IArchiveBuildListener[] getBuildListeners(IArchiveNode node) {
- IArchiveModelNode model = node.getModel();
- if( model != null && model.getManager() != null ) {
- return model.getManager().getBuildListeners();
- }
- return new IArchiveBuildListener[]{};
- }
-
-}
16 years, 4 months
JBoss Tools SVN: r6191 - in trunk/core/plugins: org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-07 17:57:19 -0500 (Thu, 07 Feb 2008)
New Revision: 6191
Added:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesWorkspaceLogger.java
Removed:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java
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.ui/src/main/org/jboss/ide/eclipse/archives/ui/NodeContribution.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewArchiveAction.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
Log:
Preparing to break / destroy archives! awesome for API refactors
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java 2008-02-07 22:53:56 UTC (rev 6190)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java 2008-02-07 22:57:19 UTC (rev 6191)
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.archives.core.model.other.internal;
-
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.jboss.ide.eclipse.archives.core.model.IArchivesLogger;
-
-/**
- * @author eskimo
- * Comment:
- * This could probably be worked into ArchivesCore API
- * This specific implementation should belong in an eclipse-specific
- * class.
- */
-public class ArchivesCoreLog implements IArchivesLogger {
- /**
- * Copy of ArchiveCorePlugin.PLUGIN_ID to break dependency cycle between
- * jars in this plug-in
- *
- * @see ArchiveCorePlugin.PLUGIN_ID
- */
- public static final String PLUGIN_ID = "org.jboss.ide.eclipse.archives.core";
-
- static ILog log = Platform.getLog(Platform.getBundle(PLUGIN_ID));
-
- public void log(int severety, String message,Throwable ise) {
- IStatus status = new Status(severety, PLUGIN_ID, message, ise);
- log.log(status);
- }
-}
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesWorkspaceLogger.java (from rev 6190, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesWorkspaceLogger.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesWorkspaceLogger.java 2008-02-07 22:57:19 UTC (rev 6191)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.archives.core.model.other.internal;
+
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.archives.core.model.IArchivesLogger;
+
+/**
+ * @author eskimo
+ * Comment:
+ * This could probably be worked into ArchivesCore API
+ * This specific implementation should belong in an eclipse-specific
+ * class.
+ */
+public class ArchivesWorkspaceLogger implements IArchivesLogger {
+ /**
+ * Copy of ArchiveCorePlugin.PLUGIN_ID to break dependency cycle between
+ * jars in this plug-in
+ *
+ * @see ArchiveCorePlugin.PLUGIN_ID
+ */
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.archives.core";
+
+ static ILog log = Platform.getLog(Platform.getBundle(PLUGIN_ID));
+
+ public void log(int severety, String message,Throwable ise) {
+ IStatus status = new Status(severety, PLUGIN_ID, message, ise);
+ log.log(status);
+ }
+}
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 2008-02-07 22:53:56 UTC (rev 6190)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java 2008-02-07 22:57:19 UTC (rev 6191)
@@ -29,7 +29,6 @@
import org.eclipse.core.runtime.Path;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.ArchivesCoreLog;
/**
* Utility methods and entry points for model-related APIs
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/NodeContribution.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/NodeContribution.java 2008-02-07 22:53:56 UTC (rev 6190)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/NodeContribution.java 2008-02-07 22:57:19 UTC (rev 6191)
@@ -8,7 +8,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.jboss.ide.eclipse.archives.core.Trace;
import org.jboss.ide.eclipse.archives.ui.actions.INodeActionDelegate;
import org.osgi.framework.Bundle;
@@ -25,7 +24,7 @@
try {
actionDelegate = (INodeActionDelegate) element.createExecutableExtension("class");
} catch (CoreException e) {
- Trace.trace(getClass(), e);
+//TODO Trace.trace(getClass(), e);
}
String iconPath = element.getAttribute("icon");
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewArchiveAction.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewArchiveAction.java 2008-02-07 22:53:56 UTC (rev 6190)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewArchiveAction.java 2008-02-07 22:57:19 UTC (rev 6191)
@@ -10,7 +10,6 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IActionDelegate;
-import org.jboss.ide.eclipse.archives.core.Trace;
import org.osgi.framework.Bundle;
/**
@@ -30,7 +29,7 @@
try {
action = (IActionDelegate) element.createExecutableExtension("class");
} catch (CoreException e) {
- Trace.trace(getClass(), e);
+//TODO Trace.trace(getClass(), e);
}
String iconPath = element.getAttribute("icon");
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2008-02-07 22:53:56 UTC (rev 6190)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2008-02-07 22:57:19 UTC (rev 6191)
@@ -14,7 +14,6 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
-import org.jboss.ide.eclipse.archives.core.Trace;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
@@ -102,9 +101,9 @@
}
});
} catch (InvocationTargetException e) {
- Trace.trace(getClass(), e);
+//TODO Trace.trace(getClass(), e);
} catch (InterruptedException e) {
- Trace.trace(getClass(), e);
+//TODO Trace.trace(getClass(), e);
}
}
return performed;
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2008-02-07 22:53:56 UTC (rev 6190)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2008-02-07 22:57:19 UTC (rev 6191)
@@ -2,12 +2,10 @@
import java.lang.reflect.InvocationTargetException;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.Wizard;
-import org.jboss.ide.eclipse.archives.core.Trace;
import org.jboss.ide.eclipse.archives.core.model.ArchiveNodeFactory;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
@@ -46,9 +44,9 @@
}
});
} catch (InvocationTargetException e) {
- Trace.trace(getClass(), e);
+//TODO Trace.trace(getClass(), e);
} catch (InterruptedException e) {
- Trace.trace(getClass(), e);
+//TODO Trace.trace(getClass(), e);
}
} catch(Exception e) {e.printStackTrace();}
16 years, 4 months
JBoss Tools SVN: r6190 - in trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src: eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-07 17:53:56 -0500 (Thu, 07 Feb 2008)
New Revision: 6190
Added:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchivesLogger.java
Removed:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreLog.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/Trace.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/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/types/WorkspaceJARArchiveType.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/ant/AntArchivesCore.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/ArchivesModelCore.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveFileSetImpl.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java
Log:
Preparing to break / destroy archives! awesome for API refactors
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 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -6,6 +6,7 @@
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.IArchivesLogger;
import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
@@ -37,5 +38,14 @@
public void preRegister(IPath project) {
ProjectUtils.addProjectNature(project);
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.ide.eclipse.archives.core.ArchivesCore#createLogger()
+ */
+ @Override
+ protected IArchivesLogger createLogger() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java (from rev 6189, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreLog.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/ArchivesCoreLog.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.archives.core.model.other.internal;
+
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.archives.core.model.IArchivesLogger;
+
+/**
+ * @author eskimo
+ * Comment:
+ * This could probably be worked into ArchivesCore API
+ * This specific implementation should belong in an eclipse-specific
+ * class.
+ */
+public class ArchivesCoreLog implements IArchivesLogger {
+ /**
+ * Copy of ArchiveCorePlugin.PLUGIN_ID to break dependency cycle between
+ * jars in this plug-in
+ *
+ * @see ArchiveCorePlugin.PLUGIN_ID
+ */
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.archives.core";
+
+ static ILog log = Platform.getLog(Platform.getBundle(PLUGIN_ID));
+
+ public void log(int severety, String message,Throwable ise) {
+ IStatus status = new Status(severety, PLUGIN_ID, message, ise);
+ log.log(status);
+ }
+}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -29,9 +29,10 @@
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.InvalidRegistryObjectException;
import org.eclipse.core.runtime.Platform;
-import org.jboss.ide.eclipse.archives.core.Trace;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
@@ -63,9 +64,9 @@
IArchiveType type = (IArchiveType)executable;
archiveTypes.put(type.getId(), type);
} catch (InvalidRegistryObjectException e) {
- Trace.trace(WorkspaceExtensionManager.class, e);
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, e.getMessage(), e);
} catch( CoreException e ) {
- Trace.trace(WorkspaceExtensionManager.class, e);
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, e.getMessage(), e);
}
}
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/types/WorkspaceJARArchiveType.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/types/WorkspaceJARArchiveType.java 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/types/WorkspaceJARArchiveType.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -6,11 +6,12 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.ide.eclipse.archives.core.Trace;
+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.internal.ArchiveFileSetImpl;
@@ -41,7 +42,7 @@
try {
outputPath = javaProject.getOutputLocation();
} catch (JavaModelException e) {
- Trace.trace(WorkspaceJARArchiveType.class, e);
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, e.getMessage(), e);
return null;
}
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 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCore.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -1,6 +1,7 @@
package org.jboss.ide.eclipse.archives.core;
import org.eclipse.core.runtime.IPath;
+import org.jboss.ide.eclipse.archives.core.model.IArchivesLogger;
import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
@@ -22,12 +23,14 @@
private IRuntimeVariables variables;
private IExtensionManager extensionManager;
private IPreferenceManager preferenceManager;
+ private IArchivesLogger logger;
public ArchivesCore(int runType) {
this.runType = runType;
variables = createVariables();
extensionManager = createExtensionManager();
preferenceManager = createPreferenceManager();
+ logger = createLogger();
instance = this;
}
@@ -35,6 +38,7 @@
protected abstract IRuntimeVariables createVariables();
protected abstract IExtensionManager createExtensionManager();
protected abstract IPreferenceManager createPreferenceManager();
+ protected abstract IArchivesLogger createLogger();
public boolean isWorkspaceRuntype() {
return runType == WORKSPACE;
@@ -49,6 +53,9 @@
public IPreferenceManager getPreferenceManager() {
return preferenceManager;
}
+ public IArchivesLogger getLogger() {
+ return logger;
+ }
public abstract void preRegister(IPath project);
}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreLog.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreLog.java 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreLog.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.archives.core;
-
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-/**
- * @author eskimo
- * Comment:
- * This could probably be worked into ArchivesCore API
- * This specific implementation should belong in an eclipse-specific
- * class.
- */
-public class ArchivesCoreLog {
- /**
- * Copy of ArchiveCorePlugin.PLUGIN_ID to break dependency cycle between
- * jars in this plug-in
- *
- * @see ArchiveCorePlugin.PLUGIN_ID
- */
- public static final String PLUGIN_ID = "org.jboss.ide.eclipse.archives.core";
-
- static ILog log = Platform.getLog(Platform.getBundle(PLUGIN_ID));
-
- public static void log(int severety, String message,Throwable ise) {
- IStatus status = new Status(severety, PLUGIN_ID, message, ise);
- log.log(status);
- }
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/Trace.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/Trace.java 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/Trace.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -1,66 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.archives.core;
-
-
-public class Trace {
-
- public static final String DEBUG_OPTION_ROOT = "org.jboss.ide.eclipse.packages.core/debug/";
- public static final String DEBUG_OPTION_STREAM_CLOSE = DEBUG_OPTION_ROOT + "streamClose";
-
- public static boolean isDebugging(String option) {
- return ArchivesCore.getInstance().getVariables().isDebugging(option);
- }
-
- public static void trace (Class caller, String message) {
- trace(caller, message, null);
- }
-
- public static void trace (Class caller, String message, String option) {
- trace(caller, message, null, option);
- }
-
- public static void trace (Class caller, Throwable t) {
- trace(caller, t, null);
- }
-
- public static void trace (Class caller, Throwable t, String option) {
- trace(caller, t.getMessage(), t, option);
- }
-
- public static void trace (Class caller, String message, Throwable t, String option) {
- if (!isDebugging(null))
- return;
-
- if (option != null) {
- if (!isDebugging(option))
- return;
- }
-
- System.out.println("[" + caller.getName() + "] " + message);
-
- if (t != null) {
- t.printStackTrace();
- }
- }
-
-}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntArchivesCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntArchivesCore.java 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntArchivesCore.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -4,6 +4,7 @@
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
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.IArchivesLogger;
import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
@@ -35,4 +36,8 @@
public void preRegister(IPath project) {
}
+
+ protected IArchivesLogger createLogger() {
+ return null;
+ }
}
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 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -31,9 +31,9 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
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.model.events.EventManager;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveFileSetImpl;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveFolderImpl;
@@ -237,7 +237,7 @@
if (packages == null) {
// Empty / non-working XML file loaded
- Trace.trace(getClass(), "WARNING: .packages file for project " + project.lastSegment() + " is empty or contains the wrong content");
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, "Could not unmarshall packages file", null);
return;
}
root = new ArchiveModelNode(project, packages, this);
@@ -249,7 +249,7 @@
fireRegisterProjectEvent(oldRoot, root);
monitor.worked(1);
} catch (FileNotFoundException e) {
- Trace.trace(getClass(), e);
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, e.getMessage(), e);
}
} else {
// file not found, just create some default xbpackages and insert them
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 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModelCore.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -27,8 +27,9 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.jboss.ide.eclipse.archives.core.ArchivesCoreLog;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
+import org.jboss.ide.eclipse.archives.core.model.other.internal.ArchivesCoreLog;
/**
* Utility methods and entry points for model-related APIs
@@ -102,7 +103,7 @@
}
return paths;
} catch( IllegalStateException ise ) {
- ArchivesCoreLog.log(IStatus.WARNING, "Error creating directory scanner", ise);
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, "Error creating directory scanner", ise);
return new IPath[]{};
}
}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchivesLogger.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchivesLogger.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchivesLogger.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -0,0 +1,30 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.archives.core.model;
+
+/**
+ * @author rob.stryker <rob.stryker(a)redhat.com>
+ *
+ */
+public interface IArchivesLogger {
+ public void log(int severety, String message,Throwable ise);
+}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveFileSetImpl.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveFileSetImpl.java 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveFileSetImpl.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -27,7 +27,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.jboss.ide.eclipse.archives.core.ArchivesCoreLog;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory.DirectoryScannerExtension;
@@ -156,7 +156,7 @@
}
matchingPaths = paths;
} catch( IllegalStateException ise ) {
- ArchivesCoreLog.log(IStatus.WARNING, "Could not create directory scanner", ise);
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, "Could not create directory scanner", ise);
}
}
return scanner;
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 2008-02-07 22:33:08 UTC (rev 6189)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XMLBinding.java 2008-02-07 22:53:56 UTC (rev 6190)
@@ -27,7 +27,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
@@ -37,9 +36,9 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
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.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveImpl;
import org.jboss.xb.binding.JBossXBException;
@@ -74,7 +73,7 @@
stream.close();
initialized = true;
} catch (IOException e) {
- Trace.trace(XMLBinding.class, e);
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, e.getMessage(), e);
}
}
@@ -111,7 +110,7 @@
monitor.worked(1);
} catch (JBossXBException e) {
- Trace.trace(XMLBinding.class, e);
+ ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, e.getMessage(), e);
}
}
});
16 years, 4 months
JBoss Tools SVN: r6189 - in trunk: core/plugins/org.jboss.ide.eclipse.archives.core/.settings and 13 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-07 17:33:08 -0500 (Thu, 07 Feb 2008)
New Revision: 6189
Added:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntArchivesCore.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntExtensionManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntPreferenceManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntVariables.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/EclipseResourceGroupTask.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/EclipseResourceTask.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/IsolatedAntExecution.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/IsolatedTruezipExecution.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/JBossArchivesTask.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/ResourceModel.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/antlib.xml
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/tasks.properties
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveBuildListener.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModelListener.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IExtensionManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IPreferenceManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IRuntimeVariables.java
Removed:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.settings/org.eclipse.jdt.ui.prefs
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/other/IArchiveBuildListener.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveModelListener.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IExtensionManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IPreferenceManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IRuntimeVariables.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandaloneExtensionManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandalonePreferenceManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandaloneVariables.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.settings/org.eclipse.jdt.core.prefs
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/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspacePreferenceManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariables.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/ArchivesCoreLog.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/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/model/ArchivesModel.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModelListenerManager.java
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/xpl/StringSubstitutionEngineClone.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java
Log:
Preparing to break / destroy archives! awesome for API refactors
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -35,10 +35,10 @@
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveBuildListener;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModelListener;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
-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.as.core.modules.PackageModuleFactory.PackagedModuleDelegate;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.settings/org.eclipse.jdt.core.prefs 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.settings/org.eclipse.jdt.core.prefs 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,12 +1,12 @@
-#Mon Nov 06 21:45:06 GMT 2006
+#Mon Jan 21 18:36:05 EST 2008
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.settings/org.eclipse.jdt.ui.prefs 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/.settings/org.eclipse.jdt.ui.prefs 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,3 +0,0 @@
-#Thu Jun 01 20:21:28 CDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
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 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF 2008-02-07 22:33:08 UTC (rev 6189)
@@ -28,7 +28,5 @@
org.jboss.ide.eclipse.archives.core.model.events;x-friends:="org.jboss.ide.eclipse.archives.test",
org.jboss.ide.eclipse.archives.core.model.internal;x-friends:="org.jboss.ide.eclipse.archives.test",
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.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 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/WorkspaceArchivesCore.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -6,9 +6,9 @@
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;
+import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
+import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
+import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
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;
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -33,7 +33,7 @@
import org.eclipse.core.runtime.Platform;
import org.jboss.ide.eclipse.archives.core.Trace;
import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
-import org.jboss.ide.eclipse.archives.core.model.other.IExtensionManager;
+import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
/**
* This class will be responsible for loading extension points in the core.
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspacePreferenceManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspacePreferenceManager.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspacePreferenceManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -33,7 +33,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
-import org.jboss.ide.eclipse.archives.core.model.other.IPreferenceManager;
+import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
import org.osgi.service.prefs.BackingStoreException;
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariables.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariables.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariables.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -9,7 +9,7 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.variables.VariablesPlugin;
import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
-import org.jboss.ide.eclipse.archives.core.model.other.IRuntimeVariables;
+import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
public class WorkspaceVariables implements IRuntimeVariables {
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 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCore.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,9 +1,9 @@
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;
+import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
+import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
+import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
public abstract class ArchivesCore {
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreLog.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreLog.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ArchivesCoreLog.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -14,11 +14,13 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
/**
* @author eskimo
- *
+ * Comment:
+ * This could probably be worked into ArchivesCore API
+ * This specific implementation should belong in an eclipse-specific
+ * class.
*/
public class ArchivesCoreLog {
/**
Deleted: 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 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/StandaloneArchivesCore.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,36 +0,0 @@
-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;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.StandaloneExtensionManager;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.StandalonePreferenceManager;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.StandaloneVariables;
-
-public class StandaloneArchivesCore extends ArchivesCore {
-
- public StandaloneArchivesCore ()
- {
- super(STANDALONE);
- ArchivesModel.instance().addModelListener(new ModelChangeListener());
- }
-
- protected IExtensionManager createExtensionManager() {
- return new StandaloneExtensionManager();
- }
-
- protected IPreferenceManager createPreferenceManager() {
- return new StandalonePreferenceManager();
- }
-
- protected IRuntimeVariables createVariables() {
- return new StandaloneVariables();
- }
-
- public void preRegister(IPath project) {
-
- }
-}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntArchivesCore.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntArchivesCore.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntArchivesCore.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,38 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+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.IExtensionManager;
+import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
+import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
+
+/**
+ * A core API entry point for ant.
+ * @author rob stryker (rob.stryker(a)redhat.com)
+ *
+ */
+public class AntArchivesCore extends ArchivesCore {
+
+ public AntArchivesCore () {
+ super(STANDALONE);
+ ArchivesModel.instance().addModelListener(new ModelChangeListener());
+ }
+
+ protected IExtensionManager createExtensionManager() {
+ return new AntExtensionManager();
+ }
+
+ protected IPreferenceManager createPreferenceManager() {
+ return new AntPreferenceManager();
+ }
+
+ protected IRuntimeVariables createVariables() {
+ return new AntVariables();
+ }
+
+ public void preRegister(IPath project) {
+
+ }
+}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntExtensionManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntExtensionManager.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntExtensionManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,41 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
+import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
+
+/**
+ * The ant API to extensions, specifically archive types.
+ * This is a stub and returns functional but bland implementations.
+ * @author rob stryker (rob.stryker(a)redhat.com)
+ *
+ */
+public class AntExtensionManager implements IExtensionManager {
+
+ public IArchiveType getArchiveType(String id) {
+ final String typeId = id;
+
+ return new IArchiveType () {
+ public String getId() {
+ return typeId;
+ }
+ public String getLabel() {
+ return typeId;
+ }
+ public IArchive createDefaultConfiguration(String projectName, IProgressMonitor monitor) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ public IArchive fillDefaultConfiguration(String projectName, IArchive topLevel, IProgressMonitor monitor) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+ }
+
+ public IArchiveType[] getArchiveTypes() {
+ return new IArchiveType[0];
+ }
+
+}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntPreferenceManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntPreferenceManager.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntPreferenceManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,35 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
+
+/**
+ * This is to manage preferences relating to projects.
+ * This is a candidate to be moved to eclipse-only API, or to be
+ * fixed or changed to be more versatile.
+ * @author rob stryker
+ *
+ */
+public class AntPreferenceManager implements IPreferenceManager {
+
+ public boolean areProjectSpecificPrefsEnabled(IPath path) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isBuilderEnabled(IPath path) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setBuilderEnabled(IPath path, boolean val) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setProjectSpecificPrefsEnabled(IPath path, boolean val) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntVariables.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntVariables.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/AntVariables.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,60 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.apache.tools.ant.Task;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.ide.eclipse.archives.core.model.IRuntimeVariables;
+import org.jboss.ide.eclipse.archives.core.xpl.StringSubstitutionEngineClone;
+
+public class AntVariables implements IRuntimeVariables {
+ private Task currentTask;
+ public void setCurrentTask(Task task) { currentTask = task; }
+ public Task getCurrentTask() { return currentTask; }
+
+ public URL getBindingLog4j() {
+ return getClass().getClassLoader().getResource("log4j.xml");
+ }
+
+ public URL getBindingSchema() {
+ return getClass().getClassLoader().getResource("packages.xsd");
+ }
+
+ public IPath getProjectPath(String projectName) {
+ HashMap map = ResourceModel.getDefault().getTaskEnvironment(currentTask);
+ if( map.containsKey(projectName)) return new Path((String)map.get(projectName));
+ if( map.containsKey(IPath.SEPARATOR + projectName)) return new Path((String)map.get(IPath.SEPARATOR + projectName));
+
+ return null;
+ }
+
+ public boolean isDebugging(String option) {
+ return System.getProperty("archives.debug", "true")
+ .equals("true");
+ }
+
+ public String getProjectName(IPath path) {
+ Properties props = System.getProperties();
+ Object key, val;
+ for( Iterator i = props.keySet().iterator(); i.hasNext(); ) {
+ key = i.next();
+ if( key instanceof String && ((String)key).endsWith(".dir")) {
+ val = props.get(key);
+ if( path.toOSString().equals(new Path((String)val).toOSString()))
+ return (String)key;
+ }
+ }
+ return null;
+ }
+
+ public String performStringSubstitution(String expression,
+ boolean reportUndefinedVariables) throws CoreException {
+ return new StringSubstitutionEngineClone().performStringSubstitution(expression, reportUndefinedVariables);
+ }
+
+}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/EclipseResourceGroupTask.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/EclipseResourceGroupTask.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/EclipseResourceGroupTask.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,46 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import java.util.ArrayList;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import org.jboss.ide.eclipse.archives.core.ant.ResourceModel.EclipseResource;
+
+public class EclipseResourceGroupTask extends Task {
+ private String id;
+ private boolean global;
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+ public boolean isGlobal() {
+ return global;
+ }
+ public void setGlobal(boolean global) {
+ this.global = global;
+ }
+
+ public void execute() throws BuildException {
+ if( id == null || id.equals("")) {
+ throw new BuildException("id cannot be null or blank");
+ } else {
+ ResourceModel.getDefault().addResourceGroup(id, resources, global, this);
+ }
+ }
+
+ ArrayList resources = new ArrayList();
+ public EclipseResource createEclipseResource() {
+ EclipseResource res = new EclipseResource();
+ resources.add(res);
+ return res;
+ }
+}
+
+
+
+
+
+
+
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/EclipseResourceTask.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/EclipseResourceTask.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/EclipseResourceTask.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,49 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+
+public class EclipseResourceTask extends Task {
+ private String eclipsePath;
+ private String loc;
+ private boolean global = false;
+
+ public void execute() throws BuildException {
+ if( eclipsePath == null )
+ log("eclipsePath is null. Skipping " + getLocation(), Project.MSG_WARN);
+ else if( loc == null )
+ log("loc is null. Skipping " + getLocation(), Project.MSG_WARN);
+ else {
+ if( global ) {
+ ResourceModel.getDefault().addGlobalReference(eclipsePath, loc,this);
+ } else if( getOwningTarget() == null || getOwningTarget().getName().equals("")) {
+ ResourceModel.getDefault().addProjectReference(getProject(), eclipsePath, loc, this);
+ } else {
+ ResourceModel.getDefault().addTargetReference(getOwningTarget(), eclipsePath, loc, this);
+ }
+ }
+ }
+
+ public String getEclipsePath() {
+ return eclipsePath;
+ }
+ public void setEclipsePath(String eclipsePath) {
+ this.eclipsePath = eclipsePath;
+ }
+ public String getLoc() {
+ return loc;
+ }
+ public void setLoc(String loc) {
+ this.loc = loc;
+ }
+
+ public boolean isGlobal() {
+ return global;
+ }
+
+ public void setGlobal(boolean global) {
+ this.global = global;
+ }
+
+}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/IsolatedAntExecution.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/IsolatedAntExecution.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/IsolatedAntExecution.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,293 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.util.Collection;
+import java.util.HashMap;
+
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Ear;
+import org.apache.tools.ant.taskdefs.Jar;
+import org.apache.tools.ant.taskdefs.War;
+import org.apache.tools.ant.taskdefs.Zip;
+import org.apache.tools.ant.types.ZipFileSet;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+/************************************************************
+ * IsolatedAntExecution is responsible for
+ * IsolatedAntExecution functionality when antOnly=true
+ * or a prerequisite is not met in the IsolatedTruezipExecution.
+ *
+ * @author Tom Crosman
+ ***********************************************************/
+public class IsolatedAntExecution {
+ /**
+ * Packages file defaults to ".packages"
+ */
+ private String jbossPackages = ArchivesModel.PROJECT_PACKAGES_FILE;
+ private JBossArchivesTask parentTask;
+
+ public IsolatedAntExecution(JBossArchivesTask parent) {
+ parentTask = parent;
+ }
+
+ /**
+ * Invoked by the handler to create a task specific to
+ * the JBoss package. Initializes new task to the
+ * parent environment. Package scope so only the handler
+ * can invoke it.
+ * @param type The ant task type to create.
+ * @return the initialed task created.
+ **/
+ Zip createTask(String type) {
+ Zip task = null;
+ if ("jar".equals(type)) {
+ task = new Jar();
+ } else if ("war".equals(type)) {
+ task = new War();
+ } else if (type.indexOf("ear") != -1) {
+ task = new Ear();
+ } else if (type.indexOf("ejb") != -1) {
+ task = new Jar();
+ } else {
+ throw new IllegalArgumentException("Unsupported type: " + type);
+ }
+
+ /** copy as much over as possible **/
+ task.setDescription(parentTask.getDescription());
+ task.setLocation(parentTask.getLocation());
+ task.setOwningTarget(parentTask.getOwningTarget());
+ task.setProject(parentTask.getProject());
+ task.setRuntimeConfigurableWrapper(parentTask.getRuntimeConfigurableWrapper());
+ task.setTaskName(parentTask.getTaskName());
+ task.setTaskType(parentTask.getTaskType());
+
+ return task;
+ }
+
+ /**
+ * Configures and launches the parsing of our xml file.
+ *
+ * @param handler the DocumentHandler that support parsing the
+ * authenticate.dtd formatted xml file.
+ */
+ private void parseMe(DefaultHandler handler) {
+ try {
+ SAXParserFactory parseFact = SAXParserFactory.newInstance();
+ XMLReader parser = parseFact.newSAXParser().getXMLReader();
+ parser.setFeature("http://xml.org/sax/features/namespaces", true);
+ parser.setFeature("http://xml.org/sax/features/validation", false);
+ parser.setContentHandler(handler);
+ parser
+ .parse(new InputSource(
+ new InputStreamReader(
+ new FileInputStream(
+ parentTask.getProject().getBaseDir()+ "/" + jbossPackages))));
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ }
+ }
+
+ public void execute() throws BuildException {
+ JBossPackagesHandler hndlr = new JBossPackagesHandler(parentTask);
+ parseMe(hndlr);
+ if (parentTask.isOutputAntTargetsOnly()) {
+ parentTask.log("**** No Packages Created -- Ant Targets Only ****", Project.MSG_INFO);
+
+ HashMap<String, StringBuilder> antDefs = hndlr.getArchives();
+ if (parentTask.getProcessArchive() != null) {
+ StringBuilder b = antDefs.get(parentTask.getProcessArchive());
+ if (b != null) {
+ parentTask.log("Archive \"" + parentTask.getProcessArchive() + "\" as a string: \n" + b);
+ } else {
+ String msg = "Archive \""+ parentTask.getProcessArchive() + "\" does not exist in the chosen project.";
+ parentTask.log(msg, Project.MSG_ERR);
+ throw new BuildException(msg);
+ }
+ } else {
+ Collection<StringBuilder> antTasks = antDefs.values();
+ for (StringBuilder b : antTasks) {
+ parentTask.log("\n" + b.toString());
+ }
+ }
+ parentTask.log("**** No Packages Created -- Ant Targets Only ****");
+ } else {
+ HashMap<String, Zip> tasks = hndlr.getTasks();
+ if (parentTask.getProcessArchive() != null) {
+ Zip task = tasks.get(parentTask.getProcessArchive());
+ if (task != null) {
+ parentTask.log("Executing ant task for " + parentTask.getProcessArchive());
+ task.execute();
+ } else {
+ parentTask.log("No Archive found: " + parentTask.getProcessArchive(), Project.MSG_ERR);
+ }
+ } else {
+ parentTask.log("Executing all tasks", Project.MSG_INFO);
+ for (Zip tsk : tasks.values()) {
+ tsk.execute();
+ }
+ }
+ }
+ }
+
+ public class JBossPackagesHandler extends DefaultHandler {
+
+ private final HashMap<String, StringBuilder> antTaskDefs;
+ private final HashMap<String, Zip> tasks;
+ private StringBuilder currArchive;
+ private String folder;
+ private HashMap<String, String> fileset;
+ private Zip currentTask;
+
+ /**
+ * Creates a new JBossPackagesHandler.
+ * @param bossArchiveAntTask
+ */
+ public JBossPackagesHandler(JBossArchivesTask jbossArchiveAntTask) {
+ antTaskDefs = new HashMap<String, StringBuilder>();
+ tasks = new HashMap<String, Zip>();
+ }
+
+ /**
+ * The doFileset method.
+ */
+ private void doFileset(String fldr) {
+ ZipFileSet set = new ZipFileSet();
+ set.setDir(new File(fileset.get("dir")));
+ currArchive.append(" <zipfileset dir='");
+ currArchive.append(fileset.get("xmlDir") + "' ");
+ if (folder != null) {
+ currArchive.append("prefix='" + folder + "' ");
+ set.setPrefix(folder);
+
+ }
+ String includes = fileset.get("includes");
+ String excludes = fileset.get("excludes");
+ if (includes != null) {
+ currArchive.append("includes='" + includes + "' ");
+ set.setIncludes(includes);
+ } else {
+ set.setIncludes("");
+ }
+ if (excludes != null) {
+ currArchive.append("excludes='" + excludes + "' ");
+ set.setExcludes(excludes);
+ } else {
+ set.setExcludes("");
+ }
+
+ currArchive.append("/>\n");
+ currentTask.addFileset(set);
+ fileset = null;
+ }
+
+ /**
+ * {@inheritDoc}.
+ * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
+ */
+ @Override
+ public void endElement(String uri, String localName, String name)
+ throws SAXException {
+ if ("package".equals(localName) && (currArchive != null)) {
+ currArchive.append(" </jar>\n");
+ currArchive.append("</target>\n");
+
+ } else if ("folder".equals(localName)) {
+ if (folder != null) {
+ int slash = folder.lastIndexOf('/');
+ if (slash == -1) {
+ folder = null;
+ } else {
+ folder = folder.substring(0, slash);
+ }
+
+ }
+
+ } else if ("fileset".equals(localName)) {
+ doFileset(folder);
+ }
+ }
+
+ /**
+ * Property getter for archives.
+ * @return Returns the archives.
+ */
+ public HashMap<String, StringBuilder> getArchives() {
+ return antTaskDefs;
+ }
+
+ /**
+ * Property getter for tasks.
+ * @return Returns the tasks.
+ */
+ public HashMap<String, Zip> getTasks() {
+ return tasks;
+ }
+
+ /**
+ * {@inheritDoc}.
+ * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ */
+ @Override
+ public void startElement(String uri, String localName, String name,
+ Attributes attributes) throws SAXException {
+ if ("package".equals(localName)) {
+ String type = attributes.getValue("type");
+ String taskName = attributes.getValue("name");
+ currentTask = createTask(type);
+ tasks.put(taskName, currentTask);
+
+ try {
+ currArchive = new StringBuilder("<target name='");
+
+ antTaskDefs.put(taskName, currArchive);
+
+ String tName = attributes.getValue("name");
+ currArchive.append(tName);
+ currArchive.append("' description='build " + tName + "' >\n");
+ String tmpToDir = attributes.getValue("todir");
+ String toDir =
+ tmpToDir.substring(tmpToDir.lastIndexOf("/") + 1);
+ currArchive.append(" <mkdir dir='" + toDir + "' />\n");
+
+ currArchive.append(" <jar destfile='" + toDir + "/" + tName
+ + "'>\n");
+
+ currentTask.setDestFile(new File(currentTask.getProject()
+ .getBaseDir()
+ + "/" + toDir + "/" + tName));
+ } catch (IllegalArgumentException iae) {
+ currArchive = null;
+ currentTask = null;
+ iae.printStackTrace();
+ }
+ } else if ("folder".equals(localName)) {
+ if (folder == null) {
+ folder = attributes.getValue("name");
+ } else {
+ folder = folder + "/" + attributes.getValue("name");
+ }
+ } else if ("fileset".equals(localName)) {
+ fileset = new HashMap<String, String>();
+ String dir = attributes.getValue("dir").substring(1);
+ String xmlDir = dir.substring(dir.indexOf("/") + 1);
+ String includes = attributes.getValue("includes");
+ String excludes = attributes.getValue("excludes");
+ fileset.put("includes", includes);
+ fileset.put("excludes", excludes);
+ fileset.put("dir", xmlDir);
+ fileset.put("xmlDir", xmlDir);
+ }
+ }
+ }
+}
\ No newline at end of file
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/IsolatedTruezipExecution.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/IsolatedTruezipExecution.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/IsolatedTruezipExecution.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,157 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import java.util.ArrayList;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+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;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveBuildListener;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+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.IArchiveNodeVisitor;
+
+public class IsolatedTruezipExecution {
+ private JBossArchivesTask task;
+ public IsolatedTruezipExecution(JBossArchivesTask task) {
+ this.task = task;
+ }
+ public void execute() {
+ ClassLoader original = Thread.currentThread().getContextClassLoader();
+ IArchiveBuildListener listener = getListener();
+
+ task.log("Executing task using truezip. " + task.getLocation(), Project.MSG_VERBOSE);
+ ResourceModel.getDefault();
+
+ // needed so the correct XML binding / TrueZIP jars are loaded
+ ClassLoader myCL = getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(myCL);
+
+ ((AntVariables)ArchivesCore.getInstance().getVariables()).setCurrentTask(task);
+ // figure out which one to build
+ ArchivesModel.instance().addBuildListener(listener);
+ IPath path = ArchivesCore.getInstance().getVariables().getProjectPath(task.getEclipseProject());
+ if( verifyBuildPrereqs(path) ) {
+ task.log("Building archives for project project: " + path, Project.MSG_VERBOSE);
+ ArchivesModelCore.buildProject(path, null);
+ } else {
+ throw new BuildException("Eclipse-relative paths missing absolute path mappings.");
+ }
+
+ ArchivesModel.instance().removeBuildListener(listener);
+ Thread.currentThread().setContextClassLoader(original);
+ }
+
+
+ protected boolean verifyBuildPrereqs(IPath path) {
+ // get the project's location
+ if( path == null ) {
+ task.log("Could not find a project location for " + task.getEclipseProject(), Project.MSG_ERR);
+ return false;
+ }
+
+ if( ArchivesModel.instance().getRoot(path) == null) {
+ task.log("Registering project: " + path + ". ", Project.MSG_VERBOSE);
+ ArchivesModel.instance().registerProject(path, null);
+ }
+
+ IArchiveModelNode node = ArchivesModel.instance().getRoot(path);
+ final ArrayList requiredProjects = new ArrayList();
+ node.accept(new IArchiveNodeVisitor() {
+ public boolean visit(IArchiveNode node) {
+ if( node.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
+ IArchive archive = (IArchive)node;
+ if( archive.isTopLevel() && archive.isDestinationInWorkspace() ) {
+ IPath p = archive.getDestinationPath();
+ if( p != null ) {
+ String projName = p.segment(0);
+ if( !requiredProjects.contains(projName))
+ requiredProjects.add(projName);
+ }
+ }
+ } else if( node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET) {
+ IArchiveFileSet fs = (IArchiveFileSet)node;
+ if( fs.isInWorkspace() ) {
+ IPath p = fs.getSourcePath();
+ if( p != null ) {
+ String projName = p.segment(0);
+ if(!requiredProjects.contains(projName))
+ requiredProjects.add(projName);
+ }
+ }
+ }
+ return true;
+ }
+ });
+
+ boolean retVal = true;
+ AntVariables vars = ((AntVariables)ArchivesCore.getInstance().getVariables());
+ for( int i = 0; i < requiredProjects.size(); i++ ) {
+ IPath p = vars.getProjectPath((String)requiredProjects.get(i));
+ if( p == null ) {
+ retVal = false;
+ task.log("Required project \"" + requiredProjects.get(i) +
+ "\" has unknown location. " + task.getLocation(), Project.MSG_ERR);
+ }
+ }
+
+ return retVal;
+ }
+
+ protected IArchiveBuildListener getListener() {
+ return new IArchiveBuildListener() {
+
+ public void buildFailed(IArchive pkg, IStatus status) {
+ task.log("buildFailed: ", Project.MSG_DEBUG);
+ }
+
+ public void cleanArchive(IArchive pkg) {
+ task.log("cleanArchive", Project.MSG_DEBUG);
+ }
+
+ public void cleanProject(IPath project) {
+ task.log("cleanProject", Project.MSG_DEBUG);
+ }
+
+ public void fileUpdated(IArchive topLevelArchive,
+ IArchiveFileSet fileset, IPath filePath) {
+ task.log("fileUpdated", Project.MSG_DEBUG);
+ }
+
+ public void finishedBuild(IPath project) {
+ task.log("finishedBuild", Project.MSG_DEBUG);
+ }
+
+ public void finishedBuildingArchive(IArchive pkg) {
+ task.log("finishedBuildingArchive", Project.MSG_DEBUG);
+ }
+
+ public void finishedCollectingFileSet(IArchiveFileSet fileset) {
+ task.log("finishedCollectingFileSet", Project.MSG_DEBUG);
+ }
+
+ public void startedBuild(IPath project) {
+ task.log("startedBuild", Project.MSG_DEBUG);
+ }
+
+ public void startedBuildingArchive(IArchive pkg) {
+ task.log("startedBuildingArchive", Project.MSG_DEBUG);
+ }
+
+ public void startedCollectingFileSet(IArchiveFileSet fileset) {
+ task.log("startedCollectingFileSet", Project.MSG_DEBUG);
+ }
+
+ public void fileRemoved(IArchive topLevelArchive,
+ IArchiveFileSet fileset, IPath filePath) {
+ task.log("fileRemoved: " + filePath, Project.MSG_DEBUG);
+ }
+
+ };
+ }
+}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/JBossArchivesTask.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/JBossArchivesTask.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/JBossArchivesTask.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,99 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.jboss.ide.eclipse.archives.core.ant.ResourceModel.EclipseResource;
+
+public class JBossArchivesTask extends Task {
+ private static boolean linkError = false;
+
+ private boolean antOnly = false;
+ private boolean outputAntTargetsOnly = false;
+ private String processArchive;
+ private String eclipseProject;
+ private String refs;
+
+ public void init() throws BuildException {
+ }
+
+ public void execute() throws BuildException {
+ // parse children and add them to the map
+ ResourceModel.getDefault().setTaskEnvironment(this, resources, refs);
+ Throwable t = null;
+ if( !antOnly && !linkError) {
+ try {
+ executeTrueZip();
+ } catch( LinkageError le ) {
+ t = le;
+ linkError = true;
+ log("Linkage Error using Truezip. Falling back to ant", Project.MSG_WARN);
+ }
+ }
+ if( antOnly || t != null ) {
+ executeAntOnly();
+ }
+ }
+
+
+ ArrayList resources = new ArrayList();
+ public EclipseResource createEclipseResource() {
+ EclipseResource res = new EclipseResource();
+ resources.add(res);
+ return res;
+ }
+
+
+ protected void executeTrueZip() {
+ // isolating to another file to avoid ant errors.
+ new IsolatedTruezipExecution(this).execute();
+ }
+
+ protected void executeAntOnly() {
+ new IsolatedAntExecution(this).execute();
+ }
+
+ public boolean isAntOnly() {
+ return antOnly;
+ }
+
+ public void setAntOnly(boolean antOnly) {
+ this.antOnly = antOnly;
+ }
+
+ public boolean isOutputAntTargetsOnly() {
+ return outputAntTargetsOnly;
+ }
+
+ public void setOutputAntTargetsOnly(boolean outputAntTargetsOnly) {
+ this.outputAntTargetsOnly = outputAntTargetsOnly;
+ }
+
+ public String getProcessArchive() {
+ return processArchive;
+ }
+
+ public void setProcessArchive(String processArchive) {
+ this.processArchive = processArchive;
+ }
+
+ public String getEclipseProject() {
+ return eclipseProject;
+ }
+
+ public void setEclipseProject(String eclipseProject) {
+ this.eclipseProject = eclipseProject;
+ }
+
+ public String getRefs() {
+ return refs;
+ }
+
+ public void setRefs(String environment) {
+ this.refs = environment;
+ }
+}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/ResourceModel.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/ResourceModel.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/ResourceModel.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,238 @@
+package org.jboss.ide.eclipse.archives.core.ant;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Target;
+import org.apache.tools.ant.Task;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+
+public class ResourceModel {
+ private static ResourceModel model;
+ private static ArchivesCore archivesCore = null;
+ public static ResourceModel getDefault() {
+ if( model == null ) {
+ model = new ResourceModel();
+ try {
+ archivesCore = new AntArchivesCore();
+ } catch( LinkageError le ) {
+ // ignore. the archives task will figure it out later
+ }
+ }
+ return model;
+ }
+
+ private HashMap globals, globalGroups;
+ private HashMap projects, projectGroups;
+ private HashMap targets, targetGroups;
+ private HashMap tasks;
+
+ public ResourceModel() {
+ globals = new HashMap();
+ globalGroups = new HashMap();
+ projects = new HashMap();
+ projectGroups = new HashMap();
+ targets = new HashMap();
+ targetGroups = new HashMap();
+ tasks = new HashMap();
+ }
+
+ public void addGlobalReference(String path, String loc, Task task) {
+ if( !globals.containsKey(path)) {
+ globals.put(path, loc);
+ task.log("added global-scoped reference for " + path, Project.MSG_VERBOSE);
+ } else {
+ task.log("eclipse path " + path + " already declared globally. Skipping. " + task.getLocation(), Project.MSG_INFO);
+ }
+ }
+
+ public void addProjectReference(Project project, String path, String loc, Task task) {
+ HashMap map = (HashMap)projects.get(project);
+ if( map == null ) {
+ map = new HashMap();
+ projects.put(project, map);
+ }
+ if( !map.containsKey(path)) {
+ map.put(path, loc);
+ task.log("added project-scoped reference for " + path, Project.MSG_VERBOSE);
+ } else {
+ task.log("eclipse path " + path + " already declared in this project. Skipping. " + task.getLocation(), Project.MSG_INFO);
+ }
+ }
+
+
+ public void addTargetReference(Target target, String path, String loc, Task task) {
+ HashMap map = (HashMap)targets.get(target);
+ if( map == null ) {
+ map = new HashMap();
+ targets.put(target, map);
+ }
+ if( !map.containsKey(path)) {
+ map.put(path, loc);
+ task.log("added target-scoped reference for " + path + ", target=" + target, Project.MSG_VERBOSE);
+ } else {
+ task.log("eclipse path " + path + " already declared in this target. Skipping. " + task.getLocation(), Project.MSG_INFO);
+ }
+ }
+
+ public void addResourceGroup(String id, ArrayList resources, boolean global, Task task) {
+ boolean hasTarget = !(task.getOwningTarget() == null || task.getOwningTarget().getName().equals(""));
+ HashMap map = global ? globalGroups : hasTarget ? targetGroups : projectGroups;
+ String scope = global ? "global" : hasTarget ? "target" : "project";
+ HashMap inner = getInnerResourceMap(task, resources);
+
+ if( global && map.containsKey(id)) {
+ task.log("Cannot add " + id + " with scope " + scope + ". An item with that id has already been added. " + task.getLocation(), Project.MSG_INFO);
+ } else if( global ) {
+ map.put(id, inner);
+ task.log("added " + scope + "-scoped map with id \"" + id + "\" to " + map, Project.MSG_VERBOSE);
+ } else {
+ Object mainKey = hasTarget ? (Object)task.getOwningTarget() : task.getProject();
+ HashMap midMap = (HashMap)map.get(mainKey);
+ if( midMap == null ) {
+ midMap = new HashMap();
+ map.put(mainKey, midMap);
+ }
+ if( midMap.containsKey(id)) {
+ task.log("Cannot add " + id + " with scope " + scope + ". An item with that id has already been added. " + task.getLocation(), Project.MSG_INFO);
+ } else {
+ midMap.put(id, inner);
+ task.log("added " + scope + "-scoped map with id \"" + id + "\" to " + map, Project.MSG_VERBOSE);
+ }
+ }
+ }
+
+ protected HashMap getInnerResourceMap(Task task, ArrayList resources) {
+ HashMap ret = new HashMap();
+ for (Iterator it=resources.iterator(); it.hasNext(); ) {
+ EclipseResource resource = (EclipseResource)it.next();
+ if( resource.getEclipsePath() == null )
+ task.log("eclipsePath is null. skipping " + task.getLocation(), Project.MSG_INFO);
+ else if( resource.getLoc() == null )
+ task.log("loc is null. skipping " + task.getLocation(), Project.MSG_INFO);
+ else {
+ ret.put(resource.getEclipsePath(), resource.getLoc());
+ }
+ }
+ return ret;
+ }
+
+ public void setTaskEnvironment(Task task, ArrayList resources, String refs) {
+ // add the directly added stuff
+ HashMap pathToLoc = new HashMap();
+ for (Iterator it=resources.iterator(); it.hasNext(); ) {
+ EclipseResource resource = (EclipseResource)it.next();
+ if( resource.getEclipsePath() == null ) {
+ task.log("eclipsePath is null. skipping " + task.getLocation(), Project.MSG_INFO);
+ } else if( resource.getLoc() == null ) {
+ task.log("loc is null. skipping " + task.getLocation(), Project.MSG_INFO);
+ } else if( pathToLoc.containsKey(resource.getEclipsePath())){
+ task.log("path " + resource.getEclipsePath() + " already added. Ignoring.", Project.MSG_INFO);
+ pathToLoc.put(resource.getEclipsePath(), resource.getLoc());
+ }
+ }
+
+ // add anything in the current target
+ if( task.getOwningTarget() != null ) {
+ HashMap inner = (HashMap)targets.get(task.getOwningTarget());
+ if( inner != null ) {
+ Iterator i = inner.keySet().iterator();
+ while(i.hasNext()) {
+ String key = (String)i.next();
+ if( !pathToLoc.containsKey(key)) {
+ pathToLoc.put(key, inner.get(key));
+ }
+ }
+ }
+ }
+
+ // add projects
+ if( task.getProject() != null ) {
+ HashMap inner = (HashMap)projects.get(task.getProject());
+ if( inner != null ) {
+ Iterator i = inner.keySet().iterator();
+ while(i.hasNext()) {
+ String key = (String)i.next();
+ if( !pathToLoc.containsKey(key)) {
+ pathToLoc.put(key, inner.get(key));
+ }
+ }
+ }
+ }
+
+ // add globals
+ Iterator i = globals.keySet().iterator();
+ while(i.hasNext()) {
+ String key = (String)i.next();
+ if( !pathToLoc.containsKey(key)) {
+ pathToLoc.put(key, globals.get(key));
+ }
+ }
+
+ // add referenced groups
+ if( refs != null ) {
+ String[] refIDs = refs.split(",");
+ for( int j = 0; j < refIDs.length; j++ ) {
+ HashMap tmp = getGroup(task, refIDs[j]);
+ i = tmp.keySet().iterator();
+ while(i.hasNext()) {
+ String key = (String)i.next();
+ if( pathToLoc.containsKey(key))
+ task.log("Path " + key + " already included. Overriding. " + task.getLocation(), Project.MSG_INFO);
+ pathToLoc.put(key, tmp.get(key));
+ }
+ }
+ }
+ tasks.put(task, pathToLoc);
+ }
+
+ protected HashMap getGroup(Task task, String id) {
+ if( id.equals("")) return new HashMap();
+ if( task.getOwningTarget() != null ) {
+ Target t = task.getOwningTarget();
+ HashMap group = (HashMap)targetGroups.get(t);
+ if( group != null && group.containsKey(id))
+ return (HashMap)group.get(id);
+ }
+
+ if( task.getProject() != null ) {
+ Project p = task.getProject();
+ HashMap group = (HashMap)projectGroups.get(p);
+ if( group != null && group.containsKey(id))
+ return (HashMap)group.get(id);
+ }
+
+ if( globalGroups.containsKey(id) && globalGroups.get(id) != null)
+ return (HashMap)globalGroups.get(id);
+ task.log("Group refid " + id + " not found. " + task.getLocation(), Project.MSG_INFO);
+ return new HashMap();
+ }
+
+ public HashMap getTaskEnvironment(Task t) {
+ HashMap map = (HashMap)tasks.get(t);
+ if( map == null ) return new HashMap();
+ return (HashMap)(map.clone());
+ }
+
+
+ public static class EclipseResource {
+ private String eclipsePath;
+ private String loc;
+ public String getEclipsePath() {
+ return eclipsePath;
+ }
+ public void setEclipsePath(String eclipsePath) {
+ this.eclipsePath = eclipsePath;
+ }
+ public String getLoc() {
+ return loc;
+ }
+ public void setLoc(String loc) {
+ this.loc = loc;
+ }
+ }
+
+
+}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/antlib.xml
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/antlib.xml (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/antlib.xml 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,3 @@
+<antlib>
+ <taskdef resource="org/jboss/ide/eclipse/archives/core/ant/tasks.properties"/>
+</antlib>
\ No newline at end of file
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/tasks.properties
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/tasks.properties (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/tasks.properties 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,3 @@
+eclipseResource=org.jboss.ide.eclipse.archives.core.ant.EclipseResourceTask
+eclipseResourceGroup=org.jboss.ide.eclipse.archives.core.ant.EclipseResourceGroupTask
+jbossArchives=org.jboss.ide.eclipse.archives.core.ant.JBossArchivesTask
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/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 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -6,11 +6,11 @@
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.IArchiveModelListener;
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.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;
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 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -46,8 +46,6 @@
import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackage;
import org.jboss.ide.eclipse.archives.core.model.internal.xb.XbPackageNode;
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;
/**
* The root model which keeps track of registered projects
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveBuildListener.java (from rev 5678, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveBuildListener.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveBuildListener.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveBuildListener.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.archives.core.model;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+
+/**
+ * This interface is inteded to be implemented by classes who are
+ * interested in receiving callbacks for various IArchive build events
+ *
+ * @author Marshall
+ */
+public interface IArchiveBuildListener {
+
+
+ /**
+ * A project has started being built by the Archives builder
+ * @param project the project being built
+ */
+ public void startedBuild (IPath project);
+
+ /**
+ * A project is finished being built by the Archives builder
+ * @param project the project being built
+ */
+ public void finishedBuild (IPath project);
+
+ /**
+ * The project is going to be rebuilt from scratch and all state should be discarded
+ * @param project
+ */
+ public void cleanProject(IPath project);
+
+ /**
+ * An Archive has started being built by the Archives builder
+ * This can be called from a full build, or from the incremental build
+ * if and only if one of the affected files matches a fileset in this archive.
+ *
+ * @param pkg the Archive being built
+ */
+ public void startedBuildingArchive (IArchive pkg);
+
+ /**
+ * An Archive is finished being built by the Archives builder
+ * This can be called from a full build, or from the incremental build
+ * if and only if one of the affected files matches a fileset in this archive.
+ *
+ * @param pkg the Archive being built
+ */
+ public void finishedBuildingArchive (IArchive pkg);
+
+ /**
+ * The archive is going to be rebuilt from scratch and all state should be discarded
+ * @param pkg
+ */
+ public void cleanArchive(IArchive pkg);
+
+
+ /**
+ * A fileset has started being collected for copying into a Archive
+ * This is *only* used during a FULL BUILD or after a MODEL CHANGE
+ * @param fileset the fileset being collected
+ */
+ public void startedCollectingFileSet (IArchiveFileSet fileset);
+
+ /**
+ * A fileset has finished being collected for copying into a Archive
+ * This is *only* used during a FULL BUILD or after a MODEL CHANGE
+ * @param fileset the fileset being collected
+ */
+ public void finishedCollectingFileSet (IArchiveFileSet fileset);
+
+ /**
+ * The build for the given project has failed
+ * @param pkg The Archive that failed to build
+ * @param status The status/exception that occurred
+ */
+ public void buildFailed (IArchive pkg, IStatus status);
+
+ /**
+ * A file has been updated, with the given IArchive / IArchiveFileSet context
+ * @param topLevelArchive The top level Archive that was updated
+ * @param fileset The fileset that matched the updated file
+ * @param filePath The path to the file that was copied (filesystem/workspace path)
+ */
+ public void fileUpdated (IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath);
+
+ /**
+ * A file has been removed, with the given IArchive / IArchiveFileSet context
+ * @param topLevelArchive The top level Archive that was updated
+ * @param fileset The fileset that matched the removed file
+ * @param filePath The path to the file that was removed (filesystem/workspace path)
+ */
+ public void fileRemoved (IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath);
+
+}
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModelListener.java (from rev 5678, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveModelListener.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModelListener.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModelListener.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.archives.core.model;
+
+
+/**
+ * Interface for model changes.
+ * @author <a href="rob.stryker(a)redhat.com">Rob Stryker</a>
+ */
+public interface IArchiveModelListener {
+ public void modelChanged(IArchiveNodeDelta delta);
+}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModelListenerManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModelListenerManager.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IArchiveModelListenerManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,7 +1,5 @@
package org.jboss.ide.eclipse.archives.core.model;
-import org.jboss.ide.eclipse.archives.core.model.other.IArchiveBuildListener;
-import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
/**
* Manages Archive Model Listeners, build and model changes, for changes
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IExtensionManager.java (from rev 5678, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IExtensionManager.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IExtensionManager.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IExtensionManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,8 @@
+package org.jboss.ide.eclipse.archives.core.model;
+
+
+
+public interface IExtensionManager {
+ public IArchiveType[] getArchiveTypes();
+ public IArchiveType getArchiveType(String id);
+}
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IPreferenceManager.java (from rev 5678, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IPreferenceManager.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IPreferenceManager.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IPreferenceManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,10 @@
+package org.jboss.ide.eclipse.archives.core.model;
+
+import org.eclipse.core.runtime.IPath;
+
+public interface IPreferenceManager {
+ public boolean isBuilderEnabled(IPath path);
+ public void setBuilderEnabled(IPath path, boolean val);
+ public boolean areProjectSpecificPrefsEnabled(IPath path);
+ public void setProjectSpecificPrefsEnabled(IPath path, boolean val);
+}
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IRuntimeVariables.java (from rev 5678, trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IRuntimeVariables.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IRuntimeVariables.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/IRuntimeVariables.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -0,0 +1,24 @@
+package org.jboss.ide.eclipse.archives.core.model;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+
+public interface IRuntimeVariables {
+ /**
+ * Is the debugging option provided enabled?
+ * If the option is null, is debugging enabled at all?
+ * @param option
+ * @return
+ */
+ public boolean isDebugging(String option);
+ public IPath getProjectPath(String projectName);
+ public String getProjectName(IPath path);
+ public URL getBindingSchema();
+ public URL getBindingLog4j();
+
+ // allow for variable replacement
+ public String performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException;
+
+}
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 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/events/EventManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -25,12 +25,12 @@
import org.eclipse.core.runtime.IStatus;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveBuildListener;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModelListener;
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.IArchiveNodeDelta;
-import org.jboss.ide.eclipse.archives.core.model.other.IArchiveBuildListener;
-import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
/**
* The event manager to fire events
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveBuildListener.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveBuildListener.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveBuildListener.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,118 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.archives.core.model.other;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
-
-/**
- * This interface is inteded to be implemented by classes who are
- * interested in receiving callbacks for various IArchive build events
- *
- * @author Marshall
- */
-public interface IArchiveBuildListener {
-
-
- /**
- * A project has started being built by the Archives builder
- * @param project the project being built
- */
- public void startedBuild (IPath project);
-
- /**
- * A project is finished being built by the Archives builder
- * @param project the project being built
- */
- public void finishedBuild (IPath project);
-
- /**
- * The project is going to be rebuilt from scratch and all state should be discarded
- * @param project
- */
- public void cleanProject(IPath project);
-
- /**
- * An Archive has started being built by the Archives builder
- * This can be called from a full build, or from the incremental build
- * if and only if one of the affected files matches a fileset in this archive.
- *
- * @param pkg the Archive being built
- */
- public void startedBuildingArchive (IArchive pkg);
-
- /**
- * An Archive is finished being built by the Archives builder
- * This can be called from a full build, or from the incremental build
- * if and only if one of the affected files matches a fileset in this archive.
- *
- * @param pkg the Archive being built
- */
- public void finishedBuildingArchive (IArchive pkg);
-
- /**
- * The archive is going to be rebuilt from scratch and all state should be discarded
- * @param pkg
- */
- public void cleanArchive(IArchive pkg);
-
-
- /**
- * A fileset has started being collected for copying into a Archive
- * This is *only* used during a FULL BUILD or after a MODEL CHANGE
- * @param fileset the fileset being collected
- */
- public void startedCollectingFileSet (IArchiveFileSet fileset);
-
- /**
- * A fileset has finished being collected for copying into a Archive
- * This is *only* used during a FULL BUILD or after a MODEL CHANGE
- * @param fileset the fileset being collected
- */
- public void finishedCollectingFileSet (IArchiveFileSet fileset);
-
- /**
- * The build for the given project has failed
- * @param pkg The Archive that failed to build
- * @param status The status/exception that occurred
- */
- public void buildFailed (IArchive pkg, IStatus status);
-
- /**
- * A file has been updated, with the given IArchive / IArchiveFileSet context
- * @param topLevelArchive The top level Archive that was updated
- * @param fileset The fileset that matched the updated file
- * @param filePath The path to the file that was copied (filesystem/workspace path)
- */
- public void fileUpdated (IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath);
-
- /**
- * A file has been removed, with the given IArchive / IArchiveFileSet context
- * @param topLevelArchive The top level Archive that was updated
- * @param fileset The fileset that matched the removed file
- * @param filePath The path to the file that was removed (filesystem/workspace path)
- */
- public void fileRemoved (IArchive topLevelArchive, IArchiveFileSet fileset, IPath filePath);
-
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveModelListener.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveModelListener.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IArchiveModelListener.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,32 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.archives.core.model.other;
-
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
-
-/**
- * Interface for model changes.
- * @author <a href="rob.stryker(a)redhat.com">Rob Stryker</a>
- */
-public interface IArchiveModelListener {
- public void modelChanged(IArchiveNodeDelta delta);
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IExtensionManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IExtensionManager.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IExtensionManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,9 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.model.other;
-
-import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
-
-
-public interface IExtensionManager {
- public IArchiveType[] getArchiveTypes();
- public IArchiveType getArchiveType(String id);
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IPreferenceManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IPreferenceManager.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IPreferenceManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,10 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.model.other;
-
-import org.eclipse.core.runtime.IPath;
-
-public interface IPreferenceManager {
- public boolean isBuilderEnabled(IPath path);
- public void setBuilderEnabled(IPath path, boolean val);
- public boolean areProjectSpecificPrefsEnabled(IPath path);
- public void setProjectSpecificPrefsEnabled(IPath path, boolean val);
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IRuntimeVariables.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IRuntimeVariables.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/IRuntimeVariables.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,24 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.model.other;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-
-public interface IRuntimeVariables {
- /**
- * Is the debugging option provided enabled?
- * If the option is null, is debugging enabled at all?
- * @param option
- * @return
- */
- public boolean isDebugging(String option);
- public IPath getProjectPath(String projectName);
- public String getProjectName(IPath path);
- public URL getBindingSchema();
- public URL getBindingLog4j();
-
- // allow for variable replacement
- public String performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException;
-
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandaloneExtensionManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandaloneExtensionManager.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandaloneExtensionManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,35 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.model.other.internal;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
-import org.jboss.ide.eclipse.archives.core.model.other.IExtensionManager;
-
-public class StandaloneExtensionManager implements IExtensionManager {
-
- public IArchiveType getArchiveType(String id) {
- final String typeId = id;
-
- return new IArchiveType () {
- public String getId() {
- return typeId;
- }
- public String getLabel() {
- return typeId;
- }
- public IArchive createDefaultConfiguration(String projectName, IProgressMonitor monitor) {
- // TODO Auto-generated method stub
- return null;
- }
- public IArchive fillDefaultConfiguration(String projectName, IArchive topLevel, IProgressMonitor monitor) {
- // TODO Auto-generated method stub
- return null;
- }
- };
- }
-
- public IArchiveType[] getArchiveTypes() {
- return new IArchiveType[0];
- }
-
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandalonePreferenceManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandalonePreferenceManager.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandalonePreferenceManager.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,28 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.model.other.internal;
-
-import org.eclipse.core.runtime.IPath;
-import org.jboss.ide.eclipse.archives.core.model.other.IPreferenceManager;
-
-public class StandalonePreferenceManager implements IPreferenceManager {
-
- public boolean areProjectSpecificPrefsEnabled(IPath path) {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean isBuilderEnabled(IPath path) {
- // TODO Auto-generated method stub
- return false;
- }
-
- public void setBuilderEnabled(IPath path, boolean val) {
- // TODO Auto-generated method stub
-
- }
-
- public void setProjectSpecificPrefsEnabled(IPath path, boolean val) {
- // TODO Auto-generated method stub
-
- }
-
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandaloneVariables.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandaloneVariables.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/other/internal/StandaloneVariables.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -1,57 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.model.other.internal;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.jboss.ide.eclipse.archives.core.model.other.IRuntimeVariables;
-import org.jboss.ide.eclipse.archives.core.xpl.StringSubstitutionEngineClone;
-
-public class StandaloneVariables implements IRuntimeVariables {
-
- public URL getBindingLog4j() {
- return getClass().getClassLoader().getResource("log4j.xml");
- }
-
- public URL getBindingSchema() {
- return getClass().getClassLoader().getResource("packages.xsd");
- }
-
- public IPath getProjectPath(String projectName) {
- projectName = projectName.replace(' ', '_');
-
- String projectPath = System.getProperty(projectName + ".dir");
- if (projectPath != null)
- return new Path(projectPath);
-
- return null;
- }
-
- public boolean isDebugging(String option) {
- return System.getProperty("archives.debug", "true")
- .equals("true");
- }
-
- public String getProjectName(IPath path) {
- Properties props = System.getProperties();
- Object key, val;
- for( Iterator i = props.keySet().iterator(); i.hasNext(); ) {
- key = i.next();
- if( key instanceof String && ((String)key).endsWith(".dir")) {
- val = props.get(key);
- if( path.toOSString().equals(new Path((String)val).toOSString()))
- return (String)key;
- }
- }
- return null;
- }
-
- public String performStringSubstitution(String expression,
- boolean reportUndefinedVariables) throws CoreException {
- return new StringSubstitutionEngineClone().performStringSubstitution(expression, reportUndefinedVariables);
- }
-
-}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -275,7 +275,7 @@
// }
// // error - an argument specified for a value variable
// throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{valueVariable.getName()}), null));
- return "";
+ return "tobecompleted";
}
private String getOriginalVarText(VariableReference var) {
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -17,7 +17,7 @@
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.dialogs.PropertyPage;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.model.other.IPreferenceManager;
+import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
import org.jboss.ide.eclipse.archives.ui.views.ProjectArchivesView;
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java 2008-02-07 22:17:07 UTC (rev 6188)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java 2008-02-07 22:33:08 UTC (rev 6189)
@@ -36,10 +36,10 @@
import org.eclipse.ui.part.ViewPart;
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.IArchiveModelListener;
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.IArchiveNodeDelta;
-import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.ExtensionManager;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
16 years, 4 months
JBoss Tools SVN: r6188 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/packages.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-07 17:17:07 -0500 (Thu, 07 Feb 2008)
New Revision: 6188
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/packages/NewSARAction.java
Log:
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/packages/NewSARAction.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/packages/NewSARAction.java 2008-02-07 22:16:38 UTC (rev 6187)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/packages/NewSARAction.java 2008-02-07 22:17:07 UTC (rev 6188)
@@ -1,8 +1,7 @@
package org.jboss.ide.eclipse.as.ui.mbeans.packages;
-import org.jboss.ide.eclipse.ui.util.ActionWithDelegate;
-public class NewSARAction extends ActionWithDelegate {
+public class NewSARAction { //extends ActionWithDelegate {
public NewSARAction() {
// TODO Auto-generated constructor stub
16 years, 4 months
JBoss Tools SVN: r6187 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-02-07 17:16:38 -0500 (Thu, 07 Feb 2008)
New Revision: 6187
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/META-INF/MANIFEST.MF
Log:
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/META-INF/MANIFEST.MF 2008-02-07 20:04:51 UTC (rev 6186)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/META-INF/MANIFEST.MF 2008-02-07 22:16:38 UTC (rev 6187)
@@ -21,8 +21,7 @@
org.eclipse.jdt.ui,
org.eclipse.ui.ide,
org.eclipse.core.filesystem,
- org.jboss.ide.eclipse.as.ui,
- org.jboss.ide.eclipse.ui
+ org.jboss.ide.eclipse.as.ui
Eclipse-LazyStart: true
Export-Package: org.jboss.ide.eclipse.as.ui.mbeans.editors.proposals
Bundle-Vendor: JBoss, a division of Red Hat
16 years, 4 months
JBoss Tools SVN: r6186 - branches/jbosstools-2.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-02-07 15:04:51 -0500 (Thu, 07 Feb 2008)
New Revision: 6186
Modified:
branches/jbosstools-2.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1759 Empty CA if there is no space between inverted commas in atribute value.
Issue is fixed
JUnit TestCase will follow
Modified: branches/jbosstools-2.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java
===================================================================
--- branches/jbosstools-2.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java 2008-02-07 17:37:41 UTC (rev 6185)
+++ branches/jbosstools-2.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java 2008-02-07 20:04:51 UTC (rev 6186)
@@ -708,9 +708,11 @@
String text = contentAssistRequest.getText();
String matchString = contentAssistRequest.getMatchString();
- if (matchString.length() > StringUtils.strip(text).length() &&
- ( (matchString.startsWith("\"") && matchString.endsWith("\""))
- || (matchString.startsWith("'") && matchString.endsWith("\"")))) {
+ if (matchString.length() > StringUtils.strip(text).length() &&
+ ( (matchString.startsWith("\"") && matchString.endsWith("\"") &&
+ (matchString.indexOf("\"") != matchString.lastIndexOf("\"")))
+ || (matchString.startsWith("'") && matchString.endsWith("\"") &&
+ (matchString.indexOf("\"") != matchString.lastIndexOf("\""))))) {
return;
}
16 years, 4 months
JBoss Tools SVN: r6185 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-02-07 12:37:41 -0500 (Thu, 07 Feb 2008)
New Revision: 6185
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PaletteDropCommand.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-788
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PaletteDropCommand.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PaletteDropCommand.java 2008-02-07 17:37:33 UTC (rev 6184)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PaletteDropCommand.java 2008-02-07 17:37:41 UTC (rev 6185)
@@ -133,10 +133,7 @@
properties.setProperty("isDrop", "true");
properties.setProperty("actionSourceGUIComponentID", "editor");
properties.setProperty("accepsAsString", "true");
- //TODO Max Areshkau JBIDE-788
-// if(getDefaultModel().getDropData().getPageContext() != null) {
-// properties.put("taglibs", getDefaultModel().getDropData().getPageContext());
-// }
+
if(f != null) {
properties.put("file", f);
}
16 years, 4 months
JBoss Tools SVN: r6184 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-02-07 12:37:33 -0500 (Thu, 07 Feb 2008)
New Revision: 6184
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-788
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java 2008-02-07 17:37:29 UTC (rev 6183)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java 2008-02-07 17:37:33 UTC (rev 6184)
@@ -88,8 +88,7 @@
}
el = (Element) tempNode;
if (el.getLocalName().equals(FACET_DEFINITION)
- //TODO Max Areshkau JBIDE-788 Deal with it
-// && pageContext.getSourceTaglibUri(el).equals(FACET_URI)
+ &&(FACET_URI.equals(pageContext.getSourceTaglibUri(el)))
&& el.getAttribute(FACET_NAME_ATTR) != null
&& el.getAttribute(FACET_NAME_ATTR).equals(
FACET_NAME_ATTR_VALUE)) {
16 years, 4 months
JBoss Tools SVN: r6183 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: context and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-02-07 12:37:29 -0500 (Thu, 07 Feb 2008)
New Revision: 6183
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-788
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-02-07 17:20:30 UTC (rev 6182)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-02-07 17:37:29 UTC (rev 6183)
@@ -472,14 +472,11 @@
}
break;
}
+ //TODO Max Areshkau JBIDE-1457
if (visualBuilder.rebuildFlag) {
// pageContext.fireTaglibsChanged();
}
- //TODO Max Areshkau JBIDE-788
-// else if (pageContext.isTaglibChanged()) {
-// visualRefreshImpl();
-//// pageContext.fireTaglibsChanged();
-// }
+
switcher.stopActiveEditor();
}
@@ -995,20 +992,19 @@
VpeElementMapping elementMapping = (VpeElementMapping)domMapping.getNodeMapping(node);
if (elementMapping != null && elementMapping.getTemplate() != null && elementMapping.getTemplate().getType() == VpeHtmlTemplate.TYPE_ANY) {
final VpeTemplate selectedTemplate = elementMapping.getTemplate();
- //TODO Max Areshkau JBIDE-788 Fix That
-// manager.add(new VpeAction("Template", node) { //$NON-NLS-1$
-// public void run() {
-// boolean isCorrectNS = pageContext.isCorrectNS(actionNode);
-// VpeAnyData data = null;
-// if (isCorrectNS) {
-// data = selectedTemplate.getAnyData();
-// data.setUri(pageContext.getSourceTaglibUri(actionNode));
-// data.setName(actionNode.getNodeName());
-// }
-// data = editAnyData(sourceEditor, isCorrectNS, data);
-// if (data != null && data.isChanged()) templateManager.setAnyTemplate(data);
-// }
-// });
+ manager.add(new VpeAction("Template", node) { //$NON-NLS-1$
+ public void run() {
+ boolean isCorrectNS = pageContext.isCorrectNS(actionNode);
+ VpeAnyData data = null;
+ if (isCorrectNS) {
+ data = selectedTemplate.getAnyData();
+ data.setUri(pageContext.getSourceTaglibUri(actionNode));
+ data.setName(actionNode.getNodeName());
+ }
+ data = editAnyData(sourceEditor, isCorrectNS, data);
+ if (data != null && data.isChanged()) templateManager.setAnyTemplate(data);
+ }
+ });
manager.add(new Separator());
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-02-07 17:20:30 UTC (rev 6182)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-02-07 17:37:29 UTC (rev 6183)
@@ -113,6 +113,7 @@
private VpeDnD dnd;
private nsIDOMNode headNode;
private List includeStack;
+ //TODO Max Areshkau JBIDE-1457
boolean rebuildFlag = false;
/** faceletFile */
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-02-07 17:20:30 UTC (rev 6182)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-02-07 17:37:29 UTC (rev 6183)
@@ -16,10 +16,14 @@
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
@@ -41,6 +45,7 @@
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.util.FileUtil;
+import org.jboss.tools.vpe.editor.util.XmlUtil;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -139,34 +144,57 @@
}
}
-// public boolean isCorrectNS(Node sourceNode) {
-// String sourcePrefix = sourceNode.getPrefix();
-// if (sourcePrefix == null || ((ElementImpl)sourceNode).isJSPTag()) {
-// return true;
-// }
-// for (int i = 0; i < taglibs.size(); i++) {
-// TaglibData taglib = (TaglibData)taglibs.get(i);
-// if (sourcePrefix.equals(taglib.getPrefix())) {
-// return true;
-// }
-// }
-// return false;
-// }
+ /**
+ * Checks for URI for source node was registred on page
+ * @param sourceNode
+ * @return true - if uri was registred
+ * false- if uri doesn't was registered
+ */
+ public boolean isCorrectNS(Node sourceNode) {
+ String sourcePrefix = sourceNode.getPrefix();
+
+ if (sourcePrefix == null || ((ElementImpl)sourceNode).isJSPTag()) {
+ return true;
+ }
+ List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(sourceNode,this.getSourceBuilder().getStructuredTextViewer().getDocument());
+
+ TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(sourcePrefix, taglibs);
+
+ if(sourceNodeTaglib!=null) {
+
+ return true;
+ }
+ return false;
+ }
+ /**
+ * Returns
+ * @param sourceNode
+ * @return
+ */
-// public String getSourceTaglibUri(Node sourceNode) {
-// String sourcePrefix = sourceNode.getPrefix();
-// if (sourcePrefix == null || ((ElementImpl)sourceNode).isJSPTag()) {
-// return null;
-// }
-// for (int i = 0; i < taglibs.size(); i++) {
-// TaglibData taglib = (TaglibData)taglibs.get(i);
-// if (sourcePrefix.equals(taglib.getPrefix())) {
-// return taglib.getUri();
-// }
-// }
-// return null;
-// }
+ public String getSourceTaglibUri(Node sourceNode) {
+
+ String sourcePrefix = sourceNode.getPrefix();
+ if (sourcePrefix == null || ((ElementImpl) sourceNode).isJSPTag()) {
+ return null;
+ }
+ List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(sourceNode,
+ this.getSourceBuilder()
+ .getStructuredTextViewer().getDocument());
+
+ TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(sourcePrefix,
+ taglibs);
+
+ if (sourceNodeTaglib == null) {
+
+ return null;
+ }
+ String sourceNodeUri = sourceNodeTaglib.getUri();
+
+ return sourceNodeUri;
+ }
+
public VpeEditorPart getEditPart() {
return editPart;
}
@@ -315,9 +343,9 @@
}
- public List<TaglibData> getTagLibs() {
- // TODO Auto-generated method stub
- return null;
+ public List<TaglibData> getTagLibs(Node sourceNode) {
+
+ return XmlUtil.getTaglibsForNode(sourceNode, this.getSourceBuilder().getStructuredTextViewer().getDocument());
}
public void removeTaglibListener(VpeTaglibListener listener) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2008-02-07 17:20:30 UTC (rev 6182)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2008-02-07 17:37:29 UTC (rev 6183)
@@ -311,14 +311,14 @@
private String getPageLocale(VpePageContext pageContext, IDOMElement sourceElement) {
IStructuredModel model = null;
try {
- //TODO JBIDE-788 Max Areshkau Fix That
-// List<TaglibData> taglibs = pageContext.getTagLibs();
+
+ List<TaglibData> taglibs = pageContext.getTagLibs(sourceElement);
// Find F tracker
TaglibData fTD = null;
-// for (int i = 0; i < taglibs.size(); i++) {
-// TaglibData td = (TaglibData)taglibs.get(i);
-// if ("http://java.sun.com/jsf/core".equals(td.getUri())) fTD = td;
-// }
+ for (int i = 0; i < taglibs.size(); i++) {
+ TaglibData td = (TaglibData)taglibs.get(i);
+ if ("http://java.sun.com/jsf/core".equals(td.getUri())) fTD = td;
+ }
if (fTD == null || fTD.getPrefix() == null || fTD.getPrefix().length() == 0) return null;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-02-07 17:20:30 UTC (rev 6182)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-02-07 17:37:29 UTC (rev 6183)
@@ -236,26 +236,7 @@
return sourceNode.getNodeName();
}
- TLDCMDocumentManager tldcmDocumentManager= TaglibController.getTLDCMDocumentManager(pageContext.getSourceBuilder().getStructuredTextViewer().getDocument());
-
- //we are editing jsp page added by Max Areshkau JBIDE-788
- if(tldcmDocumentManager!=null) {
- List<TaglibTracker> taglibs_JSP = tldcmDocumentManager.getTaglibTrackers();
- for (TaglibTracker taglibTracker : taglibs_JSP) {
- if(sourcePrefix.equals(taglibTracker.getPrefix())) {
- String sourceNodeUri = taglibTracker.getURI();
- String templatePrefix = getTemplateTaglibPrefix(sourceNodeUri);
- if(templatePrefix != null) {
- return templatePrefix+":"+sourceNode.getLocalName();
- } else {
- return null;
- }
- }
- }
- }
-
-
- List<TaglibData> taglibs = XmlUtil.processNode(sourceNode);
+ List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(sourceNode,pageContext.getSourceBuilder().getStructuredTextViewer().getDocument());
TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(sourcePrefix, taglibs);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2008-02-07 17:20:30 UTC (rev 6182)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2008-02-07 17:37:29 UTC (rev 6183)
@@ -13,10 +13,13 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.List;
-
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
+import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.vpe.VpePlugin;
import org.w3c.dom.Attr;
@@ -66,11 +69,11 @@
/**
* Returns List of taglibs which are available for current node.
- *
+ * should be used only for xml documents
* @param node
* @return
*/
- public static List<TaglibData> processNode(Node node) {
+ private static List<TaglibData> getTaglibsForNode(Node node) {
List<TaglibData> taglibs = new ArrayList<TaglibData>();
@@ -85,7 +88,7 @@
if (null != attribList) {
for (int i = 0; i < attribList.getLength(); i++) {
Node tmp = attribList.item(i);
- processAttribute(taglibs,(Attr)tmp, false);
+ processAttribute(taglibs,(Attr)tmp);
}
}
currentNode = currentNode.getParentNode();
@@ -94,13 +97,41 @@
return taglibs;
}
+
/**
+ * Calculates list of taglibs for current node adn document
+ * we use document only if we works with jsp pages
+ * otherwise we works with node
+ * @param source
+ * @param document
+ * @return collection of taglibs
+ */
+ public static List<TaglibData> getTaglibsForNode(Node source,IDocument document) {
+
+ List<TaglibData> taglibData = new ArrayList<TaglibData>();
+
+ TLDCMDocumentManager tldcmDocumentManager= TaglibController.getTLDCMDocumentManager(document);
+ if(tldcmDocumentManager!=null) {
+ List<TaglibTracker> taglibs_JSP = tldcmDocumentManager.getTaglibTrackers();
+ for (TaglibTracker taglibTracker : taglibs_JSP) {
+ addTaglib(taglibData, taglibTracker.getURI(), taglibTracker.getPrefix(), true);
+ }
+ }
+
+ if(taglibData.size()==0) {
+
+ taglibData = getTaglibsForNode(source);
+ }
+
+ return taglibData;
+ }
+ /**
* Processes taglib attribute
* @param taglibs
* @param attr
* @param bScopePrefix
*/
- private static void processAttribute(List<TaglibData> taglibs, Attr attr, boolean bScopePrefix) {
+ private static void processAttribute(List<TaglibData> taglibs, Attr attr) {
String startStr = "xmlns:";
String name = attr.getName();
@@ -108,7 +139,7 @@
return;
}
name = name.substring(startStr.length());
- addTaglib(taglibs , attr.getValue(), name, true, bScopePrefix);
+ addTaglib(taglibs , attr.getValue(), name, true);
return;
}
@@ -120,11 +151,11 @@
* @param ns
* @param bScopePrefix
*/
- private static void addTaglib(List<TaglibData> taglibs, String newUri, String newPrefix, boolean ns, boolean bScopePrefix) {
+ private static void addTaglib(List<TaglibData> taglibs, String newUri, String newPrefix, boolean ns) {
boolean bHasSame = false;
for (int i = 0; i < taglibs.size(); i++) {
TaglibData taglib = (TaglibData)taglibs.get(i);
- if (bScopePrefix && newPrefix.equals(taglib.getPrefix())) {
+ if (newPrefix.equals(taglib.getPrefix())) {
return;
}
if (newUri.equals(taglib.getUri()) && newPrefix.equals(taglib.getPrefix()) && ns == taglib.isNs()) {
@@ -150,8 +181,7 @@
if(data.getPrefix()!=null && data.getPrefix().equalsIgnoreCase(prefix)) {
return data;
}
- }
-
+ }
return null;
- }
+ }
}
16 years, 4 months