Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-17 19:46:56 +0000
committerJean Michel-Lemieux2003-10-17 19:46:56 +0000
commitc2131ffe249c302742242ecb99ddf87f94b304a7 (patch)
treed962353fb52708cf936440667e762b8d32bd87b4
parent6f3377d07a77b6d577530899ae927437c84ec193 (diff)
downloadeclipse.platform.team-c2131ffe249c302742242ecb99ddf87f94b304a7.tar.gz
eclipse.platform.team-c2131ffe249c302742242ecb99ddf87f94b304a7.tar.xz
eclipse.platform.team-c2131ffe249c302742242ecb99ddf87f94b304a7.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberManager.java69
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamDelta.java12
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriber.java46
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriberFactory.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SubscriberManager.java53
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java (renamed from bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSubscriberPage.java)14
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberPage.java81
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java83
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java51
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SynchronizeViewActionDelagate.java37
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java46
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ShowSynchronizeViewPage.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java40
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java57
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizePageDropDownAction.java22
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeViewWorkbenchPart.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeViewPage.java)23
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java34
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeViewPage.java)41
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipantListener.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizePageListener.java)10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/INewSynchronizeView.java)24
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SubscriberPage.java)16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ComparisonCriteriaActionGroup.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java24
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RemoveSynchronizeViewPageAction.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewLayoutAction.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetFilterActionGroup.java10
35 files changed, 442 insertions, 468 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java
index 25888277f..72a943bcd 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ComparisonCriteria.java
@@ -17,7 +17,7 @@ import org.eclipse.team.core.TeamException;
* A ComparisonCriteria used by a <code>TeamSubscriber</code> to calculate the sync
* state of the workspace resources. Subscribers are free to use the criteria
* best suited for their environment. For example, an FTP subscriber could choose to use file
- * size or file size as compasison criterias.
+ * size or file timestamps as compasison criterias.
* <p>
* Aggregate criterias can be created for cases where a criteria is based on the result
* of another criteria.</p>
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberManager.java
deleted file mode 100644
index dbeb48a17..000000000
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/ISubscriberManager.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.core.subscribers;
-
-import org.eclipse.core.runtime.QualifiedName;
-
-/**
- * The subscriber manager is responsible for managing the team subscribers.
- * It provides the ability to register and deregister subscribers and access
- * all currently registered subscribers. It also fires events when subscribers
- * are registered and deregistered.
- */
-public interface ISubscriberManager {
-
- /**
- * Register a subscriber with the subscriber manager. The id of the subscriber
- * (returned by <code>TeamSubscriber#getId()</code>) must be unique.
- * Registering a subscriber will result in all registered listeners being
- * notified of the addition in the same thread as the call to <code>registerSubscriber()</code>.
- *
- * @param subscriber the subscriber being registered
- */
- public void registerSubscriber(TeamSubscriber subscriber);
-
- /**
- * Remove a subscriber from the subscriber manager. Deregistering a subscriber
- * will result in all registered listeners being
- * notified of the addition in the same thread as the call to
- * <code>deregisterSubscriber()</code>.
- *
- * @param subscriber the subscriber being deregistered
- */
- public void deregisterSubscriber(TeamSubscriber subscriber);
-
- /**
- * Get the subscriber with the given id. Return <code>null</code>
- * if there is no registered subscriber with the given id.
- * @param id the unique id of the subscriber
- * @return the subscriber whose id matches the given one
- */
- public TeamSubscriber getSubscriber(QualifiedName id);
-
- /**
- * Return all registered subscribers.
- * @return all registered subscribers
- */
- public TeamSubscriber[] getSubscribers();
-
- /**
- * Add a change listener that will be invoked when a subscriber is registered
- * or deregistered.
- * @param listener the team resource change listener to be added
- */
- public void addTeamResourceChangeListener(ITeamResourceChangeListener listener);
-
- /**
- * Remove a previously added change listener
- * @param listener the team resource change listener to be removed
- */
- public void removeTeamResourceChangeListener(ITeamResourceChangeListener listener);
-}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamDelta.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamDelta.java
index 308daf14f..580b214f7 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamDelta.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamDelta.java
@@ -47,18 +47,6 @@ public class TeamDelta {
*/
public static final int PROVIDER_DECONFIGURED = 0x4;
- /**
- * Delta kind constant (bit mask) indicating that a team provider has been de-configured on the resource.
- * @see IResourceDelta#getKind
- */
- public static final int SUBSCRIBER_CREATED = 0x8;
-
- /**
- * Delta kind constant (bit mask) indicating that a team provider has been de-configured on the resource.
- * @see IResourceDelta#getKind
- */
- public static final int SUBSCRIBER_DELETED = 0x10;
-
private TeamSubscriber subscriber;
private int flags;
private IResource resource;
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriber.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriber.java
index 9d9387813..3b458856f 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriber.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriber.java
@@ -15,10 +15,11 @@ import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteResource;
-import org.eclipse.team.internal.core.SubscriberManager;
/**
* A TeamSubscriber provides synchronization between local resources and a remote location
@@ -32,15 +33,6 @@ abstract public class TeamSubscriber {
private List listeners = new ArrayList(1);
/**
- * Return the subscriber manager which provides access and control of the
- * team subscribers.
- * @return the subscriber manager
- */
- public static synchronized ISubscriberManager getSubscriberManager() {
- return SubscriberManager.getInstance();
- }
-
- /**
* Return the unique id that identified this subscriber.
*/
abstract public QualifiedName getId();
@@ -218,18 +210,6 @@ abstract public class TeamSubscriber {
abstract public boolean isThreeWay();
/**
- * Returns if this subscription can be cancelled. This allows short-lived subscriptions to
- * be terminated at the users request. For example, this could be used to finish a merge
- * subscription once all changes have been merged.
- */
- abstract public boolean isCancellable();
-
- /**
- * Cancels this subscription.
- */
- abstract public void cancel();
-
- /**
* Adds a listener to this team subscriber.
* Has no effect if an identical listener is already registered.
* <p>
@@ -270,7 +250,19 @@ abstract public class TeamSubscriber {
synchronized(listeners) {
allListeners = (ITeamResourceChangeListener[]) listeners.toArray(new ITeamResourceChangeListener[listeners.size()]);
}
- ((SubscriberManager)getSubscriberManager()).fireTeamResourceChange(allListeners, deltas);
+ // Notify the listeners safely so all will receive notification
+ for (int i = 0; i < allListeners.length; i++) {
+ final ITeamResourceChangeListener listener = allListeners[i];
+ Platform.run(new ISafeRunnable() {
+ public void handleException(Throwable exception) {
+ // don't log the exception....it is already being logged in Platform#run
+ }
+ public void run() throws Exception {
+ listener.teamResourceChanged(deltas);
+
+ }
+ });
+ }
}
/**
@@ -295,14 +287,6 @@ abstract public class TeamSubscriber {
}
/**
- * Returns <code>true</code> if you can release changes to this subscriber and
- * <code>false</code> otherwise.
- */
- public boolean isReleaseSupported() {
- return true;
- }
-
- /**
* Return true if the receiver is equal to object.
* @return true if object is the same class as the receiver and has the same ID
*/
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriberFactory.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriberFactory.java
index ba14fbd97..5b0217fde 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriberFactory.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriberFactory.java
@@ -61,4 +61,4 @@ abstract public class TeamSubscriberFactory {
* @throws TeamException if there was a problem restoring from the save context.
*/
abstract public TeamSubscriber restoreSubscriber(QualifiedName id, SaveContext saveContext) throws TeamException;
-}
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SubscriberManager.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SubscriberManager.java
index af9d95baa..de8845b89 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SubscriberManager.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SubscriberManager.java
@@ -28,7 +28,6 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.ISubscriberManager;
import org.eclipse.team.core.subscribers.ITeamResourceChangeListener;
import org.eclipse.team.core.subscribers.TeamDelta;
import org.eclipse.team.core.subscribers.TeamSubscriber;
@@ -37,7 +36,7 @@ import org.eclipse.team.core.subscribers.TeamSubscriberFactory;
/**
* This class provides the private implementation of <code>ISubscriberManager</code>.
*/
-public class SubscriberManager implements ISubscriberManager, ISaveParticipant {
+public class SubscriberManager implements ISaveParticipant {
private static String SUBSCRIBER_EXTENSION = "subscriber"; //$NON-NLS-1$
final static private String SAVECTX_SUBSCRIBERS = "subscribers"; //$NON-NLS-1$
@@ -49,54 +48,6 @@ public class SubscriberManager implements ISubscriberManager, ISaveParticipant {
private List listeners = new ArrayList(1);
private Map factories = new HashMap();
- static private ISubscriberManager instance;
-
- public static synchronized ISubscriberManager getInstance() {
- if (instance == null) {
- // Initialize the variable before trigering startup.
- // This is done because the startup code can invoke
- // subscriber factories which, in turn will ask for the
- // subscriber manager.
- instance = new SubscriberManager();
- ((SubscriberManager)instance).startup();
- }
- return instance;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISubscriberManager#registerSubscriber(org.eclipse.team.core.subscribers.TeamSubscriber)
- */
- public void registerSubscriber(TeamSubscriber subscriber) {
- boolean fireEvent = false;
- synchronized(subscribers) {
- if(! subscribers.containsKey(subscriber.getId())) {
- subscribers.put(subscriber.getId(), subscriber);
- fireEvent = true;
- }
- }
- if (fireEvent) {
- fireTeamResourceChange(new TeamDelta[] {
- new TeamDelta(subscriber, TeamDelta.SUBSCRIBER_CREATED, null)});
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISubscriberManager#deregisterSubscriber(org.eclipse.team.core.subscribers.TeamSubscriber)
- */
- public void deregisterSubscriber(TeamSubscriber subscriber) {
- boolean fireEvent = false;
- synchronized(subscribers) {
- if (subscribers.remove(subscriber.getId()) != null) {
- // Only notify if the subscriber was registered in the first place
- fireEvent = true;
- }
- }
- if (fireEvent) {
- fireTeamResourceChange(new TeamDelta[] {
- new TeamDelta(subscriber, TeamDelta.SUBSCRIBER_DELETED, null)});
- }
- }
-
/* (non-Javadoc)
* @see org.eclipse.team.core.subscribers.ISubscriberManager#getSubscriber(org.eclipse.core.runtime.QualifiedName)
*/
@@ -205,7 +156,7 @@ public class SubscriberManager implements ISubscriberManager, ISaveParticipant {
if(children.length == 1) {
TeamSubscriber s = factory.restoreSubscriber(new QualifiedName(qualifier, localName), children[0]);
if(s != null) {
- registerSubscriber(s);
+ //registerSubscriber(s);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
index 1684244a7..e8ecdbd49 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
@@ -35,7 +35,6 @@ import org.eclipse.team.core.subscribers.RemoteBytesSynchronizer;
import org.eclipse.team.core.subscribers.RemoteSynchronizer;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.core.subscribers.TeamDelta;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.core.sync.IRemoteResource;
import org.eclipse.team.internal.ccvs.core.syncinfo.MergedSynchronizer;
import org.eclipse.team.internal.ccvs.core.syncinfo.RemoteTagSynchronizer;
@@ -144,20 +143,12 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
public void cancel() {
super.cancel();
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- TeamSubscriber.getSubscriberManager().deregisterSubscriber(this);
remoteSynchronizer.dispose();
baseSynchronizer.dispose();
mergedSynchronizer.dispose();
}
/* (non-Javadoc)
- * @see org.eclipse.team.core.sync.TeamSubscriber#isCancellable()
- */
- public boolean isCancellable() {
- return true;
- }
-
- /* (non-Javadoc)
* @see org.eclipse.team.core.sync.TeamSubscriber#roots()
*/
public IResource[] roots() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index ba917698e..b819bbfe8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -46,11 +46,11 @@ import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.ui.model.CVSAdapterFactory;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryRoot;
-import org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberPage;
+import org.eclipse.team.internal.ccvs.ui.subscriber.CVSWorkspaceSynchronizeParticipant;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkingSet;
@@ -81,7 +81,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* The repository manager
*/
private RepositoryManager repositoryManager;
- private CVSSubscriberPage cvsWorkspaceSynchronizeViewPage;
+ private CVSWorkspaceSynchronizeParticipant cvsWorkspaceSynchronizeViewPage;
// constants used by watch/edit as values for string preference
public static final String EDIT = "edit"; //$NON-NLS-1$
@@ -653,23 +653,23 @@ public class CVSUIPlugin extends AbstractUIPlugin {
// Commented out until we have fully ported the CVS console to the new API
//ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {new CVSOutputConsole()});
- cvsWorkspaceSynchronizeViewPage = new CVSSubscriberPage(
+ cvsWorkspaceSynchronizeViewPage = new CVSWorkspaceSynchronizeParticipant(
CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
"CVS Workspace",
CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CVSLOGO),
6);
- TeamUI.getSynchronizeManager().addSynchronizePages(new ISynchronizeViewPage[] {cvsWorkspaceSynchronizeViewPage});
- TeamUI.getSynchronizeManager().addSynchronizePages(new ISynchronizeViewPage[] {
- new CVSSubscriberPage(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
+ TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[] {cvsWorkspaceSynchronizeViewPage});
+ TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[] {
+ new CVSWorkspaceSynchronizeParticipant(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
"CVS Workspace - 2",
CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CVSLOGO), 2)});
- TeamUI.getSynchronizeManager().addSynchronizePages(new ISynchronizeViewPage[] {
- new CVSSubscriberPage(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
+ TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[] {
+ new CVSWorkspaceSynchronizeParticipant(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
"CVS Workspace - 3",
CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CVSLOGO), 3)});
- TeamUI.getSynchronizeManager().addSynchronizePages(new ISynchronizeViewPage[] {
- new CVSSubscriberPage(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
+ TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[] {
+ new CVSWorkspaceSynchronizeParticipant(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(),
"CVS Workspace - 4",
CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_CVSLOGO), 4)});
@@ -705,7 +705,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
/**
* @return Returns the cvsWorkspaceSynchronizeViewPage.
*/
- public CVSSubscriberPage getCvsWorkspaceSynchronizeViewPage() {
+ public CVSWorkspaceSynchronizeParticipant getCvsWorkspaceSynchronizeViewPage() {
return cvsWorkspaceSynchronizeViewPage;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
index 010780067..438e84f0f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
@@ -19,12 +19,12 @@ import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.subscriber.CVSSubscriberPage;
+import org.eclipse.team.internal.ccvs.ui.subscriber.CVSWorkspaceSynchronizeParticipant;
import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
import org.eclipse.team.internal.ui.sync.SyncCompareInput;
import org.eclipse.team.internal.ui.sync.SyncView;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.INewSynchronizeView;
+import org.eclipse.team.ui.sync.ISynchronizeView;
import org.eclipse.ui.IWorkingSet;
/**
@@ -38,9 +38,9 @@ public class SyncAction extends WorkspaceAction {
if (resources == null || resources.length == 0) return;
IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(resources, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$
- INewSynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
+ ISynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
if(view != null) {
- CVSSubscriberPage cvsPage = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeViewPage();
+ CVSWorkspaceSynchronizeParticipant cvsPage = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeViewPage();
cvsPage.setWorkingSet(workingSet);
view.display(cvsPage);
cvsPage.refreshWithRemote(resources);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
index 369761998..e89398db1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
@@ -20,11 +20,11 @@ import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.subscriber.CVSMergeSubscriberPage;
+import org.eclipse.team.internal.ccvs.ui.subscriber.CVSMergeSynchronizeParticipant;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.INewSynchronizeView;
+import org.eclipse.team.ui.sync.ISynchronizeView;
import org.eclipse.team.ui.sync.ISynchronizeManager;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -65,11 +65,11 @@ public class MergeWizard extends Wizard {
CVSTag endTag = endPage.getTag();
CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag);
- CVSMergeSubscriberPage page = new CVSMergeSubscriberPage(s, s.getName(), CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_PROJECT_VERSION));
+ CVSMergeSynchronizeParticipant page = new CVSMergeSynchronizeParticipant(s, s.getName(), CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_PROJECT_VERSION));
ISynchronizeManager manager = TeamUI.getSynchronizeManager();
- manager.addSynchronizePages(new ISynchronizeViewPage[] {page});
+ manager.addSynchronizeParticipants(new ISynchronizeParticipant[] {page});
- INewSynchronizeView view = manager.showSynchronizeViewInActivePage(null);
+ ISynchronizeView view = manager.showSynchronizeViewInActivePage(null);
if(view != null) {
view.display(page);
page.refreshWithRemote(null /* all roots */);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index 7656f3be6..c57b7423c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -1037,7 +1037,7 @@ action.SynchronizeViewCommit.description=Commit All Outgoing Changes
action.SynchronizeViewCommit.image=checkin_action.gif
action.SynchronizeViewUpdate.label=Update All Incoming Changes
-action.SynchronizeViewUpdate.tooltip=Commit All Incoming Changes
-action.SynchronizeViewUpdate.description=Commit All Incoming Changes
+action.SynchronizeViewUpdate.tooltip=Update All Incoming Changes
+action.SynchronizeViewUpdate.description=Update All Incoming Changes
action.SynchronizeViewUpdate.image=checkout_action.gif
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSubscriberPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java
index dd4e3d4e5..7427e3337 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSubscriberPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java
@@ -10,21 +10,24 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import org.eclipse.jface.action.*;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
-import org.eclipse.team.ui.sync.SubscriberPage;
+import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.ui.Utilities;
import org.eclipse.team.ui.sync.actions.DirectionFilterActionGroup;
import org.eclipse.team.ui.sync.actions.RemoveSynchronizeViewPageAction;
import org.eclipse.ui.IActionBars;
-public class CVSMergeSubscriberPage extends SubscriberPage {
+public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
private RemoveSynchronizeViewPageAction removeAction;
private DirectionFilterActionGroup modes;
private Action updateAdapter;
- public CVSMergeSubscriberPage(CVSMergeSubscriber subscriber, String name, ImageDescriptor imageDescriptor) {
+ public CVSMergeSynchronizeParticipant(CVSMergeSubscriber subscriber, String name, ImageDescriptor imageDescriptor) {
super(subscriber, name, imageDescriptor);
makeActions();
}
@@ -32,7 +35,8 @@ public class CVSMergeSubscriberPage extends SubscriberPage {
private void makeActions() {
removeAction = new RemoveSynchronizeViewPageAction(this);
modes = new DirectionFilterActionGroup(this, INCOMING_MODE | CONFLICTING_MODE | BOTH_MODE);
- updateAdapter = CVSSubscriberPage.createUpdateAdapter(new WorkspaceUpdateAction(), this);
+ updateAdapter = new CVSActionDelegate(new WorkspaceUpdateAction(), this);
+ Utilities.initAction(updateAdapter, "action.SynchronizeViewUpdate.", Policy.getBundle());
setMode(INCOMING_MODE);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberPage.java
deleted file mode 100644
index ca9c62173..000000000
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberPage.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ccvs.ui.subscriber;
-
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
-import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.ui.Utilities;
-import org.eclipse.team.ui.sync.SubscriberPage;
-import org.eclipse.team.ui.sync.actions.DirectionFilterActionGroup;
-import org.eclipse.ui.IActionBars;
-
-public class CVSSubscriberPage extends SubscriberPage {
-
- private DirectionFilterActionGroup modes;
- private Action commitAdapter;
- private Action updateAdapter;
- private int num;
-
- public CVSSubscriberPage(TeamSubscriber subscriber, String name, ImageDescriptor imageDescriptor, int num) {
- super(subscriber, name, imageDescriptor);
- this.num = num;
- modes = new DirectionFilterActionGroup(this, ALL_MODES);
- commitAdapter = createCommitAdapter(new SubscriberCommitAction(), this);
- updateAdapter = createUpdateAdapter(new WorkspaceUpdateAction(), this);
- }
-
- public static Action createCommitAdapter(final SubscriberCommitAction commitAction, final SubscriberPage page) {
- Action adapter = new Action() {
- public void run() {
- IStructuredContentProvider cp = (IStructuredContentProvider)page.getPage().getViewer().getContentProvider();
- StructuredSelection selection = new StructuredSelection(cp.getElements(page.getInput()));
- if(! selection.isEmpty()) {
- commitAction.selectionChanged(this, selection);
- commitAction.run(this);
- }
- }
- };
- Utilities.initAction(adapter, "action.SynchronizeViewCommit.", Policy.getBundle());
- return adapter;
- }
-
- public static Action createUpdateAdapter(final WorkspaceUpdateAction updateAction, final SubscriberPage page) {
- Action adapter = new Action() {
- public void run() {
- IStructuredContentProvider cp = (IStructuredContentProvider)page.getPage().getViewer().getContentProvider();
- StructuredSelection selection = new StructuredSelection(cp.getElements(page.getInput()));
- if(! selection.isEmpty()) {
- updateAction.selectionChanged(this, selection);
- updateAction.run(this);
- }
- }
- };
- Utilities.initAction(adapter, "action.SynchronizeViewUpdate.", Policy.getBundle());
- return adapter;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.sync.SubscriberPage#setActionsBars(org.eclipse.ui.IActionBars)
- */
- public void setActionsBars(IActionBars actionBars) {
- super.setActionsBars(actionBars);
- IToolBarManager toolbar = actionBars.getToolBarManager();
- toolbar.add(new Separator());
- modes.fillActionBars(actionBars, null);
- toolbar.add(new Separator());
- actionBars.getToolBarManager().add(updateAdapter);
- actionBars.getToolBarManager().add(commitAdapter);
- }
-}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java
new file mode 100644
index 000000000..95fe40e1f
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ccvs.ui.subscriber;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.team.core.subscribers.TeamSubscriber;
+import org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener;
+import org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent;
+import org.eclipse.team.ui.sync.TeamSubscriberParticipant;
+import org.eclipse.ui.IActionDelegate;
+
+public class CVSSynchronizeParticipant extends TeamSubscriberParticipant implements ISyncSetChangedListener {
+
+ private List delegates = new ArrayList(2);
+
+ protected class CVSActionDelegate extends Action {
+ private TeamSubscriberParticipant participant;
+ private IActionDelegate delegate;
+
+ public CVSActionDelegate(IActionDelegate delegate, TeamSubscriberParticipant participant) {
+ this.delegate = delegate;
+ this.participant = participant;
+ addDelegate(this);
+ }
+
+ public void run() {
+ IStructuredContentProvider cp = (IStructuredContentProvider)participant.getPage().getViewer().getContentProvider();
+ StructuredSelection selection = new StructuredSelection(cp.getElements(participant.getInput()));
+ if(! selection.isEmpty()) {
+ delegate.selectionChanged(this, selection);
+ delegate.run(this);
+ }
+ }
+
+ public IActionDelegate getDelegate() {
+ return delegate;
+ }
+ }
+
+ public CVSSynchronizeParticipant(TeamSubscriber subscriber, String name, ImageDescriptor imageDescriptor) {
+ super(subscriber, name, imageDescriptor);
+ getInput().getFilteredSyncSet().addSyncSetChangedListener(this);
+ }
+
+ private void addDelegate(CVSActionDelegate delagate) {
+ delegates.add(delagate);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.sync.AbstractSynchronizeParticipant#dispose()
+ */
+ protected void dispose() {
+ super.dispose();
+ getInput().getFilteredSyncSet().removeSyncSetChangedListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener#syncSetChanged(org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent)
+ */
+ public void syncSetChanged(SyncSetChangedEvent event) {
+ IStructuredContentProvider cp = (IStructuredContentProvider)getPage().getViewer().getContentProvider();
+ StructuredSelection selection = new StructuredSelection(cp.getElements(getInput()));
+ for (Iterator it = delegates.iterator(); it.hasNext(); ) {
+ CVSActionDelegate delegate = (CVSActionDelegate) it.next();
+ delegate.getDelegate().selectionChanged(delegate, selection);
+ }
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java
new file mode 100644
index 000000000..644569de6
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ccvs.ui.subscriber;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.team.core.subscribers.TeamSubscriber;
+import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.ui.Utilities;
+import org.eclipse.team.ui.sync.actions.DirectionFilterActionGroup;
+import org.eclipse.ui.IActionBars;
+
+public class CVSWorkspaceSynchronizeParticipant extends CVSSynchronizeParticipant {
+
+ private DirectionFilterActionGroup modes;
+ private Action commitAdapter;
+ private Action updateAdapter;
+
+ public CVSWorkspaceSynchronizeParticipant(TeamSubscriber subscriber, String name, ImageDescriptor imageDescriptor, int num) {
+ super(subscriber, name, imageDescriptor);
+ modes = new DirectionFilterActionGroup(this, ALL_MODES);
+ commitAdapter = new CVSActionDelegate(new SubscriberCommitAction(), this);
+ updateAdapter = new CVSActionDelegate(new WorkspaceUpdateAction(), this);
+ Utilities.initAction(commitAdapter, "action.SynchronizeViewCommit.", Policy.getBundle());
+ Utilities.initAction(updateAdapter, "action.SynchronizeViewUpdate.", Policy.getBundle());
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.sync.SubscriberPage#setActionsBars(org.eclipse.ui.IActionBars)
+ */
+ public void setActionsBars(IActionBars actionBars) {
+ super.setActionsBars(actionBars);
+ IToolBarManager toolbar = actionBars.getToolBarManager();
+ toolbar.add(new Separator());
+ modes.fillActionBars(actionBars, null);
+ toolbar.add(new Separator());
+ actionBars.getToolBarManager().add(updateAdapter);
+ actionBars.getToolBarManager().add(commitAdapter);
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SynchronizeViewActionDelagate.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SynchronizeViewActionDelagate.java
new file mode 100644
index 000000000..8e72f8eb2
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SynchronizeViewActionDelagate.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ccvs.ui.subscriber;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener;
+import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
+import org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent;
+import org.eclipse.ui.actions.ActionDelegate;
+
+public abstract class SynchronizeViewActionDelagate extends Action implements ISyncSetChangedListener {
+
+ private SubscriberInput input;
+ private ActionDelegate delegate;
+
+ public SynchronizeViewActionDelagate(SubscriberInput input, ActionDelegate delegate) {
+ super();
+ this.delegate = delegate;
+ this.input = input;
+ input.getFilteredSyncSet().addSyncSetChangedListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener#syncSetChanged(org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent)
+ */
+ public void syncSetChanged(SyncSetChangedEvent event) {
+ setEnabled(isEnabled());
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index 1b83e2367..a3a124dd6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -51,8 +51,8 @@ import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.ui.IConfigurationWizard;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.INewSynchronizeView;
-import org.eclipse.team.ui.sync.SubscriberPage;
+import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.sync.TeamSubscriberParticipant;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkingSet;
@@ -299,13 +299,13 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
throw new InvocationTargetException(e);
}
}
- INewSynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
+ ISynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
if(view != null) {
- SubscriberPage page = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeViewPage();
+ TeamSubscriberParticipant page = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeViewPage();
IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(new IResource[] {project}, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$)
page.setWorkingSet(workingSet);
view.display(page);
- page.setMode(SubscriberPage.OUTGOING_MODE);
+ page.setMode(TeamSubscriberParticipant.OUTGOING_MODE);
} else {
CVSUIPlugin.openError(getContainer().getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
index 0015c0823..4793bb996 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
@@ -37,7 +37,7 @@ import org.eclipse.team.internal.ui.jobs.RefreshSubscriberInputJob;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
import org.eclipse.team.internal.ui.sync.views.SyncViewerTableSorter;
import org.eclipse.team.ui.ISharedImages;
-import org.eclipse.team.ui.sync.SubscriberPage;
+import org.eclipse.team.ui.sync.TeamSubscriberParticipant;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -157,7 +157,7 @@ public class TeamUIPlugin extends AbstractUIPlugin implements IPropertyChangeLis
store.setDefault(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS, true);
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_TABLESORT, SyncViewerTableSorter.COL_NAME);
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_TABLESORT_REVERSED, false);
- store.setDefault(IPreferenceIds.SYNCVIEW_SELECTED_MODE, SubscriberPage.BOTH_MODE);
+ store.setDefault(IPreferenceIds.SYNCVIEW_SELECTED_MODE, TeamSubscriberParticipant.BOTH_MODE);
store.setDefault(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE, "org.eclipse.team.internal.ui.sync.views.TeamSynchronizingPerspective"); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java
index 3d4ed1cde..5cc8f78a2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/NewSynchronizeView.java
@@ -22,10 +22,10 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.INewSynchronizeView;
+import org.eclipse.team.ui.sync.ISynchronizeView;
import org.eclipse.team.ui.sync.ISynchronizeManager;
-import org.eclipse.team.ui.sync.ISynchronizePageListener;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeParticipantListener;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.IPage;
import org.eclipse.ui.part.IPageBookViewPage;
@@ -33,12 +33,12 @@ import org.eclipse.ui.part.MessagePage;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.PageBookView;
-public class NewSynchronizeView extends PageBookView implements INewSynchronizeView, ISynchronizePageListener, IPropertyChangeListener {
+public class NewSynchronizeView extends PageBookView implements ISynchronizeView, ISynchronizeParticipantListener, IPropertyChangeListener {
/**
* The console being displayed, or <code>null</code> if none
*/
- private ISynchronizeViewPage fActivePage = null;
+ private ISynchronizeParticipant fActivePage = null;
/**
* Map of consoles to dummy console parts (used to close pages)
@@ -62,8 +62,8 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
*/
public void propertyChange(PropertyChangeEvent event) {
Object source = event.getSource();
- if (source instanceof ISynchronizeViewPage && event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) {
- if (source.equals(getActivePage())) {
+ if (source instanceof ISynchronizeParticipant && event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) {
+ if (source.equals(getParticipant())) {
updateTitle();
}
}
@@ -80,7 +80,7 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.console.IConsoleView#getConsole()
*/
- public ISynchronizeViewPage getActivePage() {
+ public ISynchronizeParticipant getParticipant() {
return fActivePage;
}
@@ -89,7 +89,7 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
*/
protected void showPageRec(PageRec pageRec) {
super.showPageRec(pageRec);
- fActivePage = (ISynchronizeViewPage)fPartToPage.get(pageRec.part);
+ fActivePage = (ISynchronizeParticipant)fPartToPage.get(pageRec.part);
updateTitle();
}
@@ -97,7 +97,7 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
* Updates the view title based on the active console
*/
protected void updateTitle() {
- ISynchronizeViewPage page = getActivePage();
+ ISynchronizeParticipant page = getParticipant();
if (page == null) {
setTitle("Synchronize View");
} else {
@@ -113,7 +113,7 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
page.dispose();
pageRecord.dispose();
- ISynchronizeViewPage console = (ISynchronizeViewPage)fPartToPage.get(part);
+ ISynchronizeParticipant console = (ISynchronizeParticipant)fPartToPage.get(part);
console.removePropertyChangeListener(this);
// empty cross-reference cache
@@ -126,7 +126,7 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
*/
protected PageRec doCreatePage(IWorkbenchPart dummyPart) {
SynchronizeViewWorkbenchPart part = (SynchronizeViewWorkbenchPart)dummyPart;
- ISynchronizeViewPage console = part.getConsole();
+ ISynchronizeParticipant console = part.getConsole();
IPageBookViewPage page = console.createPage(this);
initPage(page);
page.createControl(getPageBook());
@@ -147,7 +147,7 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
*/
public void dispose() {
super.dispose();
- TeamUI.getSynchronizeManager().removeSynchronizePageListener(this);
+ TeamUI.getSynchronizeManager().removeSynchronizeParticipantListener(this);
}
/* (non-Javadoc)
@@ -163,13 +163,13 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
*/
- public void consolesAdded(final ISynchronizeViewPage[] consoles) {
+ public void participantsAdded(final ISynchronizeParticipant[] consoles) {
if (isAvailable()) {
Runnable r = new Runnable() {
public void run() {
for (int i = 0; i < consoles.length; i++) {
if (isAvailable()) {
- ISynchronizeViewPage console = consoles[i];
+ ISynchronizeParticipant console = consoles[i];
SynchronizeViewWorkbenchPart part = new SynchronizeViewWorkbenchPart(console, getSite());
fPageToPart.put(console, part);
fPartToPage.put(part, console);
@@ -185,19 +185,19 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
*/
- public void consolesRemoved(final ISynchronizeViewPage[] consoles) {
+ public void participantsRemoved(final ISynchronizeParticipant[] consoles) {
if (isAvailable()) {
Runnable r = new Runnable() {
public void run() {
for (int i = 0; i < consoles.length; i++) {
if (isAvailable()) {
- ISynchronizeViewPage console = consoles[i];
+ ISynchronizeParticipant console = consoles[i];
SynchronizeViewWorkbenchPart part = (SynchronizeViewWorkbenchPart)fPageToPart.get(console);
if (part != null) {
partClosed(part);
}
- if (getActivePage() == null) {
- ISynchronizeViewPage[] available = TeamUI.getSynchronizeManager().getSynchronizePages();
+ if (getParticipant() == null) {
+ ISynchronizeParticipant[] available = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
if (available.length > 0) {
display(available[available.length - 1]);
}
@@ -254,7 +254,7 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleView#display(org.eclipse.ui.console.IConsole)
*/
- public void display(ISynchronizeViewPage console) {
+ public void display(ISynchronizeParticipant console) {
SynchronizeViewWorkbenchPart part = (SynchronizeViewWorkbenchPart)fPageToPart.get(console);
if (part != null) {
partActivated(part);
@@ -312,9 +312,9 @@ public class NewSynchronizeView extends PageBookView implements INewSynchronizeV
private void updateForExistingConsoles() {
ISynchronizeManager manager = TeamUI.getSynchronizeManager();
// create pages for consoles
- ISynchronizeViewPage[] consoles = manager.getSynchronizePages();
- consolesAdded(consoles);
+ ISynchronizeParticipant[] consoles = manager.getSynchronizeParticipants();
+ participantsAdded(consoles);
// add as a listener
- manager.addSynchronizePageListener(this);
+ manager.addSynchronizeParticipantListener(this);
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ShowSynchronizeViewPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ShowSynchronizeViewPage.java
index f7d80c7a1..39fbb0f62 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ShowSynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/ShowSynchronizeViewPage.java
@@ -11,18 +11,18 @@
package org.eclipse.team.internal.ui.sync.pages;
import org.eclipse.jface.action.Action;
-import org.eclipse.team.ui.sync.INewSynchronizeView;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
public class ShowSynchronizeViewPage extends Action {
- private ISynchronizeViewPage fPage;
- private INewSynchronizeView fView;
+ private ISynchronizeParticipant fPage;
+ private ISynchronizeView fView;
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
public void run() {
- if (!fPage.equals(fView.getActivePage())) {
+ if (!fPage.equals(fView.getParticipant())) {
fView.display(fPage);
}
}
@@ -33,7 +33,7 @@ public class ShowSynchronizeViewPage extends Action {
* @param view the synchronize view in which the given page is contained
* @param console the console
*/
- public ShowSynchronizeViewPage(INewSynchronizeView view, ISynchronizeViewPage page) {
+ public ShowSynchronizeViewPage(ISynchronizeView view, ISynchronizeParticipant page) {
super(page.getName(), Action.AS_RADIO_BUTTON);
fPage = page;
fView = view;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java
index 7c8863cf0..2935d8747 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SubscriberSynchronizeViewPage.java
@@ -22,8 +22,8 @@ import org.eclipse.team.internal.ui.jobs.JobBusyCursor;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberInputJob;
import org.eclipse.team.internal.ui.sync.sets.*;
import org.eclipse.team.internal.ui.sync.views.*;
-import org.eclipse.team.ui.sync.INewSynchronizeView;
-import org.eclipse.team.ui.sync.SubscriberPage;
+import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.sync.TeamSubscriberParticipant;
import org.eclipse.team.ui.sync.actions.*;
import org.eclipse.team.ui.sync.actions.workingsets.WorkingSetFilterActionGroup;
import org.eclipse.ui.*;
@@ -50,8 +50,8 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
// private SyncViewerActions actions;
private JobBusyCursor busyCursor;
- private INewSynchronizeView view;
- private SubscriberPage page;
+ private ISynchronizeView view;
+ private TeamSubscriberParticipant page;
private IPageSite site;
public final static int[] INCOMING_MODE_FILTER = new int[] {SyncInfo.CONFLICTING, SyncInfo.INCOMING};
@@ -76,13 +76,13 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
/**
* Constructs a new SynchronizeView.
*/
- public SubscriberSynchronizeViewPage(SubscriberPage page, INewSynchronizeView view, SubscriberInput input) {
+ public SubscriberSynchronizeViewPage(TeamSubscriberParticipant page, ISynchronizeView view, SubscriberInput input) {
this.page = page;
this.view = view;
this.input = input;
layout = getStore().getInt(IPreferenceIds.SYNCVIEW_VIEW_TYPE);
- if (layout != SubscriberPage.TREE_LAYOUT) {
- layout = SubscriberPage.TABLE_LAYOUT;
+ if (layout != TeamSubscriberParticipant.TREE_LAYOUT) {
+ layout = TeamSubscriberParticipant.TABLE_LAYOUT;
}
}
@@ -108,8 +108,8 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
gotoPrevious = new NavigateAction(view, this, INavigableControl.PREVIOUS);
comparisonCriteria = new ComparisonCriteriaActionGroup(input);
- toggleLayoutTable = new ToggleViewLayoutAction(page, SubscriberPage.TABLE_LAYOUT);
- toggleLayoutTree = new ToggleViewLayoutAction(page, SubscriberPage.TREE_LAYOUT);
+ toggleLayoutTable = new ToggleViewLayoutAction(page, TeamSubscriberParticipant.TABLE_LAYOUT);
+ toggleLayoutTree = new ToggleViewLayoutAction(page, TeamSubscriberParticipant.TREE_LAYOUT);
showPreferences = new SyncViewerShowPreferencesAction(view.getSite().getShell());
workingSetGroup = new WorkingSetFilterActionGroup(getSite().getShell(), this, view, page);
@@ -232,10 +232,10 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
protected void createViewer(Composite parent) {
statsPanel = new StatisticsPanel(parent);
switch(layout) {
- case SubscriberPage.TREE_LAYOUT:
+ case TeamSubscriberParticipant.TREE_LAYOUT:
createTreeViewerPartControl(parent);
break;
- case SubscriberPage.TABLE_LAYOUT:
+ case TeamSubscriberParticipant.TABLE_LAYOUT:
createTableViewerPartControl(parent);
break;
}
@@ -461,7 +461,7 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
}
public void selectAll() {
- if (getLayout() == SubscriberPage.TABLE_LAYOUT) {
+ if (getLayout() == TeamSubscriberParticipant.TABLE_LAYOUT) {
TableViewer table = (TableViewer)getViewer();
table.getTable().selectAll();
} else {
@@ -491,7 +491,7 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
IToolBarManager manager = actionBars.getToolBarManager();
manager.add(comparisonCriteria);
manager.add(refreshAction);
- manager.add(new Separator(SubscriberPage.MB_MODESGROUP));
+ manager.add(new Separator(TeamSubscriberParticipant.MB_MODESGROUP));
manager.add(gotoNext);
manager.add(gotoPrevious);
manager.add(collapseAll);
@@ -525,11 +525,11 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
- if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_LAYOUT)) {
+ if(event.getProperty().equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_LAYOUT)) {
switchViewerType(((Integer)event.getNewValue()).intValue());
- } else if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_MODE)) {
+ } else if(event.getProperty().equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_MODE)) {
updateMode(((Integer)event.getNewValue()).intValue());
- } else if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_WORKINGSET)) {
+ } else if(event.getProperty().equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_WORKINGSET)) {
updateWorkingSet((IWorkingSet)event.getNewValue());
} else if(event.getProperty().equals(WorkingSetFilterActionGroup.CHANGE_WORKING_SET)) {
Object newValue = event.getNewValue();
@@ -548,13 +548,13 @@ public class SubscriberSynchronizeViewPage implements IPageBookViewPage, ISyncSe
private void updateMode(int mode) {
int[] modeFilter = BOTH_MODE_FILTER;
switch(mode) {
- case SubscriberPage.INCOMING_MODE:
+ case TeamSubscriberParticipant.INCOMING_MODE:
modeFilter = INCOMING_MODE_FILTER; break;
- case SubscriberPage.OUTGOING_MODE:
+ case TeamSubscriberParticipant.OUTGOING_MODE:
modeFilter = OUTGOING_MODE_FILTER; break;
- case SubscriberPage.BOTH_MODE:
+ case TeamSubscriberParticipant.BOTH_MODE:
modeFilter = BOTH_MODE_FILTER; break;
- case SubscriberPage.CONFLICTING_MODE:
+ case TeamSubscriberParticipant.CONFLICTING_MODE:
modeFilter = CONFLICTING_MODE_FILTER; break;
}
try {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java
index cf6292384..03ec89028 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java
@@ -14,16 +14,17 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.team.internal.ui.IPreferenceIds;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.sync.INewSynchronizeView;
import org.eclipse.team.ui.sync.ISynchronizeManager;
-import org.eclipse.team.ui.sync.ISynchronizePageListener;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
+import org.eclipse.team.ui.sync.ISynchronizeParticipantListener;
+import org.eclipse.team.ui.sync.ISynchronizeView;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
@@ -45,7 +46,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/**
* List of registered synchronize view pages
*/
- private List synchronizePages = new ArrayList(10);
+ private List synchronizeParticipants = new ArrayList(10);
// change notification constants
private final static int ADDED = 1;
@@ -56,17 +57,15 @@ public class SynchronizeManager implements ISynchronizeManager {
*/
class SynchronizeViewPageNotifier implements ISafeRunnable {
- private ISynchronizePageListener fListener;
+ private ISynchronizeParticipantListener fListener;
private int fType;
- private ISynchronizeViewPage[] fChanged;
+ private ISynchronizeParticipant[] fChanged;
/* (non-Javadoc)
* @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
*/
public void handleException(Throwable exception) {
- // TODO:
- //IStatus status = new Status(IStatus.ERROR, ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, ConsoleMessages.getString("ConsoleManager.0"), exception); //$NON-NLS-1$
- //ConsolePlugin.log(status);
+ TeamUIPlugin.log(IStatus.ERROR, "", exception);
}
/* (non-Javadoc)
@@ -75,10 +74,10 @@ public class SynchronizeManager implements ISynchronizeManager {
public void run() throws Exception {
switch (fType) {
case ADDED:
- fListener.consolesAdded(fChanged);
+ fListener.participantsAdded(fChanged);
break;
case REMOVED:
- fListener.consolesRemoved(fChanged);
+ fListener.participantsRemoved(fChanged);
break;
}
}
@@ -89,7 +88,7 @@ public class SynchronizeManager implements ISynchronizeManager {
* @param consoles the consoles that changed
* @param update the type of change
*/
- public void notify(ISynchronizeViewPage[] consoles, int update) {
+ public void notify(ISynchronizeParticipant[] consoles, int update) {
if (fListeners == null) {
return;
}
@@ -97,7 +96,7 @@ public class SynchronizeManager implements ISynchronizeManager {
fType = update;
Object[] copiedListeners= fListeners.getListeners();
for (int i= 0; i < copiedListeners.length; i++) {
- fListener = (ISynchronizePageListener)copiedListeners[i];
+ fListener = (ISynchronizeParticipantListener)copiedListeners[i];
Platform.run(this);
}
fChanged = null;
@@ -108,7 +107,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#addConsoleListener(org.eclipse.ui.console.IConsoleListener)
*/
- public void addSynchronizePageListener(ISynchronizePageListener listener) {
+ public void addSynchronizeParticipantListener(ISynchronizeParticipantListener listener) {
if (fListeners == null) {
fListeners = new ListenerList(5);
}
@@ -118,7 +117,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#removeConsoleListener(org.eclipse.ui.console.IConsoleListener)
*/
- public void removeSynchronizePageListener(ISynchronizePageListener listener) {
+ public void removeSynchronizeParticipantListener(ISynchronizeParticipantListener listener) {
if (fListeners != null) {
fListeners.remove(listener);
}
@@ -127,41 +126,41 @@ public class SynchronizeManager implements ISynchronizeManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#addConsoles(org.eclipse.ui.console.IConsole[])
*/
- public synchronized void addSynchronizePages(ISynchronizeViewPage[] consoles) {
+ public synchronized void addSynchronizeParticipants(ISynchronizeParticipant[] consoles) {
List added = new ArrayList(consoles.length);
for (int i = 0; i < consoles.length; i++) {
- ISynchronizeViewPage console = consoles[i];
- if (!synchronizePages.contains(console)) {
- synchronizePages.add(console);
+ ISynchronizeParticipant console = consoles[i];
+ if (!synchronizeParticipants.contains(console)) {
+ synchronizeParticipants.add(console);
added.add(console);
}
}
if (!added.isEmpty()) {
- fireUpdate((ISynchronizeViewPage[])added.toArray(new ISynchronizeViewPage[added.size()]), ADDED);
+ fireUpdate((ISynchronizeParticipant[])added.toArray(new ISynchronizeParticipant[added.size()]), ADDED);
}
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#removeConsoles(org.eclipse.ui.console.IConsole[])
*/
- public synchronized void removeSynchronizePages(ISynchronizeViewPage[] consoles) {
+ public synchronized void removeSynchronizeParticipants(ISynchronizeParticipant[] consoles) {
List removed = new ArrayList(consoles.length);
for (int i = 0; i < consoles.length; i++) {
- ISynchronizeViewPage console = consoles[i];
- if (synchronizePages.remove(console)) {
+ ISynchronizeParticipant console = consoles[i];
+ if (synchronizeParticipants.remove(console)) {
removed.add(console);
}
}
if (!removed.isEmpty()) {
- fireUpdate((ISynchronizeViewPage[])removed.toArray(new ISynchronizeViewPage[removed.size()]), REMOVED);
+ fireUpdate((ISynchronizeParticipant[])removed.toArray(new ISynchronizeParticipant[removed.size()]), REMOVED);
}
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#getConsoles()
*/
- public synchronized ISynchronizeViewPage[] getSynchronizePages() {
- return (ISynchronizeViewPage[])synchronizePages.toArray(new ISynchronizeViewPage[synchronizePages.size()]);
+ public synchronized ISynchronizeParticipant[] getSynchronizeParticipants() {
+ return (ISynchronizeParticipant[])synchronizeParticipants.toArray(new ISynchronizeParticipant[synchronizeParticipants.size()]);
}
/**
@@ -170,11 +169,11 @@ public class SynchronizeManager implements ISynchronizeManager {
* @param consoles consoles added/removed
* @param type ADD or REMOVE
*/
- private void fireUpdate(ISynchronizeViewPage[] consoles, int type) {
+ private void fireUpdate(ISynchronizeParticipant[] consoles, int type) {
new SynchronizeViewPageNotifier().notify(consoles, type);
}
- public INewSynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage activePage) {
+ public ISynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage activePage) {
IWorkbench workbench= TeamUIPlugin.getPlugin().getWorkbench();
IWorkbenchWindow window= workbench.getActiveWorkbenchWindow();
@@ -191,7 +190,7 @@ public class SynchronizeManager implements ISynchronizeManager {
activePage = TeamUIPlugin.getActivePage();
if (activePage == null) return null;
}
- return (INewSynchronizeView)activePage.showView(INewSynchronizeView.VIEW_ID);
+ return (ISynchronizeView)activePage.showView(ISynchronizeView.VIEW_ID);
} catch (PartInitException pe) {
Utils.handleError(window.getShell(), pe, Policy.bind("SynchronizeView.16"), pe.getMessage()); //$NON-NLS-1$
return null;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizePageDropDownAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizePageDropDownAction.java
index f2867353d..1315d2d22 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizePageDropDownAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizePageDropDownAction.java
@@ -21,26 +21,26 @@ import org.eclipse.team.ui.sync.*;
import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.texteditor.IUpdate;
-public class SynchronizePageDropDownAction extends Action implements IMenuCreator, ISynchronizePageListener, IUpdate {
+public class SynchronizePageDropDownAction extends Action implements IMenuCreator, ISynchronizeParticipantListener, IUpdate {
- private INewSynchronizeView fView;
+ private ISynchronizeView fView;
private Menu fMenu;
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
public void update() {
- ISynchronizeViewPage[] pages = TeamUI.getSynchronizeManager().getSynchronizePages();
+ ISynchronizeParticipant[] pages = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
setEnabled(pages.length >= 1);
}
- public SynchronizePageDropDownAction(INewSynchronizeView view) {
+ public SynchronizePageDropDownAction(ISynchronizeView view) {
fView= view;
Utils.initAction(this, "action.refreshSubscriber."); //$NON-NLS-1$
IKeyBindingService kbs = view.getSite().getKeyBindingService();
Utilities.registerAction(kbs, this, "org.eclipse.team.ui.syncview.syncAll"); //$NON-NLS-1$
setMenuCreator(this);
- TeamUI.getSynchronizeManager().addSynchronizePageListener(this);
+ TeamUI.getSynchronizeManager().addSynchronizeParticipantListener(this);
update();
}
@@ -53,7 +53,7 @@ public class SynchronizePageDropDownAction extends Action implements IMenuCreato
}
fView= null;
- TeamUI.getSynchronizeManager().removeSynchronizePageListener(this);
+ TeamUI.getSynchronizeManager().removeSynchronizeParticipantListener(this);
}
/* (non-Javadoc)
@@ -71,10 +71,10 @@ public class SynchronizePageDropDownAction extends Action implements IMenuCreato
fMenu.dispose();
}
fMenu= new Menu(parent);
- ISynchronizeViewPage[] pages = TeamUI.getSynchronizeManager().getSynchronizePages();
- ISynchronizeViewPage current = fView.getActivePage();
+ ISynchronizeParticipant[] pages = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
+ ISynchronizeParticipant current = fView.getParticipant();
for (int i = 0; i < pages.length; i++) {
- ISynchronizeViewPage page = pages[i];
+ ISynchronizeParticipant page = pages[i];
Action action = new ShowSynchronizeViewPage(fView, page);
action.setChecked(page.equals(current));
addActionToMenu(fMenu, action);
@@ -101,7 +101,7 @@ public class SynchronizePageDropDownAction extends Action implements IMenuCreato
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
*/
- public void consolesAdded(ISynchronizeViewPage[] consoles) {
+ public void participantsAdded(ISynchronizeParticipant[] consoles) {
Display display = TeamUIPlugin.getStandardDisplay();
display.asyncExec(new Runnable() {
public void run() {
@@ -117,7 +117,7 @@ public class SynchronizePageDropDownAction extends Action implements IMenuCreato
*
* @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
*/
- public void consolesRemoved(ISynchronizeViewPage[] consoles) {
+ public void participantsRemoved(ISynchronizeParticipant[] consoles) {
Display display = TeamUIPlugin.getStandardDisplay();
display.asyncExec(new Runnable() {
public void run() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeViewWorkbenchPart.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeViewWorkbenchPart.java
index 028515156..0f8326365 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeViewWorkbenchPart.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeViewWorkbenchPart.java
@@ -12,7 +12,7 @@ package org.eclipse.team.internal.ui.sync.pages;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
@@ -22,7 +22,7 @@ import org.eclipse.ui.IWorkbenchPartSite;
*/
public class SynchronizeViewWorkbenchPart implements IWorkbenchPart {
- private ISynchronizeViewPage fConsole = null;
+ private ISynchronizeParticipant fConsole = null;
private IWorkbenchPartSite fSite = null;
/* (non-Javadoc)
@@ -44,7 +44,7 @@ public class SynchronizeViewWorkbenchPart implements IWorkbenchPart {
* Constructs a part for the given console that binds to the given
* site
*/
- public SynchronizeViewWorkbenchPart(ISynchronizeViewPage console, IWorkbenchPartSite site) {
+ public SynchronizeViewWorkbenchPart(ISynchronizeParticipant console, IWorkbenchPartSite site) {
fConsole = console;
fSite = site;
}
@@ -119,7 +119,7 @@ public class SynchronizeViewWorkbenchPart implements IWorkbenchPart {
*
* @return console associated with this part
*/
- protected ISynchronizeViewPage getConsole() {
+ protected ISynchronizeParticipant getConsole() {
return fConsole;
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeViewPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java
index 5bac6c4ea..cf30e0fed 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java
@@ -17,8 +17,9 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
+import org.eclipse.team.ui.TeamUI;
-public abstract class AbstractSynchronizeViewPage implements ISynchronizeViewPage {
+public abstract class AbstractSynchronizeParticipant implements ISynchronizeParticipant {
// property listeners
private ListenerList fListeners;
@@ -31,15 +32,15 @@ public abstract class AbstractSynchronizeViewPage implements ISynchronizeViewPag
* Used to notify this console of lifecycle methods <code>init()</code>
* and <code>dispose()</code>.
*/
- class Lifecycle implements ISynchronizePageListener {
+ class Lifecycle implements ISynchronizeParticipantListener {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
*/
- public void consolesAdded(ISynchronizeViewPage[] consoles) {
+ public void participantsAdded(ISynchronizeParticipant[] consoles) {
for (int i = 0; i < consoles.length; i++) {
- ISynchronizeViewPage console = consoles[i];
- if (console == AbstractSynchronizeViewPage.this) {
+ ISynchronizeParticipant console = consoles[i];
+ if (console == AbstractSynchronizeParticipant.this) {
init();
}
}
@@ -49,11 +50,11 @@ public abstract class AbstractSynchronizeViewPage implements ISynchronizeViewPag
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
*/
- public void consolesRemoved(ISynchronizeViewPage[] consoles) {
+ public void participantsRemoved(ISynchronizeParticipant[] consoles) {
for (int i = 0; i < consoles.length; i++) {
- ISynchronizeViewPage console = consoles[i];
- if (console == AbstractSynchronizeViewPage.this) {
- //ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this);
+ ISynchronizeParticipant console = consoles[i];
+ if (console == AbstractSynchronizeParticipant.this) {
+ TeamUI.getSynchronizeManager().removeSynchronizeParticipantListener(this);
dispose();
}
}
@@ -109,10 +110,10 @@ public abstract class AbstractSynchronizeViewPage implements ISynchronizeViewPag
* @param name console name, cannot be <code>null</code>
* @param imageDescriptor image descriptor, or <code>null</code> if none
*/
- public AbstractSynchronizeViewPage(String name, ImageDescriptor imageDescriptor) {
+ public AbstractSynchronizeParticipant(String name, ImageDescriptor imageDescriptor) {
setName(name);
setImageDescriptor(imageDescriptor);
- //ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(new Lifecycle());
+ TeamUI.getSynchronizeManager().addSynchronizeParticipantListener(new Lifecycle());
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java
index fc718da33..551069620 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java
@@ -13,7 +13,7 @@ package org.eclipse.team.ui.sync;
import org.eclipse.ui.IWorkbenchPage;
/**
- * Manages synchronization pages.
+ * Manages synchronization view participants.
* <p>
* Clients are not intended to implement this interface.
* </p>
@@ -22,44 +22,50 @@ import org.eclipse.ui.IWorkbenchPage;
public interface ISynchronizeManager {
/**
- * Registers the given listener for console notifications. Has
+ * Registers the given listener for participant notifications. Has
* no effect if an identical listener is already registered.
*
* @param listener listener to register
*/
- public void addSynchronizePageListener(ISynchronizePageListener listener);
+ public void addSynchronizeParticipantListener(ISynchronizeParticipantListener listener);
/**
- * Deregisters the given listener for console notifications. Has
+ * Deregisters the given listener for participant notifications. Has
* no effect if an identical listener is not already registered.
*
* @param listener listener to deregister
*/
- public void removeSynchronizePageListener(ISynchronizePageListener listener);
+ public void removeSynchronizeParticipantListener(ISynchronizeParticipantListener listener);
/**
- * Adds the given consoles to the console manager. Has no effect for
- * equivalent consoles already registered. The consoles will be added
- * to any existing console views.
+ * Adds the given participants to the synchronize manager. Has no effect for
+ * equivalent participants are already registered. The participants will be added
+ * to any existing synchronize views.
*
* @param consoles consoles to add
*/
- public void addSynchronizePages(ISynchronizeViewPage[] consoles);
+ public void addSynchronizeParticipants(ISynchronizeParticipant[] consoles);
/**
- * Removes the given consoles from the console manager. If the consoles are
- * being displayed in any console views, the associated pages will be closed.
+ * Removes the given participants from the synchronize manager. If the participants are
+ * being displayed in any synchronize views, the associated pages will be closed.
*
* @param consoles consoles to remove
*/
- public void removeSynchronizePages(ISynchronizeViewPage[] consoles);
+ public void removeSynchronizeParticipants(ISynchronizeParticipant[] consoles);
/**
* Returns a collection of consoles registered with the console manager.
*
* @return a collection of consoles registered with the console manager
*/
- public ISynchronizeViewPage[] getSynchronizePages();
+ public ISynchronizeParticipant[] getSynchronizeParticipants();
- public INewSynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage page);
+ /**
+ * Opens the synchronize view in the given page. Has no effect if the view is
+ * already open in that page.
+ *
+ * @return the opened synchronize view
+ */
+ public ISynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage page);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeViewPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java
index f019aceec..918409561 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeViewPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java
@@ -10,53 +10,62 @@
*******************************************************************************/
package org.eclipse.team.ui.sync;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.ui.part.IPageBookViewPage;
/**
- * A synchronization target provides synchronization between local resources and a
- * remote location that is used to share those resources. The Synchronize View
- * displays synchronize targets.
+ * A synchronize participant provides a logical connection between local resources
+ * and a remote location that is used to share those resources. The Synchronize View
+ * displays synchronize participants.
*
* @since 3.0
*/
-public interface ISynchronizeViewPage {
+public interface ISynchronizeParticipant {
/**
- * Returns the name of this synchronize target.
+ * Returns the unique id that identifies this participant.
*
- * @return the name of this synchronize target
+ * @return returns the unique id that identifies this participant. Cannot
+ * be <code>null</code>.
+ */
+ public QualifiedName getUniqueId();
+
+ /**
+ * Returns the name of this synchronize participant.
+ *
+ * @return the name of this synchronize participant
*/
public String getName();
/**
- * Returns an image descriptor for this synchronize target, or <code>null</code>
+ * Returns an image descriptor for this synchronize participant, or <code>null</code>
* if none.
*
- * @return an image descriptor for this synchronize target, or <code>null</code>
+ * @return an image descriptor for this synchronize participant, or <code>null</code>
* if none
*/
public ImageDescriptor getImageDescriptor();
/**
- * Creates and returns a new page for this synchronize target. The page is displayed
- * for this synchronize target in the given synchronize view.
+ * Creates and returns a new page for this synchronize participant. The page is displayed
+ * for this synchronize participant in the given synchronize view.
*
* @param view the view in which the page is to be created
- * @return a page book view page representation of this synchronize target
+ * @return a page book view page representation of this synchronize participant
*/
- public IPageBookViewPage createPage(INewSynchronizeView view);
+ public IPageBookViewPage createPage(ISynchronizeView view);
/**
- * Adds a listener for changes to properties of this synchronize target.
+ * Adds a listener for changes to properties of this synchronize participant.
* Has no effect if an identical listener is already registered.
* <p>
* The changes supported by the synchronize view are as follows:
* <ul>
* <li><code>IBasicPropertyConstants.P_TEXT</code> - indicates the name
- * of a synchronize target has changed</li>
+ * of a synchronize participant has changed</li>
* <li><code>IBasicPropertyConstants.P_IMAGE</code> - indicates the image
- * of a synchronize target has changed</li>
+ * of a synchronize participant has changed</li>
* </ul>
* </p>
* <p>
@@ -68,7 +77,7 @@ public interface ISynchronizeViewPage {
public void addPropertyChangeListener(IPropertyChangeListener listener);
/**
- * Removes the given property listener from this synchronize target.
+ * Removes the given property listener from this synchronize participant.
* Has no effect if an identical listener is not alread registered.
*
* @param listener a property listener
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizePageListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipantListener.java
index d5195b784..2351dd893 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizePageListener.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipantListener.java
@@ -11,14 +11,14 @@
package org.eclipse.team.ui.sync;
/**
- * A console listener is notified when consoles are added or removed from
- * the console manager.
+ * A synchronize participant listener is notified when participants are added or
+ * removed from the synchronize manager.
* <p>
* Clients may implement this interface.
* </p>
* @since 3.0
*/
-public interface ISynchronizePageListener {
+public interface ISynchronizeParticipantListener {
/**
* Notification the given consoles have been added to the console
@@ -26,7 +26,7 @@ public interface ISynchronizePageListener {
*
* @param consoles added consoles
*/
- public void consolesAdded(ISynchronizeViewPage[] synchronizeTargets);
+ public void participantsAdded(ISynchronizeParticipant[] synchronizeTargets);
/**
* Notification the given consoles have been removed from the
@@ -34,6 +34,6 @@ public interface ISynchronizePageListener {
*
* @param consoles removed consoles
*/
- public void consolesRemoved(ISynchronizeViewPage[] synchronizeTargets);
+ public void participantsRemoved(ISynchronizeParticipant[] synchronizeTargets);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/INewSynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java
index 903188661..7cabe33b2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/INewSynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java
@@ -13,23 +13,35 @@ package org.eclipse.team.ui.sync;
import org.eclipse.ui.IViewPart;
/**
- * A view that displays synchronization targets that are registered with the
- * synchronize view manager.
+ * A view that displays synchronization participants that are registered with the
+ * synchronize manager.
* <p>
* Clients are not intended to implement this interface.
* </p>
*
* @since 3.0
*/
-public interface INewSynchronizeView extends IViewPart {
+public interface ISynchronizeView extends IViewPart {
/**
* The id for this view
*/
public static final String VIEW_ID = "org.eclipse.team.sync.views.SynchronizeView";
+ /**
+ * Displays the given synchronize participant in the Synchronize View. This
+ * has no effect if this participant is already being displayed.
+ *
+ * @param participant participant to be displayed, cannot be <code>null</code>
+ */
+ public void display(ISynchronizeParticipant participant);
- public void display(ISynchronizeViewPage page);
-
- public ISynchronizeViewPage getActivePage();
+ /**
+ * Returns the participant currently being displayed in the Synchronize View
+ * or <code>null</code> if none.
+ *
+ * @return the participant currently being displayed in the Synchronize View
+ * or <code>null</code> if none
+ */
+ public ISynchronizeParticipant getParticipant();
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SubscriberPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java
index 867035d54..8f46d44d2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SubscriberPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java
@@ -1,6 +1,7 @@
package org.eclipse.team.ui.sync;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.core.subscribers.TeamSubscriber;
@@ -14,7 +15,7 @@ import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.part.IPageBookViewPage;
-public class SubscriberPage extends AbstractSynchronizeViewPage {
+public class TeamSubscriberParticipant extends AbstractSynchronizeParticipant {
private SubscriberInput input;
private SubscriberSynchronizeViewPage page;
@@ -58,16 +59,23 @@ public class SubscriberPage extends AbstractSynchronizeViewPage {
public static final String MB_MODESGROUP = TeamUIPlugin.ID + ".modes";
- public SubscriberPage(TeamSubscriber subscriber, String name, ImageDescriptor imageDescriptor) {
+ public TeamSubscriberParticipant(TeamSubscriber subscriber, String name, ImageDescriptor imageDescriptor) {
super(name, imageDescriptor);
this.input = new SubscriberInput(subscriber);
this.currentMode = BOTH_MODE;
}
/* (non-Javadoc)
+ * @see org.eclipse.team.ui.sync.ISynchronizeParticipant#getUniqueId()
+ */
+ public QualifiedName getUniqueId() {
+ return input.getSubscriber().getId();
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeViewPage#createPage(org.eclipse.team.ui.sync.ISynchronizeView)
*/
- public IPageBookViewPage createPage(INewSynchronizeView view) {
+ public IPageBookViewPage createPage(ISynchronizeView view) {
this.page = new SubscriberSynchronizeViewPage(this, view, input);
return page;
}
@@ -77,7 +85,7 @@ public class SubscriberPage extends AbstractSynchronizeViewPage {
}
public SubscriberInput getInput() {
- return page.getInput();
+ return input;
}
public void setMode(int mode) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ComparisonCriteriaActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ComparisonCriteriaActionGroup.java
index 51b652127..f5ab60e3c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ComparisonCriteriaActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ComparisonCriteriaActionGroup.java
@@ -23,7 +23,7 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
/**
* This action group allows the user to choose one or more comparison critera
@@ -93,7 +93,7 @@ public class ComparisonCriteriaActionGroup extends Action implements IMenuCreato
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
public void update() {
- ISynchronizeViewPage[] pages = TeamUI.getSynchronizeManager().getSynchronizePages();
+ ISynchronizeParticipant[] pages = TeamUI.getSynchronizeManager().getSynchronizeParticipants();
setEnabled(pages.length >= 1);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java
index fd0f03e5b..b183c8189 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/DirectionFilterActionGroup.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.sync.SubscriberPage;
+import org.eclipse.team.ui.sync.TeamSubscriberParticipant;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.ActionGroup;
@@ -35,7 +35,7 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
private DirectionFilterAction outgoingMode;
private DirectionFilterAction bothMode;
private DirectionFilterAction conflictsMode;
- private SubscriberPage page;
+ private TeamSubscriberParticipant page;
private int supportedModes;
@@ -66,7 +66,7 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
}
}
- public DirectionFilterActionGroup(SubscriberPage page, int supportedModes) {
+ public DirectionFilterActionGroup(TeamSubscriberParticipant page, int supportedModes) {
this.supportedModes = supportedModes;
this.page = page;
createActions();
@@ -79,23 +79,23 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
*/
private void createActions() {
// Create the actions
- if((supportedModes & SubscriberPage.INCOMING_MODE) != 0) {
- incomingMode = new DirectionFilterAction("action.directionFilterIncoming.", "org.eclipse.team.ui.syncview.incomingFilter", SubscriberPage.INCOMING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
+ if((supportedModes & TeamSubscriberParticipant.INCOMING_MODE) != 0) {
+ incomingMode = new DirectionFilterAction("action.directionFilterIncoming.", "org.eclipse.team.ui.syncview.incomingFilter", TeamSubscriberParticipant.INCOMING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
actions.add(incomingMode);
}
- if((supportedModes & SubscriberPage.OUTGOING_MODE) != 0) {
- outgoingMode = new DirectionFilterAction("action.directionFilterOutgoing.", "org.eclipse.team.ui.syncview.outgoingFilter", SubscriberPage.OUTGOING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
+ if((supportedModes & TeamSubscriberParticipant.OUTGOING_MODE) != 0) {
+ outgoingMode = new DirectionFilterAction("action.directionFilterOutgoing.", "org.eclipse.team.ui.syncview.outgoingFilter", TeamSubscriberParticipant.OUTGOING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
actions.add(outgoingMode);
}
- if((supportedModes & SubscriberPage.BOTH_MODE) != 0) {
- bothMode = new DirectionFilterAction("action.directionFilterBoth.", "org.eclipse.team.ui.syncview.bothFilter", SubscriberPage.BOTH_MODE); //$NON-NLS-1$ //$NON-NLS-2$
+ if((supportedModes & TeamSubscriberParticipant.BOTH_MODE) != 0) {
+ bothMode = new DirectionFilterAction("action.directionFilterBoth.", "org.eclipse.team.ui.syncview.bothFilter", TeamSubscriberParticipant.BOTH_MODE); //$NON-NLS-1$ //$NON-NLS-2$
actions.add(bothMode);
}
- if((supportedModes & SubscriberPage.CONFLICTING_MODE) != 0) {
- conflictsMode = new DirectionFilterAction("action.directionFilterConflicts.", "org.eclipse.team.ui.syncview.conflictsFilter", SubscriberPage.CONFLICTING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
+ if((supportedModes & TeamSubscriberParticipant.CONFLICTING_MODE) != 0) {
+ conflictsMode = new DirectionFilterAction("action.directionFilterConflicts.", "org.eclipse.team.ui.syncview.conflictsFilter", TeamSubscriberParticipant.CONFLICTING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
actions.add(conflictsMode);
}
}
@@ -131,7 +131,7 @@ public class DirectionFilterActionGroup extends ActionGroup implements IProperty
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
- if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_MODE)) {
+ if(event.getProperty().equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_MODE)) {
Integer mode = (Integer)event.getNewValue();
checkMode(mode.intValue());
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RemoveSynchronizeViewPageAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RemoveSynchronizeViewPageAction.java
index 7271f51ba..e87be90d3 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RemoveSynchronizeViewPageAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/RemoveSynchronizeViewPageAction.java
@@ -13,17 +13,17 @@ package org.eclipse.team.ui.sync.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
public class RemoveSynchronizeViewPageAction extends Action {
- private ISynchronizeViewPage page;
+ private ISynchronizeParticipant page;
- public RemoveSynchronizeViewPageAction(ISynchronizeViewPage page) {
+ public RemoveSynchronizeViewPageAction(ISynchronizeParticipant page) {
this.page = page;
Utils.initAction(this, "action.removePage."); //$NON-NLS-1$
}
public void run() {
- TeamUI.getSynchronizeManager().removeSynchronizePages(new ISynchronizeViewPage[] {page});
+ TeamUI.getSynchronizeManager().removeSynchronizeParticipants(new ISynchronizeParticipant[] {page});
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewLayoutAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewLayoutAction.java
index df04bfc6c..44df96081 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewLayoutAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/ToggleViewLayoutAction.java
@@ -15,17 +15,17 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.sync.SubscriberPage;
+import org.eclipse.team.ui.sync.TeamSubscriberParticipant;
public class ToggleViewLayoutAction extends Action implements IPropertyChangeListener {
private int layout;
- private SubscriberPage page;
+ private TeamSubscriberParticipant page;
- public ToggleViewLayoutAction(SubscriberPage page, int layout) {
+ public ToggleViewLayoutAction(TeamSubscriberParticipant page, int layout) {
super(null, SWT.RADIO);
this.page = page;
this.layout = layout;
- if(layout == SubscriberPage.TABLE_LAYOUT) {
+ if(layout == TeamSubscriberParticipant.TABLE_LAYOUT) {
Utils.initAction(this, "action.toggleViewFlat."); //$NON-NLS-1$
} else {
Utils.initAction(this, "action.toggleViewHierarchical."); //$NON-NLS-1$
@@ -42,7 +42,7 @@ public class ToggleViewLayoutAction extends Action implements IPropertyChangeLis
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
- if(event.getProperty().equals(SubscriberPage.P_SYNCVIEWPAGE_LAYOUT)) {
+ if(event.getProperty().equals(TeamSubscriberParticipant.P_SYNCVIEWPAGE_LAYOUT)) {
Integer newLayout = (Integer)event.getNewValue();
setChecked(newLayout.intValue() == layout);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetFilterActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetFilterActionGroup.java
index 992cfa232..8921eb4fc 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetFilterActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/actions/workingsets/WorkingSetFilterActionGroup.java
@@ -23,8 +23,8 @@ import org.eclipse.jface.util.Assert;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.ui.sync.INewSynchronizeView;
-import org.eclipse.team.ui.sync.ISynchronizeViewPage;
+import org.eclipse.team.ui.sync.ISynchronizeView;
+import org.eclipse.team.ui.sync.ISynchronizeParticipant;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
@@ -53,9 +53,9 @@ public class WorkingSetFilterActionGroup extends ActionGroup {
private IMenuManager menuManager;
private IMenuListener menuListener;
- private ISynchronizeViewPage page;
+ private ISynchronizeParticipant page;
- private INewSynchronizeView view;
+ private ISynchronizeView view;
/**
* Creates a new instance of the receiver
@@ -64,7 +64,7 @@ public class WorkingSetFilterActionGroup extends ActionGroup {
* @param workingSetUpdater property change listener notified when a
* working set is set
*/
- public WorkingSetFilterActionGroup(Shell shell, IPropertyChangeListener workingSetUpdater, INewSynchronizeView view, ISynchronizeViewPage page) {
+ public WorkingSetFilterActionGroup(Shell shell, IPropertyChangeListener workingSetUpdater, ISynchronizeView view, ISynchronizeParticipant page) {
this.view = view;
this.page = page;
Assert.isNotNull(shell);

Back to the top