Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-06-11 17:17:22 +0000
committerMichael Valenta2002-06-11 17:17:22 +0000
commit2734558f3f3c6e25c0fc1ab8fed302e50e7f194c (patch)
tree357985a30bbbad5efe11916b9790d1c32ee2ca79
parent3d6dc987cfed4b05fd79c83a81fb5e4795be771a (diff)
downloadeclipse.platform.team-2734558f3f3c6e25c0fc1ab8fed302e50e7f194c.tar.gz
eclipse.platform.team-2734558f3f3c6e25c0fc1ab8fed302e50e7f194c.tar.xz
eclipse.platform.team-2734558f3f3c6e25c0fc1ab8fed302e50e7f194c.zip
18785: Sync View: Select New Resources is enabled even if there are no new resources
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
index 6cdcd2f8a..8350e2a42 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
@@ -346,6 +346,27 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
addSelectionChangedListener(showInHistory);
selectAdditions = new Action(Policy.bind("CVSCatchupReleaseViewer.Select_&Outgoing_Additions_1"), null) { //$NON-NLS-1$
+ public boolean isEnabled() {
+ DiffNode node = diffModel.getDiffRoot();
+ IDiffElement[] elements = node.getChildren();
+ for (int i = 0; i < elements.length; i++) {
+ IDiffElement element = elements[i];
+ if (element instanceof ITeamNode) {
+ CVSSyncSet set = new CVSSyncSet(new StructuredSelection(element));
+ try {
+ if (set.hasNonAddedChanges()) return true;
+ } catch (CVSException e) {
+ // Log the error and enable the menu item
+ CVSUIPlugin.log(e.getStatus());
+ return true;
+ }
+ } else {
+ // unanticipated situation, just enable the action
+ return true;
+ }
+ }
+ return false;
+ }
public void run() {
List additions = new ArrayList();
DiffNode root = diffModel.getDiffRoot();

Back to the top