Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-21 02:43:22 +0000
committerJean Michel-Lemieux2003-10-21 02:43:22 +0000
commit137b7e17e85579acf274bcd840f5f6df859f303a (patch)
treee742dab569264e69613c8379fb6588e5bcb5e8d1
parent2f90738096233d38ea8dca3584b38e9b6be71b6b (diff)
downloadeclipse.platform.team-137b7e17e85579acf274bcd840f5f6df859f303a.tar.gz
eclipse.platform.team-137b7e17e85579acf274bcd840f5f6df859f303a.tar.xz
eclipse.platform.team-137b7e17e85579acf274bcd840f5f6df859f303a.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java29
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantRegistry.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizePartnerDescriptor.java19
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/pages/SynchronizeManager.java59
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/AbstractSynchronizeParticipant.java17
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeManager.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeParticipant.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamSubscriberParticipant.java4
14 files changed, 83 insertions, 112 deletions
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 484f03119..130cb6f24 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
@@ -202,7 +202,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
return state;
}
- public static CVSMergeSubscriber restore(String id, SaveContext saveContext) throws CVSException {
+ public static CVSMergeSubscriber restore(QualifiedName 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(new QualifiedName(id, null), roots, start, end);
+ return new CVSMergeSubscriber(id, roots, start, end);
}
public CVSTag getStartTag() {
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 3eaa4c3a0..25841c054 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -32,14 +32,16 @@
icon="icons/full/cview16/rep_editors_view.gif"
class="org.eclipse.team.internal.ccvs.ui.subscriber.CVSWorkspaceSynchronizeParticipant"
type="static"
- id="org.eclipse.team.cvs.ui.cvsworkspace_syncparticipant">
+ qualified_name="org.eclipse.team.cvs.ui.cvsworkspace-participant"
+ local_name="syncparticipant">
</participant>
<participant
name="CVS Merge"
icon="icons/full/obj16/prjversions_rep.gif"
class="org.eclipse.team.internal.ccvs.ui.subscriber.CVSMergeSynchronizeParticipant"
type="dynamic"
- id="org.eclipse.team.cvs.ui.cvsmerge_syncparticipant">
+ qualified_name="org.eclipse.team.cvs.ui.cvsmerge-participant"
+ local_name="unknown">
</participant>
</extension>
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 4a01d8fba..0ba80e6a9 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
@@ -686,6 +686,6 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* @return Returns the cvsWorkspaceSynchronizeViewPage.
*/
public CVSWorkspaceSynchronizeParticipant getCvsWorkspaceSynchronizeViewPage() {
- return (CVSWorkspaceSynchronizeParticipant)TeamUI.getSynchronizeManager().find("org.eclipse.team.cvs.ui.cvsworkspace_syncparticipant");
+ return (CVSWorkspaceSynchronizeParticipant)TeamUI.getSynchronizeManager().find(CVSWorkspaceSynchronizeParticipant.ID);
}
}
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 7d26a3513..8948f9b31 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
@@ -65,14 +65,14 @@ public class MergeWizard extends Wizard {
CVSTag endTag = endPage.getTag();
CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag);
- CVSMergeSynchronizeParticipant page = new CVSMergeSynchronizeParticipant(s);
+ CVSMergeSynchronizeParticipant participant = new CVSMergeSynchronizeParticipant(s);
ISynchronizeManager manager = TeamUI.getSynchronizeManager();
- manager.addSynchronizeParticipants(new ISynchronizeParticipant[] {page});
+ manager.addSynchronizeParticipants(new ISynchronizeParticipant[] {participant});
ISynchronizeView view = manager.showSynchronizeViewInActivePage(null);
if(view != null) {
- view.display(page);
- page.refreshWithRemote(null /* all roots */);
+ view.display(participant);
+ participant.refreshWithRemote(s.roots());
} else {
CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
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 a33aaa2e9..4f4f34ff0 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
@@ -10,15 +10,12 @@
*******************************************************************************/
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.core.runtime.QualifiedName;
+import org.eclipse.jface.action.*;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
-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.*;
import org.eclipse.team.internal.core.SaveContext;
import org.eclipse.team.internal.core.SaveContextXMLWriter;
import org.eclipse.team.internal.ui.TeamUIPlugin;
@@ -34,7 +31,7 @@ public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
private RemoveSynchronizeViewPageAction removeAction;
private DirectionFilterActionGroup modes;
private Action updateAdapter;
- private final static String PARTICIPANT_ID = "org.eclipse.team.cvs.ui.cvsmerge_syncparticipant";
+ private final static String QUALIFIED_NAME = "org.eclipse.team.cvs.ui.cvsmerge-participant";
public CVSMergeSynchronizeParticipant() {
super();
@@ -43,8 +40,6 @@ public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
public CVSMergeSynchronizeParticipant(CVSMergeSubscriber subscriber) {
super();
setSubscriber(subscriber);
- setName(subscriber.getName());
- setId(PARTICIPANT_ID);
setImageDescriptor(CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_PROJECT_VERSION));
}
@@ -53,7 +48,8 @@ public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
*/
protected void setSubscriber(TeamSubscriber subscriber) {
super.setSubscriber(subscriber);
- setInstanceId(subscriber.getId().toString());
+ setId(subscriber.getId());
+ setName(subscriber.getName());
makeActions();
}
@@ -84,11 +80,11 @@ public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
/* (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 instance_id) throws PartInitException {
+ public void init(QualifiedName id) throws PartInitException {
SaveContext ctx; //$NON-NLS-1$
try {
- ctx = SaveContextXMLWriter.readXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(instance_id));
- setSubscriber(CVSMergeSubscriber.restore(instance_id, ctx));
+ ctx = SaveContextXMLWriter.readXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(id.getLocalName()));
+ setSubscriber(CVSMergeSubscriber.restore(id, ctx));
} catch (TeamException e) {
TeamUIPlugin.log(e);
}
@@ -102,19 +98,18 @@ public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
CVSMergeSubscriber s =(CVSMergeSubscriber)input.getSubscriber();
SaveContext ctx = s.saveState();
try {
- SaveContextXMLWriter.writeXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(getId()), ctx); //$NON-NLS-1$
+ SaveContextXMLWriter.writeXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(getId().getLocalName()), ctx); //$NON-NLS-1$
} catch (TeamException e) {
TeamUIPlugin.log(e);
}
}
-
-
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.AbstractSynchronizeParticipant#dispose()
*/
protected void dispose() {
super.dispose();
- SaveContextXMLWriter.deleteXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(getId())); //$NON-NLS-1$
+ SaveContextXMLWriter.deleteXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(getId().getLocalName())); //$NON-NLS-1$
}
private String getMetaFileName(String id) {
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 696697b5f..57729d5a3 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
@@ -22,6 +22,7 @@ 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;
+import org.eclipse.ui.part.IPageBookViewPage;
public abstract class CVSSynchronizeParticipant extends TeamSubscriberParticipant implements ISyncSetChangedListener {
@@ -63,13 +64,16 @@ public abstract class CVSSynchronizeParticipant extends TeamSubscriberParticipan
* @see org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener#syncSetChanged(org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent)
*/
public void syncSetChanged(SyncSetChangedEvent event) {
- StructuredViewer viewer = getPage().getViewer();
- if(viewer != null) {
- IStructuredContentProvider cp = (IStructuredContentProvider)viewer.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);
+ IPageBookViewPage page = getPage();
+ if(page != null) {
+ StructuredViewer viewer = getPage().getViewer();
+ if(viewer != null) {
+ IStructuredContentProvider cp = (IStructuredContentProvider)viewer.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);
+ }
}
}
}
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 27273d562..5a4cfc67a 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
@@ -10,9 +10,8 @@
*******************************************************************************/
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.core.runtime.QualifiedName;
+import org.eclipse.jface.action.*;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -26,6 +25,7 @@ public class CVSWorkspaceSynchronizeParticipant extends CVSSynchronizeParticipan
private DirectionFilterActionGroup modes;
private Action commitAdapter;
private Action updateAdapter;
+ public final static QualifiedName ID = new QualifiedName("org.eclipse.team.cvs.ui.cvsworkspace-participant", "syncparticipant");
protected void setSubscriber(TeamSubscriber subscriber) {
super.setSubscriber(subscriber);
@@ -56,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(String instance_id) throws PartInitException {
+ public void init(QualifiedName id) throws PartInitException {
TeamSubscriber subscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
setSubscriber(subscriber);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantRegistry.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantRegistry.java
index d559fec15..0edd98c80 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantRegistry.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantRegistry.java
@@ -35,7 +35,7 @@ public class SynchronizeParticipantRegistry extends RegistryReader {
SynchronizePartnerDescriptor desc;
try {
desc = new SynchronizePartnerDescriptor(element, descText);
- participants.put(desc.getId(), desc);
+ participants.put(desc.getId().getQualifier(), desc);
} catch (CoreException e) {
TeamUIPlugin.log(e);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizePartnerDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizePartnerDescriptor.java
index 68213f02f..5d456d5a2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizePartnerDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizePartnerDescriptor.java
@@ -10,19 +10,17 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.registry;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.ui.internal.WorkbenchPlugin;
public class SynchronizePartnerDescriptor {
- private String id;
+ private QualifiedName id;
private ImageDescriptor imageDescriptor;
- public static final String ATT_ID = "id"; //$NON-NLS-1$
+ public static final String ATT_QUALIFIED_NAME = "qualified_name"; //$NON-NLS-1$
+ public static final String ATT_LOCAL_NAME = "local_name"; //$NON-NLS-1$
public static final String ATT_NAME = "name"; //$NON-NLS-1$
public static final String ATT_ICON = "icon"; //$NON-NLS-1$
public static final String ATT_CLASS = "class"; //$NON-NLS-1$
@@ -66,7 +64,7 @@ public class SynchronizePartnerDescriptor {
return description;
}
- public String getId() {
+ public QualifiedName getId() {
return id;
}
@@ -97,16 +95,19 @@ public class SynchronizePartnerDescriptor {
* load a view descriptor from the registry.
*/
private void loadFromExtension() throws CoreException {
- id = configElement.getAttribute(ATT_ID);
+ String qualified_name = configElement.getAttribute(ATT_QUALIFIED_NAME);
+ String local_name = configElement.getAttribute(ATT_LOCAL_NAME);
label = configElement.getAttribute(ATT_NAME);
className = configElement.getAttribute(ATT_CLASS);
type = configElement.getAttribute(ATT_TYPE);
// Sanity check.
- if ((label == null) || (className == null)) {
+ if ((label == null) || (className == null) || (local_name == null)) {
throw new CoreException(new Status(IStatus.ERROR, configElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier(), 0, "Invalid extension (missing label or class name): " + id, //$NON-NLS-1$
null));
}
+
+ id = new QualifiedName(qualified_name, local_name);
}
/**
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 a7f0932cb..dd5107af4 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
@@ -10,39 +10,20 @@
*******************************************************************************/
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;
+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.*;
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.core.*;
+import org.eclipse.team.internal.ui.*;
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.SynchronizeParticipantRegistry;
import org.eclipse.team.internal.ui.registry.SynchronizePartnerDescriptor;
import org.eclipse.team.ui.ITeamUIConstants;
-import org.eclipse.team.ui.sync.ISynchronizeManager;
-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;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.WorkbenchException;
+import org.eclipse.team.ui.sync.*;
+import org.eclipse.ui.*;
public class SynchronizeManager implements ISynchronizeManager {
/**
@@ -63,8 +44,8 @@ public class SynchronizeManager implements ISynchronizeManager {
// save context constants
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 CTX_QUALIFIED_NAME = "qualified_name";
+ private final static String CTX_LOCAL_NAME = "local_name";
private final static String FILENAME = "syncParticipants.xml";
/**
@@ -187,7 +168,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeManager#find(java.lang.String)
*/
- public ISynchronizeParticipant find(String id) {
+ public ISynchronizeParticipant find(QualifiedName id) {
return (ISynchronizeParticipant)synchronizeParticipants.get(id);
}
@@ -235,7 +216,7 @@ public class SynchronizeManager implements ISynchronizeManager {
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));
+ participants.add(createParticipant(descriptor.getId(), descriptor));
}
}
if(! participants.isEmpty()) {
@@ -251,12 +232,12 @@ public class SynchronizeManager implements ISynchronizeManager {
for (int i = 0; i < contexts.length; i++) {
ISaveContext context = contexts[i];
if(context.getName().equals(CTX_PARTICIPANT)) {
- String id = context.getAttribute(CTX_ID);
- String instance_id = context.getAttribute(CTX_INSTANCE_ID);
- SynchronizePartnerDescriptor desc = participantRegistry.find(id);
+ String qualified_name = context.getAttribute(CTX_QUALIFIED_NAME);
+ String local_name = context.getAttribute(CTX_LOCAL_NAME);
+ SynchronizePartnerDescriptor desc = participantRegistry.find(qualified_name);
if(desc != null) {
IConfigurationElement cfgElement = desc.getConfigurationElement();
- participants.add(createParticipant(id, instance_id, desc));
+ participants.add(createParticipant(new QualifiedName(qualified_name, local_name), desc));
}
}
}
@@ -266,10 +247,10 @@ public class SynchronizeManager implements ISynchronizeManager {
}
}
- private ISynchronizeParticipant createParticipant(String id, String instance_id, SynchronizePartnerDescriptor desc) throws CoreException, PartInitException {
+ private ISynchronizeParticipant createParticipant(QualifiedName id, SynchronizePartnerDescriptor desc) throws CoreException, PartInitException {
ISynchronizeParticipant participant = (ISynchronizeParticipant)TeamUIPlugin.createExtension(desc.getConfigurationElement(), SynchronizePartnerDescriptor.ATT_CLASS);
- participant.setInitializationData(desc.getConfigurationElement(), id, null);
- participant.init(instance_id);
+ participant.setInitializationData(desc.getConfigurationElement(), id.toString(), id);
+ participant.init(id);
return participant;
}
@@ -280,12 +261,12 @@ public class SynchronizeManager implements ISynchronizeManager {
try {
for (Iterator it = synchronizeParticipants.values().iterator(); it.hasNext();) {
ISynchronizeParticipant participant = (ISynchronizeParticipant) it.next();
- String id = participant.getId();
+ QualifiedName 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());
+ attributes.put(CTX_QUALIFIED_NAME, id.getQualifier());
+ attributes.put(CTX_LOCAL_NAME, id.getLocalName());
item.setAttributes(attributes);
children.add(item);
participant.saveState();
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 befc0ad49..5e0c0001d 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
@@ -10,14 +10,9 @@
*******************************************************************************/
package org.eclipse.team.ui.sync;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.util.*;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.team.ui.TeamImages;
import org.eclipse.team.ui.TeamUI;
@@ -28,7 +23,7 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
private ListenerList fListeners;
private String fName;
- private String fId;
+ private QualifiedName fId;
private String fInstanceId;
private ImageDescriptor fImageDescriptor;
protected IConfigurationElement configElement;
@@ -153,11 +148,11 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#getId()
*/
- public String getId() {
+ public QualifiedName getId() {
return fId;
}
- protected void setId(String id) {
+ protected void setId(QualifiedName id) {
this.fId = id;
}
@@ -229,7 +224,7 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
configElement = config;
// Id
- fId = config.getAttribute("id");
+ fId = new QualifiedName(config.getAttribute("qualified_name"), config.getAttribute("local_name"));
// Title.
fName = config.getAttribute("name");//$NON-NLS-1$
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 9a48705d9..6af56dc18 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.ui.sync;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.ui.IWorkbenchPage;
/**
@@ -76,5 +77,5 @@ public interface ISynchronizeManager {
* @return a registered synchronize participant with the given id, io <code>null</code>
* if one with that id is not registered.
*/
- public ISynchronizeParticipant find(String id);
+ public ISynchronizeParticipant find(QualifiedName id);
}
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 00977935d..26d50dbf8 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
@@ -11,6 +11,7 @@
package org.eclipse.team.ui.sync;
import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.ui.PartInitException;
@@ -29,17 +30,8 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
*
* @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();
-
+ public QualifiedName getId();
+
/**
* Returns the name of this synchronize participant.
*
@@ -78,7 +70,7 @@ 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(String instance_id) throws PartInitException;
+ public void init(QualifiedName id) throws PartInitException;
/**
* Saves the participants object state.
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 ccd6b0b39..934b56fc7 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
@@ -111,8 +111,8 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
}
public void refreshWithRemote(IResource[] resources) {
- if(resources == null || resources.length == 0) {
- //page.getRefreshAction().run();
+ if((resources == null || resources.length == 0) && page != null) {
+ page.getRefreshAction().run();
} else {
RefreshAction.run(resources, input.getSubscriber());
}

Back to the top