1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 15:15:25 +02:00

[180872] unqueried folder should initially be stale, internalHasChildren() should check for stale when when there are no children, and getImageDescriptor needs to check if contents have been queried before determining whether to show a folder as open or not

This commit is contained in:
David McKnight 2007-04-04 13:27:26 +00:00
parent 31b5bb1e73
commit 61fc7b77c4
2 changed files with 8 additions and 8 deletions

View file

@ -491,8 +491,11 @@ public class SystemViewRemoteFileAdapter
isOpen = atv.getExpandedState(element);
if (!isOpen)
{
if (!hasChildren((IAdaptable)element))
isOpen = true;
// if there are children but they are empty then we've queried this but there are no children
// so we have an empty open folder
Object[] contents = file.getContents(RemoteChildrenContentsType.getInstance());
if (contents != null && contents.length == 0)
isOpen = true;
}
}
if (file.isRoot())
@ -842,10 +845,9 @@ public class SystemViewRemoteFileAdapter
// check that the children are actually there
//Object[] contents = file.getContents(RemoteChildrenContentsType.getInstance());
hasChildren = file.hasContents(RemoteChildrenContentsType.getInstance(), filter);
if (!hasChildren && !file.isStale())
//if (!hasChildren && !file.isStale())
if (!hasChildren && file.isStale()) // there are no children, but the resource is stale, therefore it still needs to be queried
hasChildren = true;
// if (!file.isStale() && contents != null && contents.length == 0 )
// hasChildren = false;
}
return hasChildren;

View file

@ -35,13 +35,11 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemContentsType;
import org.eclipse.rse.core.subsystems.IRemoteContainer;
import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType;
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
import org.eclipse.rse.services.clientserver.StringComparePatternMatcher;
import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString;
import org.eclipse.rse.subsystems.files.core.model.SystemFileTransferModeRegistry;
import org.eclipse.rse.ui.RSEUIPlugin;
/**
@ -87,7 +85,7 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
protected HashMap _contents = new HashMap();
/* container properties */
protected boolean _isStale = false;
protected boolean _isStale = true;
// properties
protected HashMap properties = new HashMap();