Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-20 20:39:51 +0000
committerJean Michel-Lemieux2003-10-20 20:39:51 +0000
commit2f90738096233d38ea8dca3584b38e9b6be71b6b (patch)
tree38e4b8c2b0b0874ac6d686f1a9a0c12e455f8b7a
parent2eb555ca444ffd2c0e59c2eeba35c0d4fdb9cdfb (diff)
downloadeclipse.platform.team-2f90738096233d38ea8dca3584b38e9b6be71b6b.tar.gz
eclipse.platform.team-2f90738096233d38ea8dca3584b38e9b6be71b6b.tar.xz
eclipse.platform.team-2f90738096233d38ea8dca3584b38e9b6be71b6b.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SaveContextXMLWriter.java12
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSubscriberFactory.java63
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java84
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java18
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java28
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java8
11 files changed, 112 insertions, 121 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SaveContextXMLWriter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SaveContextXMLWriter.java
index ddecae1f6..c4f76a8a0 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SaveContextXMLWriter.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/SaveContextXMLWriter.java
@@ -22,10 +22,10 @@ import org.xml.sax.SAXException;
public class SaveContextXMLWriter extends PrintWriter {
protected int tab;
-
+
/* constants */
protected static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$
-
+
public SaveContextXMLWriter(OutputStream output) throws UnsupportedEncodingException {
super(new OutputStreamWriter(output, "UTF8")); //$NON-NLS-1$
tab = 0;
@@ -172,6 +172,14 @@ public class SaveContextXMLWriter extends PrintWriter {
}
}
+ static public void deleteXMLPluginMetaFile(Plugin plugin, String filename) {
+ IPath pluginStateLocation = plugin.getStateLocation();
+ File stateFile = pluginStateLocation.append(filename).toFile();
+ if (stateFile.exists()) {
+ stateFile.delete();
+ }
+ }
+
static public SaveContext readXMLPluginMetaFile(Plugin plugin, String filename) throws TeamException {
BufferedInputStream is = null;
try {
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 2fea97abe..484f03119 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
@@ -84,7 +84,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
private static QualifiedName getUniqueId() {
String uniqueId = Long.toString(System.currentTimeMillis());
- return new QualifiedName(CVSSubscriberFactory.ID, UNIQUE_ID_PREFIX + uniqueId);
+ return new QualifiedName(null, "CVS" + UNIQUE_ID_PREFIX + uniqueId);
}
public CVSMergeSubscriber(IResource[] roots, CVSTag start, CVSTag end) {
@@ -202,7 +202,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
return state;
}
- public static CVSMergeSubscriber restore(QualifiedName id, SaveContext saveContext) throws CVSException {
+ public static CVSMergeSubscriber restore(String id, SaveContext 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$
@@ -232,7 +232,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
throw new CVSException(Policy.bind("CVSMergeSubscriber.22", id.toString())); //$NON-NLS-1$
}
IResource[] roots = (IResource[]) resources.toArray(new IResource[resources.size()]);
- return new CVSMergeSubscriber(id, roots, start, end);
+ return new CVSMergeSubscriber(new QualifiedName(id, null), roots, start, end);
}
public CVSTag getStartTag() {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
index 6e3f7b70e..07d9fdea5 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
@@ -83,7 +83,7 @@ public class CVSProviderPlugin extends Plugin {
// cvs plugin extension points and ids
public static final String ID = "org.eclipse.team.cvs.core"; //$NON-NLS-1$
- public static final QualifiedName CVS_WORKSPACE_SUBSCRIBER_ID = new QualifiedName(CVSSubscriberFactory.ID, "workspace-subscriber"); //$NON-NLS-1$
+ public static final QualifiedName CVS_WORKSPACE_SUBSCRIBER_ID = new QualifiedName(null, "org.eclipse.team.cvs.ui.cvsworkspace_syncparticipant"); //$NON-NLS-1$
public static final String PT_AUTHENTICATOR = "authenticator"; //$NON-NLS-1$
public static final String PT_CONNECTIONMETHODS = "connectionmethods"; //$NON-NLS-1$
public static final String PT_FILE_MODIFICATION_VALIDATOR = "filemodificationvalidator"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSubscriberFactory.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSubscriberFactory.java
deleted file mode 100644
index 36e66bd73..000000000
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSubscriberFactory.java
+++ /dev/null
@@ -1,63 +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.core;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.TeamSubscriber;
-import org.eclipse.team.core.subscribers.TeamSubscriberFactory;
-import org.eclipse.team.internal.core.SaveContext;
-
-/**
- * CVSSubscriberFactory
- */
-public class CVSSubscriberFactory extends TeamSubscriberFactory {
-
- final static public String ID = "org.eclipse.team.cvs.subscribers"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISyncTreeSubscriberFactory#getID()
- */
- public String getID() {
- return ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISyncTreeSubscriberFactory#createSubscriber(org.eclipse.core.runtime.QualifiedName, org.eclipse.team.internal.core.SaveContext)
- */
- public TeamSubscriber restoreSubscriber(QualifiedName id, SaveContext saveContext) throws TeamException {
- if(isMergeSubscriber(id)) {
- return CVSMergeSubscriber.restore(id, saveContext);
- }
- // CVS workspace subscribers are automatically recreated when the platform restarts.
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.ISyncTreeSubscriberFactory#saveSubscriber(org.eclipse.team.core.subscribers.TeamSubscriber)
- */
- public SaveContext saveSubscriber(TeamSubscriber subscriber) throws TeamException {
- if(isMergeSubscriber(subscriber.getId())) {
- return ((CVSMergeSubscriber)subscriber).saveState();
- } else {
- return null;
- }
- }
-
- private boolean isMergeSubscriber(QualifiedName id) {
- String localName = id.getLocalName();
- if(localName.startsWith(CVSMergeSubscriber.UNIQUE_ID_PREFIX)) {
- return true;
- } else {
- return false;
- }
- }
-}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java
index 692e7dc08..a33aaa2e9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java
@@ -36,6 +36,10 @@ public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
private Action updateAdapter;
private final static String PARTICIPANT_ID = "org.eclipse.team.cvs.ui.cvsmerge_syncparticipant";
+ public CVSMergeSynchronizeParticipant() {
+ super();
+ }
+
public CVSMergeSynchronizeParticipant(CVSMergeSubscriber subscriber) {
super();
setSubscriber(subscriber);
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
index 7231fc0ad..696697b5f 100644
--- 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
@@ -51,9 +51,6 @@ public abstract class CVSSynchronizeParticipant extends TeamSubscriberParticipan
}
}
- public CVSSynchronizeParticipant() {
- }
-
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.AbstractSynchronizeParticipant#dispose()
*/
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
index c27f2fb03..27273d562 100644
--- 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
@@ -13,7 +13,6 @@ 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.team.core.ISaveContext;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -57,7 +56,7 @@ public class CVSWorkspaceSynchronizeParticipant extends CVSSynchronizeParticipan
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#init(org.eclipse.team.ui.sync.ISynchronizeView, org.eclipse.team.core.ISaveContext)
*/
- public void init(ISaveContext saveContext) throws PartInitException {
+ public void init(String instance_id) throws PartInitException {
TeamSubscriber subscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
setSubscriber(subscriber);
}
@@ -65,7 +64,7 @@ public class CVSWorkspaceSynchronizeParticipant extends CVSSynchronizeParticipan
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#saveState(org.eclipse.team.core.ISaveContext)
*/
- public void saveState(ISaveContext saveContext) {
+ public void saveState() {
// no state to save
}
} \ No newline at end of file
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 1b2350337..a7f0932cb 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
@@ -12,6 +12,7 @@ package org.eclipse.team.internal.ui.sync.pages;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -23,7 +24,9 @@ import org.eclipse.core.runtime.Platform;
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.core.TeamPlugin;
import org.eclipse.team.internal.ui.IPreferenceIds;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
@@ -61,6 +64,8 @@ public class SynchronizeManager implements ISynchronizeManager {
private final static String CTX_PARTICIPANTS = "syncparticipants";
private final static String CTX_PARTICIPANT = "participant";
private final static String CTX_ID = "id";
+ private final static String CTX_INSTANCE_ID = "instance_id";
+ private final static String FILENAME = "syncParticipants.xml";
/**
* Notifies a participant listeners of additions or removals
@@ -114,6 +119,10 @@ public class SynchronizeManager implements ISynchronizeManager {
}
}
+ public SynchronizeManager() {
+ super();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeManager#addSynchronizeParticipantListener(org.eclipse.team.ui.sync.ISynchronizeParticipantListener)
*/
@@ -146,6 +155,7 @@ public class SynchronizeManager implements ISynchronizeManager {
}
}
if (!added.isEmpty()) {
+ saveState();
fireUpdate((ISynchronizeParticipant[])added.toArray(new ISynchronizeParticipant[added.size()]), ADDED);
}
}
@@ -162,6 +172,7 @@ public class SynchronizeManager implements ISynchronizeManager {
}
}
if (!removed.isEmpty()) {
+ saveState();
fireUpdate((ISynchronizeParticipant[])removed.toArray(new ISynchronizeParticipant[removed.size()]), REMOVED);
}
}
@@ -216,50 +227,73 @@ public class SynchronizeManager implements ISynchronizeManager {
public void restoreParticipants() throws PartInitException, TeamException, CoreException {
participantRegistry.readRegistry(Platform.getPluginRegistry(), TeamUIPlugin.ID, ITeamUIConstants.PT_SYNCPARTICIPANTS);
- boolean firstTime = restoreSynchronizeParticipants();
- if(!firstTime) {
- SynchronizePartnerDescriptor[] desc = participantRegistry.getSynchronizeParticipants();
- for (int i = 0; i < desc.length; i++) {
- SynchronizePartnerDescriptor descriptor = desc[i];
- if(descriptor.isStatic()) {
- createParticipant(null, null, descriptor);
- }
+ restoreSynchronizeParticipants();
+ // Create any new participants that had previously not been added (e.g. new plugins being
+ // added.
+ SynchronizePartnerDescriptor[] desc = participantRegistry.getSynchronizeParticipants();
+ List participants = new ArrayList();
+ for (int i = 0; i < desc.length; i++) {
+ SynchronizePartnerDescriptor descriptor = desc[i];
+ if(descriptor.isStatic() && ! synchronizeParticipants.containsKey(descriptor.getId())) {
+ participants.add(createParticipant(descriptor.getId(), null, descriptor));
}
}
+ if(! participants.isEmpty()) {
+ addSynchronizeParticipants((ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]));
+ }
}
- public void dispose() {
- }
-
- private boolean restoreSynchronizeParticipants() throws TeamException, PartInitException, CoreException {
- ISaveContext root = SaveContextXMLWriter.readXMLPluginMetaFile(TeamUIPlugin.getPlugin(), "subscribers"); //$NON-NLS-1$
+ private void restoreSynchronizeParticipants() throws TeamException, PartInitException, CoreException {
+ ISaveContext root = SaveContextXMLWriter.readXMLPluginMetaFile(TeamUIPlugin.getPlugin(), FILENAME); //$NON-NLS-1$
if(root != null && root.getName().equals(CTX_PARTICIPANTS)) {
+ List participants = new ArrayList();
ISaveContext[] contexts = root.getChildren();
for (int i = 0; i < contexts.length; i++) {
ISaveContext context = contexts[i];
if(context.getName().equals(CTX_PARTICIPANT)) {
String id = context.getAttribute(CTX_ID);
- ISaveContext[] children = context.getChildren();
+ String instance_id = context.getAttribute(CTX_INSTANCE_ID);
SynchronizePartnerDescriptor desc = participantRegistry.find(id);
if(desc != null) {
IConfigurationElement cfgElement = desc.getConfigurationElement();
- createParticipant(id, children, desc);
+ participants.add(createParticipant(id, instance_id, desc));
}
}
}
- return true;
+ if(! participants.isEmpty()) {
+ addSynchronizeParticipants((ISynchronizeParticipant[]) participants.toArray(new ISynchronizeParticipant[participants.size()]));
+ }
}
- return false;
}
-
- private void createParticipant(String id, ISaveContext[] children, SynchronizePartnerDescriptor desc) throws CoreException, PartInitException {
+
+ private ISynchronizeParticipant createParticipant(String id, String instance_id, SynchronizePartnerDescriptor desc) throws CoreException, PartInitException {
ISynchronizeParticipant participant = (ISynchronizeParticipant)TeamUIPlugin.createExtension(desc.getConfigurationElement(), SynchronizePartnerDescriptor.ATT_CLASS);
participant.setInitializationData(desc.getConfigurationElement(), id, null);
- if(children != null) {
- participant.init(children[0]);
- } else {
- participant.init(null);
- }
- addSynchronizeParticipants(new ISynchronizeParticipant[] {participant});
+ participant.init(instance_id);
+ return participant;
+ }
+
+ private void saveState() {
+ ISaveContext root = new SaveContext();
+ root.setName(CTX_PARTICIPANTS);
+ List children = new ArrayList();
+ try {
+ for (Iterator it = synchronizeParticipants.values().iterator(); it.hasNext();) {
+ ISynchronizeParticipant participant = (ISynchronizeParticipant) it.next();
+ String id = participant.getId();
+ ISaveContext item = new SaveContext();
+ item.setName(CTX_PARTICIPANT);
+ Map attributes = new HashMap();
+ attributes.put(CTX_ID, id);
+ attributes.put(CTX_INSTANCE_ID, participant.getInstanceId());
+ item.setAttributes(attributes);
+ children.add(item);
+ participant.saveState();
+ }
+ root.setChildren((SaveContext[])children.toArray(new SaveContext[children.size()]));
+ SaveContextXMLWriter.writeXMLPluginMetaFile(TeamUIPlugin.getPlugin(), FILENAME, (SaveContext)root); //$NON-NLS-1$
+ } catch (TeamException e) {
+ TeamPlugin.log(e);
+ }
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java
index fd66ab1ab..befc0ad49 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java
@@ -29,8 +29,9 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
private String fName;
private String fId;
+ private String fInstanceId;
private ImageDescriptor fImageDescriptor;
- private IConfigurationElement configElement;
+ protected IConfigurationElement configElement;
/**
* Used to notify this console of lifecycle methods <code>init()</code>
@@ -156,6 +157,21 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
return fId;
}
+ protected void setId(String id) {
+ this.fId = id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.sync.ISynchronizeParticipant#getId()
+ */
+ public String getInstanceId() {
+ return fInstanceId;
+ }
+
+ protected void setInstanceId(String id) {
+ this.fInstanceId = id;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsole#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java
index fb04047ec..00977935d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java
@@ -13,7 +13,6 @@ package org.eclipse.team.ui.sync;
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;
@@ -26,13 +25,22 @@ import org.eclipse.ui.part.IPageBookViewPage;
*/
public interface ISynchronizeParticipant extends IExecutableExtension {
/**
- * Returns the unique id of this synchronize participant.
+ * Returns the unique id that identified the <i>type<i> of this synchronize participant.
*
- * @return the unique id of this synchronize participant
+ * @return the unique id that identified the <i>type<i> of this synchronize participant.
*/
public String getId();
/**
+ * Returns the dynamic instance id of this synchronize participant. For dynamic
+ * participants (e.g. participants that support multiple instance of the same
+ * type) this id is used to differentiate these dynamic instances.
+ *
+ * @return the dynamic instance id of this synchronize participant
+ */
+ public String getInstanceId();
+
+ /**
* Returns the name of this synchronize participant.
*
* @return the name of this synchronize participant
@@ -58,10 +66,8 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
public IPageBookViewPage createPage(ISynchronizeView view);
/**
- * Initializes this participant with the given synchronize view. A save context is passed to
- * the participant which contains a snapshot of the participants state from a previous
- * session. Where possible, the participant should try to recreate that state
- * within the synchronize view.
+ * Initializes this participant with the given synchronize view. The instance id is
+ * passed to the participant.
* <p>
* This method is automatically called by the team plugin shortly after synchronize
* view construction. It marks the start of the views's lifecycle. Clients must
@@ -72,14 +78,12 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
* @param saveContext the ISynchronizeParticipant state or null if there is no previous saved state
* @exception PartInitException if this participant was not initialized successfully
*/
- public void init(ISaveContext saveContext) throws PartInitException;
+ public void init(String instance_id) throws PartInitException;
/**
- * Saves the participants object state within a save context.
- *
- * @param memento a memento to receive the object state
+ * Saves the participants object state.
*/
- public void saveState(ISaveContext saveContext);
+ public void saveState();
/**
* Adds a listener for changes to properties of this synchronize participant.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java
index d3a9296c5..ccd6b0b39 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java
@@ -1,7 +1,6 @@
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.action.IToolBarManager;
import org.eclipse.team.core.subscribers.TeamSubscriber;
@@ -69,13 +68,6 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
}
/* (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(ISynchronizeView view) {

Back to the top