[jbosstools-commits] JBoss Tools SVN: r43617 - branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Sep 12 04:36:15 EDT 2012


Author: rob.stryker at jboss.com
Date: 2012-09-12 04:36:15 -0400 (Wed, 12 Sep 2012)
New Revision: 43617

Modified:
   branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
   branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java
Log:
JBIDE-11927 to maintenance

Modified: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java	2012-09-12 08:35:11 UTC (rev 43616)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java	2012-09-12 08:36:15 UTC (rev 43617)
@@ -205,14 +205,15 @@
 		if( o instanceof WrappedProject && shouldRefreshProject())
 			o = ((WrappedProject)o).element;
 
-		if( viewerInUse instanceof StructuredViewer ) {
-			((StructuredViewer)viewerInUse).refresh(o);
-			if( viewerInUse instanceof TreeViewer ) {
-				((TreeViewer)viewerInUse).expandToLevel(o, 1);
-			}
-		} else
-			viewerInUse.refresh();
-
+		if( !viewerInUse.getControl().isDisposed()) {
+			if( viewerInUse instanceof StructuredViewer ) {
+				((StructuredViewer)viewerInUse).refresh(o);
+				if( viewerInUse instanceof TreeViewer ) {
+					((TreeViewer)viewerInUse).expandToLevel(o, 1);
+				}
+			} else
+				viewerInUse.refresh();
+		}
 	}
 	protected IArchiveNode[] getChanges(IArchiveNodeDelta delta) {
 		IArchiveNodeDelta[] children = delta.getAllAffectedChildren();

Modified: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java	2012-09-12 08:35:11 UTC (rev 43616)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java	2012-09-12 08:36:15 UTC (rev 43617)
@@ -11,6 +11,7 @@
 package org.jboss.ide.eclipse.archives.ui.providers;
 
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
@@ -36,11 +37,15 @@
 
 	public Object[] getChildren(Object parentElement) {
 		if( parentElement instanceof IProject) {
-			if(  ((IProject)parentElement).isOpen())
-				if( PrefsInitializer.getBoolean(PrefsInitializer.PREF_ALWAYS_SHOW_PROJECT_EXPLORER_NODE) || 
-						ArchivesModel.instance().canReregister(((IProject)parentElement).getLocation())) {
+			if(  ((IProject)parentElement).isOpen()) {
+				IPath loc = ((IProject)parentElement).getLocation();
+				boolean alwaysShow = PrefsInitializer.getBoolean(PrefsInitializer.PREF_ALWAYS_SHOW_PROJECT_EXPLORER_NODE); 
+				boolean fileExists = ArchivesModel.instance().canReregister(loc);
+				boolean nodeExists = ArchivesModel.instance().getRoot(loc) != null;
+				if( alwaysShow || fileExists || nodeExists ) {
 					return new Object[] { new WrappedProject((IProject)parentElement, WrappedProject.CATEGORY) };
 				}
+			}
 			return new Object[]{};
 		}
 		return delegate.getChildren(parentElement);



More information about the jbosstools-commits mailing list