Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-25 20:28:15 +0000
committerJean Michel-Lemieux2004-03-25 20:28:15 +0000
commitdd018e8effe47b257d95ce3b8ede9016705481d2 (patch)
tree3b591b1d8fd7269987c9298a75c685688d992d85
parent549de2058ecca62651f2d2003bc16a37cda523d7 (diff)
downloadeclipse.platform.team-dd018e8effe47b257d95ce3b8ede9016705481d2.tar.gz
eclipse.platform.team-dd018e8effe47b257d95ce3b8ede9016705481d2.tar.xz
eclipse.platform.team-dd018e8effe47b257d95ce3b8ede9016705481d2.zip
Bug 56217 [Sync View] Compare can no longer be removed from the sync viewI20040325
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java31
1 files changed, 30 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
index fcbf82bdd..747d40f56 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
@@ -13,14 +13,19 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoFilter;
import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ui.synchronize.actions.RemoveSynchronizeParticipantAction;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.*;
import org.eclipse.team.ui.synchronize.subscribers.SubscriberParticipant;
+import org.eclipse.ui.IActionBars;
public class CompareParticipant extends SubscriberParticipant {
@@ -32,6 +37,30 @@ public class CompareParticipant extends SubscriberParticipant {
}
};
+ private class CompareParticipantAdvisor extends CVSSynchronizeViewerAdvisor {
+ private RemoveSynchronizeParticipantAction removeAction;
+
+ public CompareParticipantAdvisor(ISynchronizeView view, SubscriberParticipant participant) {
+ super(view, participant);
+ }
+
+ protected void initializeActions(StructuredViewer treeViewer) {
+ super.initializeActions(treeViewer);
+ removeAction = new RemoveSynchronizeParticipantAction(getParticipant());
+ }
+
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ if(actionBars != null) {
+ IToolBarManager toolbar = actionBars.getToolBarManager();
+ if(toolbar != null) {
+ toolbar.add(new Separator());
+ toolbar.add(removeAction);
+ }
+ }
+ }
+ }
+
public CompareParticipant(CVSCompareSubscriber subscriber) {
super();
setMode(BOTH_MODE);
@@ -84,7 +113,7 @@ public class CompareParticipant extends SubscriberParticipant {
* @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#createSynchronizeViewerAdvisor(org.eclipse.team.ui.synchronize.ISynchronizeView)
*/
protected StructuredViewerAdvisor createSynchronizeViewerAdvisor(ISynchronizeView view) {
- return new CVSSynchronizeViewerAdvisor(view, this);
+ return new CompareParticipantAdvisor(view, this);
}
/**

Back to the top