Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-29 02:45:02 +0000
committerJean Michel-Lemieux2003-10-29 02:45:02 +0000
commit8941beb62da837d4d1b1ec15ec7c78b7b22b248c (patch)
treef4248cd4d1d83064f72369e027f335b20df0a7b9
parent68c88c6452585be2194ce17633393b00b2211fdd (diff)
downloadeclipse.platform.team-8941beb62da837d4d1b1ec15ec7c78b7b22b248c.tar.gz
eclipse.platform.team-8941beb62da837d4d1b1ec15ec7c78b7b22b248c.tar.xz
eclipse.platform.team-8941beb62da837d4d1b1ec15ec7c78b7b22b248c.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriber.java24
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java7
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SubscriberManager.java229
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java40
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java55
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java5
-rw-r--r--bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd57
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java163
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java5
12 files changed, 176 insertions, 430 deletions
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 b53e48da8..53a04f27c 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
@@ -14,10 +14,7 @@ import java.util.ArrayList;
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.core.runtime.*;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteResource;
@@ -272,23 +269,4 @@ abstract public class TeamSubscriber {
public SyncInfo[] getAllOutOfSync(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException {
return null;
}
-
- /**
- * 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
- */
- public boolean equals(Object object) {
- if (object instanceof TeamSubscriber) {
- TeamSubscriber subscriber = (TeamSubscriber) object;
- return getId().equals(subscriber.getId());
- }
- return super.equals(object);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getId().hashCode();
- }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java
index 82bf0d998..b932844b7 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/DefaultFileModificationValidator.java
@@ -22,9 +22,10 @@ public class DefaultFileModificationValidator implements IFileModificationValida
private static final Status OK = Team.OK_STATUS;
private IStatus getDefaultStatus(IFile file) {
- return file.isReadOnly()
- ? new Status(Status.ERROR, TeamPlugin.ID, IResourceStatus.READ_ONLY_LOCAL, Policy.bind("FileModificationValidator.fileIsReadOnly", file.getFullPath().toString()), null) //$NON-NLS-1$
- : OK;
+// return file.isReadOnly()
+// ? new Status(Status.ERROR, TeamPlugin.ID, IResourceStatus.READ_ONLY_LOCAL, Policy.bind("FileModificationValidator.fileIsReadOnly", file.getFullPath().toString()), null) //$NON-NLS-1$
+// : OK;
+ return OK;
}
/**
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
deleted file mode 100644
index c4ee32594..000000000
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SubscriberManager.java
+++ /dev/null
@@ -1,229 +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.core;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.ISaveContext;
-import org.eclipse.core.resources.ISaveParticipant;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.ISafeRunnable;
-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.ITeamResourceChangeListener;
-import org.eclipse.team.core.subscribers.TeamDelta;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
-import org.eclipse.team.core.subscribers.TeamSubscriberFactory;
-
-/**
- * This class provides the private implementation of <code>ISubscriberManager</code>.
- */
-public class SubscriberManager implements ISaveParticipant {
-
- private static String SUBSCRIBER_EXTENSION = "subscriber"; //$NON-NLS-1$
- final static private String SAVECTX_SUBSCRIBERS = "subscribers"; //$NON-NLS-1$
- final static private String SAVECTX_SUBSCRIBER = "subscriber"; //$NON-NLS-1$
- final static private String SAVECTX_QUALIFIER = "qualifier"; //$NON-NLS-1$
- final static private String SAVECTX_LOCALNAME = "localName"; //$NON-NLS-1$
-
- private Map subscribers = new HashMap();
- private List listeners = new ArrayList(1);
- private Map factories = new HashMap();
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISubscriberManager#getSubscriber(org.eclipse.core.runtime.QualifiedName)
- */
- public TeamSubscriber getSubscriber(QualifiedName id) {
- synchronized(subscribers) {
- TeamSubscriber s = (TeamSubscriber)subscribers.get(id);
- return s;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISubscriberManager#getSubscribers()
- */
- public TeamSubscriber[] getSubscribers() {
- synchronized(subscribers) {
- return (TeamSubscriber[])subscribers.values().toArray(
- new TeamSubscriber[subscribers.size()]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISubscriberManager#addTeamResourceChangeListener(org.eclipse.team.core.subscribers.ITeamResourceChangeListener)
- */
- public void addTeamResourceChangeListener(ITeamResourceChangeListener listener) {
- synchronized(listener) {
- listeners.add(listener);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISubscriberManager#removeTeamResourceChangeListener(org.eclipse.team.core.subscribers.ITeamResourceChangeListener)
- */
- public void removeTeamResourceChangeListener(ITeamResourceChangeListener listener) {
- synchronized(listener) {
- listeners.remove(listener);
- }
- }
-
- public void doneSaving(ISaveContext context) {
- }
-
- public void prepareToSave(ISaveContext context) throws CoreException {
- }
-
- public void rollback(ISaveContext context) {
- }
-
- public void saving(ISaveContext context) throws CoreException {
- // save subscribers during snapshot and at full save
- //saveSubscribers();
- }
-
- public void startup() {
- }
-
- /*
- * Fires a team resource change event to all registered listeners
- * Only listeners registered at the time this method is called are notified.
- */
- protected void fireTeamResourceChange(TeamDelta[] deltas) {
- ITeamResourceChangeListener[] allListeners;
- // Copy the listener list so we're not calling client code while synchronized
- synchronized(listeners) {
- allListeners = (ITeamResourceChangeListener[]) listeners.toArray(new ITeamResourceChangeListener[listeners.size()]);
- }
- fireTeamResourceChange(allListeners, deltas);
- }
-
- public void fireTeamResourceChange(ITeamResourceChangeListener[] listeners, final TeamDelta[] deltas) {
- // Notify the listeners safely so all will receive notification
- for (int i = 0; i < listeners.length; i++) {
- final ITeamResourceChangeListener listener = listeners[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);
-
- }
- });
- }
- }
-
- synchronized void restoreSubscribers() {
-// try {
-// SaveContext root = SaveContextXMLWriter.readXMLPluginMetaFile(TeamPlugin.getPlugin(), "subscribers"); //$NON-NLS-1$
-// if(root != null && root.getName().equals(SAVECTX_SUBSCRIBERS)) {
-// SaveContext[] contexts = root.getChildren();
-// for (int i = 0; i < contexts.length; i++) {
-// SaveContext context = contexts[i];
-// if(context.getName().equals(SAVECTX_SUBSCRIBER)) {
-// String qualifier = context.getAttribute(SAVECTX_QUALIFIER);
-// String localName = context.getAttribute(SAVECTX_LOCALNAME);
-// TeamSubscriberFactory factory = create(qualifier);
-// if(factory == null) {
-// TeamPlugin.log(new TeamException(Policy.bind("TeamProvider.10", qualifier.toString()))); //$NON-NLS-1$
-// }
-// SaveContext[] children = context.getChildren();
-// if(children.length == 1) {
-// TeamSubscriber s = factory.restoreSubscriber(new QualifiedName(qualifier, localName), children[0]);
-// if(s != null) {
-// //registerSubscriber(s);
-// }
-// }
-// }
-// }
-//
-// }
-// } catch (TeamException e) {
-// TeamPlugin.log(e);
-// }
- }
-
- synchronized void saveSubscribers() {
- SaveContext root = new SaveContext();
- root.setName(SAVECTX_SUBSCRIBERS);
- List children = new ArrayList();
- try {
- for (Iterator it = subscribers.values().iterator(); it.hasNext();) {
- TeamSubscriber subscriber = (TeamSubscriber) it.next();
- String qualifier = subscriber.getId().getQualifier();
- TeamSubscriberFactory factory = create(qualifier);
- if(factory == null) {
- TeamPlugin.log(new TeamException(Policy.bind("TeamProvider.11", qualifier))); //$NON-NLS-1$
- }
- SaveContext child = factory.saveSubscriber(subscriber);
- if(child != null) {
- SaveContext item = new SaveContext();
- item.putChild(child);
- item.setName(SAVECTX_SUBSCRIBER);
- Map attributes = new HashMap();
- attributes.put(SAVECTX_QUALIFIER, subscriber.getId().getQualifier());
- attributes.put(SAVECTX_LOCALNAME, subscriber.getId().getLocalName());
- item.setAttributes(attributes);
- children.add(item);
- }
- }
- root.setChildren((SaveContext[])children.toArray(new SaveContext[children.size()]));
- SaveContextXMLWriter.writeXMLPluginMetaFile(TeamPlugin.getPlugin(), "subscribers", root); //$NON-NLS-1$
- } catch (TeamException e) {
- TeamPlugin.log(e);
- }
- }
-
- private TeamSubscriberFactory create(String id) {
- TeamSubscriberFactory sFactory = (TeamSubscriberFactory)factories.get(id);
- if(sFactory != null) {
- return sFactory;
- }
-
- TeamPlugin plugin = TeamPlugin.getPlugin();
- if (plugin != null) {
- IExtensionPoint extension = plugin.getDescriptor().getExtensionPoint(SUBSCRIBER_EXTENSION);
- if (extension != null) {
- IExtension[] extensions = extension.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
- for (int j = 0; j < configElements.length; j++) {
- try {
- //Its ok not to have a typeClass extension. In this case, a default instance will be created.
- if(configElements[j].getAttribute("class") != null) { //$NON-NLS-1$
- sFactory = (TeamSubscriberFactory) configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
- }
- factories.put(sFactory.getID(), sFactory);
- return sFactory;
- } catch (CoreException e) {
- TeamPlugin.log(e);
- } catch (ClassCastException e) {
- String className = configElements[j].getAttribute("class"); //$NON-NLS-1$
- TeamPlugin.log(IStatus.ERROR, Policy.bind("RepositoryProviderType.invalidClass", id.toString(), className), e); //$NON-NLS-1$
- }
- return null;
- }
- }
- }
- }
- return null;
- }
-}
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 b79356c0e..dc41ef954 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
@@ -10,32 +10,13 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.core;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.team.core.*;
import org.eclipse.team.core.ISaveContext;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.ContentComparisonCriteria;
-import org.eclipse.team.core.subscribers.ITeamResourceChangeListener;
-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.*;
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;
@@ -181,10 +162,8 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
/* (non-Javadoc)
* @see org.eclipse.team.core.subscribers.TeamSubscriber#saveState(org.eclipse.team.internal.core.SaveContext)
*/
- public SaveContext saveState() {
+ public void saveState(ISaveContext state) {
// start and end tags
- SaveContext state = new SaveContext();
- state.setName("merge"); //$NON-NLS-1$
state.putString("startTag", start.getName()); //$NON-NLS-1$
state.putInteger("startTagType", start.getType()); //$NON-NLS-1$
state.putString("endTag", end.getName()); //$NON-NLS-1$
@@ -200,15 +179,10 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
ctxRoots[i].putString("fullpath", element.getFullPath().toString()); //$NON-NLS-1$
}
state.setChildren(ctxRoots);
- return state;
}
- public static CVSMergeSubscriber restore(QualifiedName id, SaveContext saveContext) throws CVSException {
+ public static CVSMergeSubscriber restore(QualifiedName id, ISaveContext saveContext) throws CVSException {
String name = saveContext.getName();
- if(! name.equals("merge")) { //$NON-NLS-1$
- throw new CVSException(Policy.bind("CVSMergeSubscriber.13", name)); //$NON-NLS-1$
- }
-
CVSTag start = new CVSTag(saveContext.getString("startTag"), saveContext.getInteger("startTagType")); //$NON-NLS-1$ //$NON-NLS-2$
CVSTag end = new CVSTag(saveContext.getString("endTag"), saveContext.getInteger("endTagType")); //$NON-NLS-1$ //$NON-NLS-2$
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 18a43b8c7..d5966def2 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
@@ -53,6 +53,7 @@ import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticip
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.synchronize.ISynchronizeParticipant;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkingSet;
@@ -697,6 +698,11 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* @return Returns the cvsWorkspaceSynchronizeViewPage.
*/
public WorkspaceSynchronizeParticipant getCvsWorkspaceSynchronizeParticipant() {
- return (WorkspaceSynchronizeParticipant)TeamUI.getSynchronizeManager().find(WorkspaceSynchronizeParticipant.ID, null);
+ ISynchronizeParticipant[] instances = TeamUI.getSynchronizeManager().find(WorkspaceSynchronizeParticipant.ID);
+ if(instances.length == 1) {
+ return (WorkspaceSynchronizeParticipant)instances[0];
+ } else {
+ return null;
+ }
}
-}
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
index a838d41a0..0e124a527 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
@@ -11,13 +11,12 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.team.core.TeamException;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.team.core.ISaveContext;
import org.eclipse.team.core.subscribers.TeamSubscriber;
+import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.core.SaveContext;
-import org.eclipse.team.internal.core.SaveContextXMLWriter;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.synchronize.sets.SubscriberInput;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
@@ -27,6 +26,9 @@ import org.eclipse.ui.part.IPageBookViewPage;
public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
+ private final static String CTX_QUALIFIER = "qualifier";
+ private final static String CTX_LOCALNAME = "localname";
+
public MergeSynchronizeParticipant() {
super();
}
@@ -35,7 +37,9 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
super();
setSubscriber(subscriber);
}
-
+
+
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.TeamSubscriberParticipant#setSubscriber(org.eclipse.team.core.subscribers.TeamSubscriber)
*/
@@ -52,28 +56,29 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#init(org.eclipse.team.ui.sync.ISynchronizeView, org.eclipse.team.core.ISaveContext)
*/
- public void init(String instanceid) throws PartInitException {
- SaveContext ctx; //$NON-NLS-1$
+ public void restoreState(ISaveContext context) throws PartInitException {
+ String qualifier = context.getAttribute(CTX_QUALIFIER);
+ String localname = context.getAttribute(CTX_LOCALNAME);
+ if(qualifier == null || localname == null) {
+ throw new PartInitException("Missing id initializing cvs merge participant");
+ }
try {
- ctx = SaveContextXMLWriter.readXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(id.getLocalName()));
- setSubscriber(CVSMergeSubscriber.restore(id, ctx));
- } catch (TeamException e) {
- TeamUIPlugin.log(e);
+ setSubscriber(CVSMergeSubscriber.restore(new QualifiedName(qualifier, localname), context));
+ } catch (CVSException e) {
+ throw new PartInitException("Unable to initialize cvs merge subscriber", e);
}
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#saveState(org.eclipse.team.core.ISaveContext)
*/
- public void saveState(int instanceid) {
+ public void saveState(ISaveContext context) {
SubscriberInput input = getInput();
- CVSMergeSubscriber s =(CVSMergeSubscriber)input.getSubscriber();
- SaveContext ctx = s.saveState();
- try {
- SaveContextXMLWriter.writeXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(getId().getLocalName()), ctx); //$NON-NLS-1$
- } catch (TeamException e) {
- TeamUIPlugin.log(e);
- }
+ CVSMergeSubscriber s = (CVSMergeSubscriber)input.getSubscriber();
+ QualifiedName sId = s.getId();
+ context.addAttribute(CTX_QUALIFIER, sId.getQualifier());
+ context.addAttribute(CTX_LOCALNAME, sId.getLocalName());
+ s.saveState(context);
}
/* (non-Javadoc)
@@ -82,11 +87,6 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
protected void dispose() {
super.dispose();
((CVSMergeSubscriber)getInput().getSubscriber()).cancel();
- SaveContextXMLWriter.deleteXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(getId().getLocalName())); //$NON-NLS-1$
- }
-
- private String getMetaFileName(String id) {
- return "mergeSyncPartners" + id + ".xml"; //$NON-NLS-1$ //$NON-NLS-2$
}
/* (non-Javadoc)
@@ -95,4 +95,11 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
public IPageBookViewPage createPage(ISynchronizeView view) {
return new MergeSynchronizePage(this, view, getInput());
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#getName()
+ */
+ public String getName() {
+ return ((CVSMergeSubscriber)getInput().getSubscriber()).getName();
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index 8b67a11fc..627a05251 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
+import org.eclipse.team.core.ISaveContext;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
@@ -24,7 +25,7 @@ public class WorkspaceSynchronizeParticipant extends TeamSubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#init(org.eclipse.team.ui.sync.ISynchronizeView, org.eclipse.team.core.ISaveContext)
*/
- public void init(String id) throws PartInitException {
+ public void restoreState(ISaveContext context) throws PartInitException {
TeamSubscriber subscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
setSubscriber(subscriber);
}
@@ -32,7 +33,7 @@ public class WorkspaceSynchronizeParticipant extends TeamSubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#saveState(org.eclipse.team.core.ISaveContext)
*/
- public void saveState(int instanceid) {
+ public void saveState(ISaveContext context) {
// no state to save
}
diff --git a/bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd b/bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd
index 6c70ba491..c834e81d1 100644
--- a/bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd
+++ b/bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd
@@ -6,9 +6,10 @@
<meta.schema plugin="org.eclipse.team.ui" id="synchronizeParticipants" name="Synchronize View Participants"/>
</appInfo>
<documentation>
- This extension point is used to a synchronize participant with the Synchronize View. 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.
+ This extension point is used to register a synchronize participant with the Synchronize View. 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.
&lt;p&gt;
-Providers may provide an extension for this extension point, and an implementation of &lt;samp&gt;org.eclipse.team.ui.synchronize.ISynchronizeParticipant&lt;/samp&gt;.
+Providers may provide an extension for this extension point, and an implementation of &lt;samp&gt;org.eclipse.team.ui.synchronize.ISynchronizeParticipant&lt;/samp&gt;.
+&lt;/p&gt;
</documentation>
</annotation>
@@ -50,31 +51,31 @@ Providers may provide an extension for this extension point, and an implementati
</documentation>
</annotation>
</attribute>
- <attribute name="class" type="string">
+ <attribute name="id" type="string">
<annotation>
<documentation>
- A fully qualified name of the class the implements &lt;samp&gt;org.eclipse.team.ui.synchronize.ISynchronizeParticipant&lt;/samp&gt;. A common practice is to subclass &lt;samp&gt;org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant&lt;/samp&gt; in order to inherit some of the default functionality. In addition, it is recommended to subclass &lt;samp&gt;org.eclipse.team.ui.synchronize.TeamSubscriberParticipant&lt;/samp&gt; to benefit from a full featured participant based on the &lt;samp&gt;org.eclipse.team.core.TeamSubscriber&lt;/samp&gt; implementation.
+ A unique name that will be used to identify this type of participant.
</documentation>
</annotation>
</attribute>
- <attribute name="type" type="string">
+ <attribute name="class" type="string">
<annotation>
<documentation>
- A value identifying the type of participant. Possible values are &lt;samp&gt;static&lt;/samp&gt; if the participant is to be created automatically by the Team plugin or &lt;samp&gt;dynamic&lt;/samp&gt; if the participant will be created and registered with the Synchronize Manager at some other time.
+ A fully qualified name of the class the implements &lt;samp&gt;org.eclipse.team.ui.synchronize.ISynchronizeParticipant&lt;/samp&gt;. A common practice is to subclass &lt;samp&gt;org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant&lt;/samp&gt; in order to inherit some of the default functionality. In addition, it is recommended to subclass &lt;samp&gt;org.eclipse.team.ui.synchronize.TeamSubscriberParticipant&lt;/samp&gt; to benefit from a full featured participant based on the &lt;samp&gt;org.eclipse.team.core.TeamSubscriber&lt;/samp&gt; implementation.
</documentation>
</annotation>
</attribute>
- <attribute name="qualified_name" type="string">
+ <attribute name="type" type="string">
<annotation>
<documentation>
- A unique name that will be used to identify this type of participant.
+ A value identifying the type of participant. Possible values are &lt;samp&gt;static&lt;/samp&gt; if the participant is to be created automatically by the Team plugin or &lt;samp&gt;dynamic&lt;/samp&gt; if the participant will be created and registered with the Synchronize Manager at some other time.
</documentation>
</annotation>
</attribute>
- <attribute name="local_name" type="string">
+ <attribute name="name" type="string">
<annotation>
<documentation>
- A unique identifier
+ The name of the participant. This will be shown in the UI.
</documentation>
</annotation>
</attribute>
@@ -96,23 +97,20 @@ Providers may provide an extension for this extension point, and an implementati
</appInfo>
<documentation>
&lt;extension
- point=&quot;org.eclipse.team.ui.synchronizeParticipants&quot;&gt;
- &lt;participant
- name=&quot;CVS Workspace&quot;
- icon=&quot;icons/full/cview16/server.gif&quot;
- class=&quot;org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant&quot;
- type=&quot;static&quot;
- qualified_name=&quot;org.eclipse.team.cvs.ui.cvsworkspace-participant&quot;
- local_name=&quot;syncparticipant&quot;&gt;
- &lt;/participant&gt;
- &lt;participant
- name=&quot;CVS Merge&quot;
- icon=&quot;icons/full/obj16/prjversions_rep.gif&quot;
- class=&quot;org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant&quot;
- type=&quot;dynamic&quot;
- qualified_name=&quot;org.eclipse.team.cvs.ui.cvsmerge-participant&quot;
- local_name=&quot;unknown&quot;&gt;
- &lt;/participant&gt;
+point=&quot;org.eclipse.team.ui.synchronizeParticipants&quot;&gt;
+&lt;participant
+name=&quot;CVS Workspace&quot;
+icon=&quot;icons/full/cview16/server.gif&quot; class=&quot;org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant&quot;
+type=&quot;static&quot;
+id=&quot;org.eclipse.team.cvs.ui.cvsworkspace-participant&quot;&gt;
+&lt;/participant&gt;
+&lt;participant
+name=&quot;CVS Merge&quot;
+icon=&quot;icons/full/obj16/prjversions_rep.gif&quot;
+class=&quot;org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant&quot;
+type=&quot;dynamic&quot;
+id=&quot;org.eclipse.team.cvs.ui.cvsmerge-participant&quot;&gt;
+&lt;/participant&gt;
&lt;/extension&gt;
</documentation>
</annotation>
@@ -122,8 +120,7 @@ Providers may provide an extension for this extension point, and an implementati
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
- The value of the &lt;samp&gt;class&lt;/samp&gt; attribute must represent a class that implements &lt;samp&gt;org.eclipse.team.ui.synchronize.ISynchronizeView&lt;/samp&gt;.
-Refer to the
+ The value of the &lt;samp&gt;class&lt;/samp&gt; attribute must represent a class that implements &lt;samp&gt;org.eclipse.team.ui.synchronize.ISynchronizeView&lt;/samp&gt;.
</documentation>
</annotation>
@@ -132,7 +129,7 @@ Refer to the
<meta.section type="implementation"/>
</appInfo>
<documentation>
- [Enter information about supplied implementation of this extension point.]
+
</documentation>
</annotation>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
index 7353ead4a..cba004925 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
@@ -10,40 +10,19 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.team.core.ISaveContext;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.core.SaveContext;
import org.eclipse.team.internal.core.SaveContextXMLWriter;
-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.internal.ui.registry.ISynchronizeParticipantDescriptor;
-import org.eclipse.team.internal.ui.registry.SynchronizeParticipantDescriptor;
-import org.eclipse.team.internal.ui.registry.SynchronizeParticipantRegistry;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.registry.*;
import org.eclipse.team.ui.ITeamUIConstants;
-import org.eclipse.team.ui.synchronize.ISynchronizeManager;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipantListener;
-import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.WorkbenchException;
+import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.ui.*;
/**
* Manages the registered synchronize participants. It handles notification
@@ -62,7 +41,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/**
* List of registered synchronize view pages
- * {String id -> List participant instances}
+ * {String id -> List participant instances}}
*/
private Map synchronizeParticipants = new HashMap(10);
private SynchronizeParticipantRegistry participantRegistry = new SynchronizeParticipantRegistry();
@@ -75,11 +54,8 @@ public class SynchronizeManager implements ISynchronizeManager {
private final static String CTX_PARTICIPANTS = "syncparticipants"; //$NON-NLS-1$
private final static String CTX_PARTICIPANT = "participant"; //$NON-NLS-1$
private final static String CTX_ID = "id"; //$NON-NLS-1$
- private final static String CTX_INSTANCE_ID = "id"; //$NON-NLS-1$
+ private final static String CTX_PARTICIPANT_DATA = "data"; //$NON-NLS-1$
private final static String FILENAME = "syncParticipants.xml"; //$NON-NLS-1$
-
- public final static String DUMMY_INSTANCE_ID = "placeholder"; //$NON-NLS-1$
-
/**
* Notifies a participant listeners of additions or removals
@@ -163,17 +139,27 @@ public class SynchronizeManager implements ISynchronizeManager {
List added = new ArrayList(participants.length);
for (int i = 0; i < participants.length; i++) {
ISynchronizeParticipant participant = participants[i];
- if (!synchronizeParticipants.containsValue(participant)) {
- synchronizeParticipants.put(participant.getId(), participant);
- added.add(participant);
- }
- }
+ addParticipant(participant);
+ added.add(participant);
+ }
if (!added.isEmpty()) {
saveState();
fireUpdate((ISynchronizeParticipant[])added.toArray(new ISynchronizeParticipant[added.size()]), ADDED);
}
}
+ private synchronized void addParticipant(ISynchronizeParticipant participant) {
+ String id = participant.getId();
+ List instances = (List)synchronizeParticipants.get(id);
+ if(instances == null) {
+ instances = new ArrayList(2);
+ synchronizeParticipants.put(id, instances);
+ }
+ if(! instances.contains(participant)) {
+ instances.add(participant);
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeManager#removeSynchronizeParticipants(org.eclipse.team.ui.sync.ISynchronizeParticipant[])
*/
@@ -181,7 +167,7 @@ public class SynchronizeManager implements ISynchronizeManager {
List removed = new ArrayList(participants.length);
for (int i = 0; i < participants.length; i++) {
ISynchronizeParticipant participant = participants[i];
- if (synchronizeParticipants.remove(participant.getId()) != null) {
+ if (removeParticipant(participant)) {
removed.add(participant);
}
}
@@ -191,18 +177,40 @@ public class SynchronizeManager implements ISynchronizeManager {
}
}
+ private synchronized boolean removeParticipant(ISynchronizeParticipant participant) {
+ boolean removed = false;
+ String id = participant.getId();
+ List instances = (List)synchronizeParticipants.get(id);
+ if(instances != null) {
+ removed = instances.remove(participant);
+ if(instances.isEmpty()) {
+ synchronizeParticipants.remove(id);
+ }
+ }
+ return removed;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeManager#getSynchronizeParticipants()
*/
public synchronized ISynchronizeParticipant[] getSynchronizeParticipants() {
- return (ISynchronizeParticipant[])synchronizeParticipants.values().toArray(new ISynchronizeParticipant[synchronizeParticipants.size()]);
+ List participants = new ArrayList();
+ for (Iterator it = synchronizeParticipants.values().iterator(); it.hasNext();) {
+ List instances = (List) it.next();
+ participants.addAll(instances);
+ }
+ return (ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeManager#find(java.lang.String)
*/
- public ISynchronizeParticipant find(String id, String instance_id) {
- return (ISynchronizeParticipant)synchronizeParticipants.get(id);
+ public ISynchronizeParticipant[] find(String id) {
+ List participants = (List)synchronizeParticipants.get(id);
+ if(participants == null) {
+ return null;
+ }
+ return (ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]);
}
/**
@@ -253,30 +261,34 @@ public class SynchronizeManager implements ISynchronizeManager {
// Initialize the participant registry - reads all participant extension descriptions.
participantRegistry.readRegistry(Platform.getPluginRegistry(), TeamUIPlugin.ID, ITeamUIConstants.PT_SYNCPARTICIPANTS);
- // Instantiate and register any participants saved from a previous session.
- restoreSynchronizeParticipants();
+ // Instantiate and register any dynamic participants saved from a previous session.
+ restoreDynamicParticipants();
- // Instantiate and register any static participant that has not already been created.
- SynchronizeParticipantDescriptor[] desc = participantRegistry.getSynchronizeParticipants();
- List participants = new ArrayList();
- for (int i = 0; i < desc.length; i++) {
- SynchronizeParticipantDescriptor descriptor = desc[i];
- if(descriptor.isStatic() && ! synchronizeParticipants.containsKey(descriptor.getId())) {
- participants.add(createParticipant(descriptor.getId(), descriptor));
- }
- }
- if(! participants.isEmpty()) {
- addSynchronizeParticipants((ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]));
- }
+ // Instantiate and register any static participant that has not already been created.
+ initializeStaticParticipants();
} catch (CoreException e) {
TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("SynchronizeManager.8"), e)); //$NON-NLS-1$
}
}
+ private void initializeStaticParticipants() throws CoreException {
+ SynchronizeParticipantDescriptor[] desc = participantRegistry.getSynchronizeParticipants();
+ List participants = new ArrayList();
+ for (int i = 0; i < desc.length; i++) {
+ SynchronizeParticipantDescriptor descriptor = desc[i];
+ if(descriptor.isStatic()) {
+ participants.add(createParticipant(null, descriptor));
+ }
+ }
+ if(! participants.isEmpty()) {
+ addSynchronizeParticipants((ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]));
+ }
+ }
+
/**
* Restores participants that have been saved between sessions.
*/
- private void restoreSynchronizeParticipants() throws TeamException, CoreException {
+ private void restoreDynamicParticipants() throws TeamException, CoreException {
ISaveContext root = SaveContextXMLWriter.readXMLPluginMetaFile(TeamUIPlugin.getPlugin(), FILENAME);
if(root != null && root.getName().equals(CTX_PARTICIPANTS)) {
List participants = new ArrayList();
@@ -285,11 +297,10 @@ public class SynchronizeManager implements ISynchronizeManager {
ISaveContext context = contexts[i];
if(context.getName().equals(CTX_PARTICIPANT)) {
String id = context.getAttribute(CTX_ID);
- String instanceid = context.getAttribute(CTX_INSTANCE_ID);
SynchronizeParticipantDescriptor desc = participantRegistry.find(id);
if(desc != null) {
IConfigurationElement cfgElement = desc.getConfigurationElement();
- participants.add(createParticipant(instanceid, desc));
+ participants.add(createParticipant(context, desc));
} else {
TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("SynchronizeManager.9", id), null)); //$NON-NLS-1$
}
@@ -304,10 +315,10 @@ public class SynchronizeManager implements ISynchronizeManager {
/**
* Creates a participant instance with the given id from the participant description
*/
- private ISynchronizeParticipant createParticipant(String instanceid, SynchronizeParticipantDescriptor desc) throws CoreException {
+ private ISynchronizeParticipant createParticipant(ISaveContext context, SynchronizeParticipantDescriptor desc) throws CoreException {
ISynchronizeParticipant participant = (ISynchronizeParticipant)TeamUIPlugin.createExtension(desc.getConfigurationElement(), SynchronizeParticipantDescriptor.ATT_CLASS);
- participant.setInitializationData(desc.getConfigurationElement(), instanceid, null);
- participant.init(instanceid);
+ participant.setInitializationData(desc.getConfigurationElement(), null, null);
+ participant.restoreState(context);
return participant;
}
@@ -320,20 +331,22 @@ public class SynchronizeManager implements ISynchronizeManager {
root.setName(CTX_PARTICIPANTS);
List children = new ArrayList();
try {
- for (Iterator it = synchronizeParticipants.values().iterator(); it.hasNext();) {
- List participants = (List) it.next();
- int instanceid = 0;
- for (Iterator it2 = participants.iterator(); it2.hasNext(); ) {
- ISynchronizeParticipant participant = (ISynchronizeParticipant) it2.next();
- ISaveContext item = new SaveContext();
- item.setName(CTX_PARTICIPANT);
- Map attributes = new HashMap();
- attributes.put(CTX_ID, participant.getId());
- attributes.put(CTX_INSTANCE_ID, new Integer(instanceid));
- item.setAttributes(attributes);
- children.add(item);
- participant.saveState(instanceid);
- instanceid++;
+ for (Iterator it = synchronizeParticipants.keySet().iterator(); it.hasNext();) {
+ String id = (String) it.next();
+ SynchronizeParticipantDescriptor desc = participantRegistry.find(id);
+ if(desc == null) {
+ TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("SynchronizeManager.9", id), null)); //$NON-NLS-1$
+ }
+ if(! desc.isStatic()) {
+ List participants = (List)synchronizeParticipants.get(id);
+ for (Iterator it2 = participants.iterator(); it2.hasNext(); ) {
+ ISynchronizeParticipant participant = (ISynchronizeParticipant) it2.next();
+ ISaveContext item = new SaveContext();
+ item.setName(CTX_PARTICIPANT);
+ item.addAttribute(CTX_ID, participant.getId());
+ participant.saveState(item);
+ children.add(item);
+ }
}
}
root.setChildren((SaveContext[])children.toArray(new SaveContext[children.size()]));
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
index c5056759e..4c0bb76f2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java
@@ -30,7 +30,6 @@ import org.eclipse.team.ui.TeamUI;
* @see ISynchronizeParticipant
* @since 3.0
*/
-
public abstract class AbstractSynchronizeParticipant implements ISynchronizeParticipant {
// property listeners
private ListenerList fListeners;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
index f733ffda5..42a340f86 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java
@@ -74,14 +74,12 @@ public interface ISynchronizeManager {
public ISynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage page);
/**
- * Returns a registered synchronize participant with the given id and instance id.
- * If instance id is <code>null</code> the first registered participant with id
- * is returned.
+ * Returns the registered synchronize participants with the given id.
*
- * @return a registered synchronize participant with the given id, or <code>null</code>
- * if one with that id is not registered.
+ * @return the registered synchronize participants with the given id, or
+ * <code>null</code> if one with that id is not registered.
*/
- public ISynchronizeParticipant find(String id, String instance_id);
+ public ISynchronizeParticipant[] find(String id);
/**
* Returns the participant descriptor for the given participant id or
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
index bac6bd8da..dece9c852 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java
@@ -13,6 +13,7 @@ package org.eclipse.team.ui.synchronize;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.team.core.ISaveContext;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.IPageBookViewPage;
@@ -83,12 +84,12 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
* @exception PartInitException
* if this participant was not initialized successfully
*/
- public void init(String id) throws PartInitException;
+ public void restoreState(ISaveContext context) throws PartInitException;
/**
* Saves the participants object state.
*/
- public void saveState(int instanceid);
+ public void saveState(ISaveContext context);
/**
* Adds a listener for changes to properties of this synchronize

Back to the top