Author: rob.stryker(a)jboss.com
Date: 2007-10-29 12:53:51 -0400 (Mon, 29 Oct 2007)
New Revision: 4562
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java
Log:
Archives node error introduced in view. Fixed.
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 2007-10-29
16:52:07 UTC (rev 4561)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesView.java 2007-10-29
16:53:51 UTC (rev 4562)
@@ -311,10 +311,26 @@
public void run () {
for( int i = 0; i < topChanges.length; i++ ) {
if( topChanges.length == 1 && topChanges[0] instanceof IArchiveModelNode) {
- packageViewer.setInput(ArchivesModel.instance().getRoot(project.getLocation()));
+ // we have a changed IArchiveModelNode. Something's different
+ IArchiveModelNode inputModel = (IArchiveModelNode) packageViewer.getInput();
+ IArchiveModelNode newModel = (IArchiveModelNode)topChanges[0];
+ if( inputModel != null ) {
+ if( inputModel.getProjectPath().equals(newModel.getProjectPath()) &&
inputModel != newModel ) {
+ // they have the same path but are different objects.
+ // Model was probably reloaded from disk and could be completely different
+ packageViewer.setInput(newModel);
+ packageViewer.expandAll();
+ return;
+ } else {
+ packageViewer.refresh();
+ return;
+ }
+ }
book.showPage(viewerComposite);
- } else
+ } else {
+ // just refresh whatever is the top changed element (archive probably)
packageViewer.refresh(topChanges[i]);
+ }
}
}
});
Show replies by date