Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-10-11 11:37:26 +0000
committerMichael Valenta2002-10-11 11:37:26 +0000
commitdd3dcd22336e83b5d2811257f05cd926d9919ec6 (patch)
treeb4e19a6a2cadf21d6e42c8f52985d18b50de1361
parentc05a612a666de157a5ed5fccf6e6ab85a3fb5e03 (diff)
downloadeclipse.platform.team-dd3dcd22336e83b5d2811257f05cd926d9919ec6.tar.gz
eclipse.platform.team-dd3dcd22336e83b5d2811257f05cd926d9919ec6.tar.xz
eclipse.platform.team-dd3dcd22336e83b5d2811257f05cd926d9919ec6.zip
24647: [CVS UI] Popping up context menu in navigator or package explorer is slowRoot_branch_5782
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java11
2 files changed, 23 insertions, 12 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
index fc3475fa5..ef515a265 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
@@ -980,17 +980,19 @@ public class EclipseSynchronizer {
folders.add(resource.getParent());
}
// use the depth to gather child folders when appropriate
- try {
- resource.accept(new IResourceVisitor() {
- public boolean visit(IResource resource) throws CoreException {
- if (resource.getType() == IResource.FOLDER)
- folders.add(resource);
- // let the depth determine who we visit
- return true;
- }
- }, depth, false);
- } catch (CoreException e) {
- throw CVSException.wrapException(e);
+ if (depth != IResource.DEPTH_ZERO) {
+ try {
+ resource.accept(new IResourceVisitor() {
+ public boolean visit(IResource resource) throws CoreException {
+ if (resource.getType() == IResource.FOLDER)
+ folders.add(resource);
+ // let the depth determine who we visit
+ return true;
+ }
+ }, depth, false);
+ } catch (CoreException e) {
+ throw CVSException.wrapException(e);
+ }
}
}
return (IContainer[]) folders.toArray(new IContainer[folders.size()]);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
index 0a65aff64..a0df29c09 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
@@ -62,7 +62,7 @@ public abstract class WorkspaceAction extends CVSAction {
* performing the associated operation
*/
protected boolean isSyncInfoLoaded(IResource[] resources) throws CVSException {
- return EclipseSynchronizer.getInstance().isSyncInfoLoaded(resources, getActionDepth());
+ return EclipseSynchronizer.getInstance().isSyncInfoLoaded(resources, getEnablementDepth());
}
/**
@@ -75,6 +75,15 @@ public abstract class WorkspaceAction extends CVSAction {
}
/**
+ * Returns the resource depth of the action enablement for use in determining if the required
+ * sync info is loaded. The default is IResource.DEPTH_ZERO. Sunclasses can override
+ * as required.
+ */
+ protected int getEnablementDepth() {
+ return IResource.DEPTH_ZERO;
+ }
+
+ /**
* Ensure that the sync info for all the provided resources has been loaded.
* If an out-of-sync resource is found, prompt to refresh all the projects involved.
*/

Back to the top