Author: rob.stryker(a)jboss.com
Date: 2007-05-24 17:08:58 -0400 (Thu, 24 May 2007)
New Revision: 2070
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java
Log:
added some missing events
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 2007-05-23
23:15:17 UTC (rev 2069)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ModelChangeListener.java 2007-05-24
21:08:58 UTC (rev 2070)
@@ -56,12 +56,14 @@
* @param delta
*/
private void handle(IArchiveNodeDelta delta) {
+ if( isTopLevelArchive(delta.getPostNode()))
+ EventManager.startedBuildingArchive((IArchive)delta.getPostNode());
+
+
if( (delta.getKind() & IArchiveNodeDelta.REMOVED) != 0 ) {
nodeRemoved(delta.getPreNode());
- return;
} else if( (delta.getKind() & IArchiveNodeDelta.ADDED) != 0 ) {
nodeAdded(delta.getPostNode());
- return;
} else if( (delta.getKind() & IArchiveNodeDelta.ATTRIBUTE_CHANGED) != 0) {
boolean shouldHandleChildren = handleAttributeChange(delta);
if( shouldHandleChildren ) {
@@ -76,13 +78,21 @@
handle(children[i]);
}
}
+
+ if( isTopLevelArchive(delta.getPostNode()))
+ EventManager.finishedBuildingArchive((IArchive)delta.getPostNode());
+
}
protected boolean descendentChanged(int kind) {
return (kind & IArchiveNodeDelta.DESCENDENT_CHANGED) != 0 ||
(kind & IArchiveNodeDelta.CHILD_ADDED) != 0 ||
(kind & IArchiveNodeDelta.CHILD_REMOVED) != 0;
}
-
+ protected boolean isTopLevelArchive(IArchiveNode node) {
+ if( node != null && node instanceof IArchive &&
((IArchive)node).isTopLevel())
+ return true;
+ return false;
+ }
/**
* Handle changes in this node
* @param delta
@@ -100,6 +110,10 @@
return false;
}
+
+ /*
+ * These three methods will need to be optimized eventually. Because right now they
suck
+ */
private boolean handleFolderAttributeChanged(IArchiveNodeDelta delta) {
nodeRemoved(delta.getPreNode());
nodeAdded(delta.getPostNode());
Show replies by date