Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-05-19 13:55:57 -0400
committerjames2002-05-19 13:55:57 -0400
commitaff09d176d9422d88982eddda710bf52b1df99cb (patch)
treef01134f2a5831f581012168687714a887c394e7c
parent67c92e82222d5af0ca18517ef7ee7616863374e3 (diff)
downloadeclipse.platform.team-aff09d176d9422d88982eddda710bf52b1df99cb.tar.gz
eclipse.platform.team-aff09d176d9422d88982eddda710bf52b1df99cb.tar.xz
eclipse.platform.team-aff09d176d9422d88982eddda710bf52b1df99cb.zip
Add actions to the sync view
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetSyncAction.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutSyncAction.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetCatchupReleaseViewer.java34
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetSyncAction.java5
4 files changed, 32 insertions, 27 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetSyncAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetSyncAction.java
index 451186a8d..1763e60e3 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetSyncAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/GetSyncAction.java
@@ -21,6 +21,7 @@ import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.sync.ITeamNode;
import org.eclipse.team.internal.ui.sync.SyncSet;
+import org.eclipse.team.internal.ui.sync.SyncView;
public class GetSyncAction extends TargetSyncAction {
@@ -32,16 +33,17 @@ public class GetSyncAction extends TargetSyncAction {
* @see TargetSyncAction#isEnabled(ITeamNode)
*/
protected boolean isEnabled(ITeamNode node) {
- // The update action is enabled only for non-conflicting incoming changes
- return new SyncSet(new StructuredSelection(node)).hasIncomingChanges();
+ // Get action is enabled for any changed nodes.
+ return new SyncSet(new StructuredSelection(node)).getChangedNodes().length > 0;
}
/**
* @see TargetSyncAction#removeNonApplicableNodes(SyncSet, int)
*/
protected void removeNonApplicableNodes(SyncSet set, int syncMode) {
- set.removeConflictingNodes();
- set.removeOutgoingNodes();
+ if (syncMode == SyncView.SYNC_INCOMING) {
+ set.removeOutgoingNodes();
+ }
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutSyncAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutSyncAction.java
index e34ed7ec5..731d211b0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutSyncAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/PutSyncAction.java
@@ -17,6 +17,7 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.target.TargetProvider;
import org.eclipse.team.internal.ui.sync.ITeamNode;
import org.eclipse.team.internal.ui.sync.SyncSet;
+import org.eclipse.team.internal.ui.sync.SyncView;
public class PutSyncAction extends TargetSyncAction {
@@ -28,16 +29,17 @@ public class PutSyncAction extends TargetSyncAction {
* @see TargetSyncAction#isEnabled(ITeamNode)
*/
protected boolean isEnabled(ITeamNode node) {
- // The update action is enabled only for non-conflicting incoming changes
- return new SyncSet(new StructuredSelection(node)).hasOutgoingChanges();
+ // Put action is enabled for any changed nodes.
+ return new SyncSet(new StructuredSelection(node)).getChangedNodes().length > 0;
}
/**
* @see TargetSyncAction#removeNonApplicableNodes(SyncSet, int)
*/
protected void removeNonApplicableNodes(SyncSet set, int syncMode) {
- set.removeConflictingNodes();
- set.removeIncomingNodes();
+ if (syncMode == SyncView.SYNC_OUTGOING) {
+ set.removeIncomingNodes();
+ }
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetCatchupReleaseViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetCatchupReleaseViewer.java
index f52d7e596..c3758177e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetCatchupReleaseViewer.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetCatchupReleaseViewer.java
@@ -27,22 +27,22 @@ public class TargetCatchupReleaseViewer extends CatchupReleaseViewer {
}
protected void fillContextMenu(IMenuManager manager) {
super.fillContextMenu(manager);
-// manager.add(new Separator());
-// switch (getSyncMode()) {
-// case SyncView.SYNC_INCOMING:
-// getAction.update(SyncView.SYNC_INCOMING);
-// manager.add(getAction);
-// break;
-// case SyncView.SYNC_OUTGOING:
-// putAction.update(SyncView.SYNC_INCOMING);
-// manager.add(putAction);
-// break;
-// case SyncView.SYNC_BOTH:
-// getAction.update(SyncView.SYNC_INCOMING);
-// manager.add(getAction);
-// putAction.update(SyncView.SYNC_INCOMING);
-// manager.add(putAction);
-// break;
-// }
+ manager.add(new Separator());
+ switch (getSyncMode()) {
+ case SyncView.SYNC_INCOMING:
+ getAction.update(SyncView.SYNC_INCOMING);
+ manager.add(getAction);
+ break;
+ case SyncView.SYNC_OUTGOING:
+ putAction.update(SyncView.SYNC_INCOMING);
+ manager.add(putAction);
+ break;
+ case SyncView.SYNC_BOTH:
+ getAction.update(SyncView.SYNC_INCOMING);
+ manager.add(getAction);
+ putAction.update(SyncView.SYNC_INCOMING);
+ manager.add(putAction);
+ break;
+ }
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetSyncAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetSyncAction.java
index 18841db70..0343c9508 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetSyncAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/target/TargetSyncAction.java
@@ -144,10 +144,11 @@ public abstract class TargetSyncAction extends Action {
unchanged.add(children[j]);
}
parent.removeToRoot(container);
- // No children, it will get removed below.
+ continue;
}
- nodes[i].getParent().removeToRoot(nodes[i]);
+ // No children, it will get removed below.
}
+ nodes[i].getParent().removeToRoot(nodes[i]);
}
}

Back to the top