Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-28 21:51:23 +0000
committerJean Michel-Lemieux2003-10-28 21:51:23 +0000
commit68c88c6452585be2194ce17633393b00b2211fdd (patch)
tree588593211555525d8906beac579fb091d03e32de
parent4a23328ce9c70b07d1d04cb99c1ad329755d3930 (diff)
downloadeclipse.platform.team-68c88c6452585be2194ce17633393b00b2211fdd.tar.gz
eclipse.platform.team-68c88c6452585be2194ce17633393b00b2211fdd.tar.xz
eclipse.platform.team-68c88c6452585be2194ce17633393b00b2211fdd.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/TeamSubscriber.java15
-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/subscriber/MergeSynchronizeParticipant.java17
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java7
-rw-r--r--bundles/org.eclipse.team.ui/plugin.properties2
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml2
-rw-r--r--bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd149
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/ISynchronizeParticipantDescriptor.java23
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java31
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantRegistry.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java67
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java31
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshAction.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoCompareInput.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SynchronizeViewNode.java22
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/AbstractSynchronizeParticipant.java11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeManager.java22
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizeParticipant.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java13
25 files changed, 322 insertions, 147 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 3b458856f..b53e48da8 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
@@ -31,20 +31,7 @@ import org.eclipse.team.core.sync.IRemoteResource;
abstract public class TeamSubscriber {
private List listeners = new ArrayList(1);
-
- /**
- * Return the unique id that identified this subscriber.
- */
- abstract public QualifiedName getId();
-
- /**
- * Return the name of this subscription, in a format that is suitable for
- * display to an end user.
- *
- * @return String representing the name of this subscription.
- */
- abstract public String getName();
-
+
/**
* Return the description of this subscription, in a format that is suitable for
* display to an end user. The description should contain enough details to
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index a34e808f5..a50c0b388 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -31,16 +31,14 @@
icon="icons/full/cview16/rep_editors_view.gif"
class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant"
type="static"
- qualified_name="org.eclipse.team.cvs.ui.cvsworkspace-participant"
- local_name="syncparticipant">
+ id="org.eclipse.team.cvs.ui.cvsworkspace-participant">
</participant>
<participant
name="CVS Merge"
icon="icons/full/obj16/prjversions_rep.gif"
class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant"
type="dynamic"
- qualified_name="org.eclipse.team.cvs.ui.cvsmerge-participant"
- local_name="unknown">
+ id="org.eclipse.team.cvs.ui.cvsmerge-participant">
</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 3360e8dc5..18a43b8c7 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
@@ -697,6 +697,6 @@ public class CVSUIPlugin extends AbstractUIPlugin {
* @return Returns the cvsWorkspaceSynchronizeViewPage.
*/
public WorkspaceSynchronizeParticipant getCvsWorkspaceSynchronizeParticipant() {
- return (WorkspaceSynchronizeParticipant)TeamUI.getSynchronizeManager().find(WorkspaceSynchronizeParticipant.ID);
+ return (WorkspaceSynchronizeParticipant)TeamUI.getSynchronizeManager().find(WorkspaceSynchronizeParticipant.ID, null);
}
}
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 469e5cab1..a838d41a0 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
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.CoreException;
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.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;
import org.eclipse.team.ui.synchronize.TeamSubscriberParticipant;
import org.eclipse.ui.PartInitException;
@@ -34,7 +34,6 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
public MergeSynchronizeParticipant(CVSMergeSubscriber subscriber) {
super();
setSubscriber(subscriber);
- setImageDescriptor(CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_PROJECT_VERSION));
}
/* (non-Javadoc)
@@ -42,14 +41,18 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
*/
protected void setSubscriber(TeamSubscriber subscriber) {
super.setSubscriber(subscriber);
- setId(subscriber.getId());
- setName(subscriber.getName());
+ String id = CVSMergeSubscriber.QUALIFIED_NAME;
+ try {
+ setInitializationData(TeamUI.getSynchronizeManager().getParticipantDescriptor(id).getConfigurationElement(), id, null);
+ } catch (CoreException e) {
+ CVSUIPlugin.log(e);
+ }
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#init(org.eclipse.team.ui.sync.ISynchronizeView, org.eclipse.team.core.ISaveContext)
*/
- public void init(QualifiedName id) throws PartInitException {
+ public void init(String instanceid) throws PartInitException {
SaveContext ctx; //$NON-NLS-1$
try {
ctx = SaveContextXMLWriter.readXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(id.getLocalName()));
@@ -62,7 +65,7 @@ public class MergeSynchronizeParticipant extends TeamSubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#saveState(org.eclipse.team.core.ISaveContext)
*/
- public void saveState() {
+ public void saveState(int instanceid) {
SubscriberInput input = getInput();
CVSMergeSubscriber s =(CVSMergeSubscriber)input.getSubscriber();
SaveContext ctx = s.saveState();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
index fd12b787d..dac34ad37 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
@@ -99,7 +99,7 @@ public class MergeUpdateAction extends SafeUpdateAction {
// Assumption that all nodes are from the same subscriber.
currentSubcriber = nodes[0].getSubscriber();
if (!(currentSubcriber instanceof CVSMergeSubscriber)) {
- throw new CVSException(Policy.bind("MergeUpdateAction.invalidSubscriber", currentSubcriber.getId().toString())); //$NON-NLS-1$
+ throw new CVSException(Policy.bind("MergeUpdateAction.invalidSubscriber", currentSubcriber.toString())); //$NON-NLS-1$
}
CVSTag startTag = ((CVSMergeSubscriber)currentSubcriber).getStartTag();
CVSTag endTag = ((CVSMergeSubscriber)currentSubcriber).getEndTag();
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 8d8e3060c..8b67a11fc 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,7 +10,6 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
@@ -20,12 +19,12 @@ import org.eclipse.ui.part.IPageBookViewPage;
public class WorkspaceSynchronizeParticipant extends TeamSubscriberParticipant {
- public final static QualifiedName ID = new QualifiedName("org.eclipse.team.cvs.ui.cvsworkspace-participant", "syncparticipant"); //$NON-NLS-1$ //$NON-NLS-2$
+ public final static String ID = "org.eclipse.team.cvs.ui.cvsworkspace-participant"; //$NON-NLS-1$
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#init(org.eclipse.team.ui.sync.ISynchronizeView, org.eclipse.team.core.ISaveContext)
*/
- public void init(QualifiedName id) throws PartInitException {
+ public void init(String id) throws PartInitException {
TeamSubscriber subscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
setSubscriber(subscriber);
}
@@ -33,7 +32,7 @@ public class WorkspaceSynchronizeParticipant extends TeamSubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#saveState(org.eclipse.team.core.ISaveContext)
*/
- public void saveState() {
+ public void saveState(int instanceid) {
// no state to save
}
diff --git a/bundles/org.eclipse.team.ui/plugin.properties b/bundles/org.eclipse.team.ui/plugin.properties
index 9a167c3f7..56c08c388 100644
--- a/bundles/org.eclipse.team.ui/plugin.properties
+++ b/bundles/org.eclipse.team.ui/plugin.properties
@@ -14,7 +14,7 @@ pluginName=Team Support UI
Team=Team
configurationWizards=Configuration Wizards
targetWizards=Target Site Addition Wizards
-synchronizePartners=Synchronize View Participants Extension
+synchronizeParticipants=Synchronize View Participants
TeamPreferencePage.name=Team
TextPreferencePage.name=File Content
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index adad335a5..cf0f40db5 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -21,7 +21,7 @@
<extension-point id="configurationWizards" name="%configurationWizards" schema="schema/configurationWizards.exsd"/>
- <extension-point id="synchronizeParticipants" name="%synchronizeParticipants"/>
+ <extension-point id="synchronizeParticipants" name="%synchronizeParticipants" schema="schema/synchronizeParticipants.exsd"/>
<!-- **************** PREFERENCES ******************* -->
<extension
diff --git a/bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd b/bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd
new file mode 100644
index 000000000..6c70ba491
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/schema/synchronizeParticipants.exsd
@@ -0,0 +1,149 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.team.ui">
+<annotation>
+ <appInfo>
+ <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.
+&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;.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="participant"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ A fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ An optional identifier of the extension instance.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ An optional name for this extension instance.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="participant">
+ <complexType>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+ An icon that will be used when showing this participant in lists and menus.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" 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.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" 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.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="qualified_name" type="string">
+ <annotation>
+ <documentation>
+ A unique name that will be used to identify this type of participant.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="local_name" type="string">
+ <annotation>
+ <documentation>
+ A unique identifier
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 3.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </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;
+&lt;/extension&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <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
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 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 &lt;a href=&quot;http://www.eclipse.org/legal/cpl-v10.html&quot;&gt;http://www.eclipse.org/legal/cpl-v10.html&lt;/a&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java
index af7103f09..2f2bbc970 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberInputJob.java
@@ -98,7 +98,6 @@ public class RefreshSubscriberInputJob extends RefreshSubscriberJob {
for (Iterator it = inputs.iterator(); it.hasNext();) {
SubscriberInput input = (SubscriberInput) it.next();
TeamSubscriber subscriber = input.getSubscriber();
- monitor.setTaskName(subscriber.getName());
subscriber.refresh(input.workingSetRoots(), IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, 100));
}
} catch(TeamException e) {
@@ -118,7 +117,7 @@ public class RefreshSubscriberInputJob extends RefreshSubscriberJob {
*/
protected String getTaskName() {
// Return a meaningfull task nam since the job name will be generic
- return Policy.bind("RefreshSubscriberJob.1", String.valueOf(inputs.size()), "all");
+ return Policy.bind("RefreshSubscriberJob.1", String.valueOf(inputs.size()), "all"); //$NON-NLS-1$
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
index 385b56d2d..b7ecb7965 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java
@@ -127,7 +127,6 @@ public class RefreshSubscriberJob extends WorkspaceJob {
return Status.CANCEL_STATUS;
}
try {
- monitor.setTaskName(subscriber.getName());
subscriber.refresh(roots, IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, 100));
} catch(TeamException e) {
status.merge(e.getStatus());
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/ISynchronizeParticipantDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/ISynchronizeParticipantDescriptor.java
new file mode 100644
index 000000000..0cf403a99
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/ISynchronizeParticipantDescriptor.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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.ui.registry;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+public interface ISynchronizeParticipantDescriptor {
+ public String getDescription();
+ public String getId();
+ public String getType();
+ public ImageDescriptor getImageDescriptor();
+ public boolean isStatic();
+ public IConfigurationElement getConfigurationElement();
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
index 97df12e55..7e9755c15 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/SynchronizeParticipantDescriptor.java
@@ -10,29 +10,31 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.registry;
-import org.eclipse.core.runtime.*;
+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.jface.resource.ImageDescriptor;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.ui.internal.WorkbenchPlugin;
-public class SynchronizeParticipantDescriptor {
- private QualifiedName id;
- private ImageDescriptor imageDescriptor;
- 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 class SynchronizeParticipantDescriptor implements ISynchronizeParticipantDescriptor {
+ public static final String ATT_ID = "id"; //$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$
- private static final String ATT_TYPE = "type"; //$NON-NLS-1$
-
- private static final String TYPE_STATIC = "static";
+ private static final String ATT_TYPE = "type"; //$NON-NLS-1$
+ private static final String TYPE_STATIC = "static"; //$NON-NLS-1$
private String label;
private String className;
private String type;
- private IConfigurationElement configElement;
+ private String id;
+ private ImageDescriptor imageDescriptor;
private String description;
+
+ private IConfigurationElement configElement;
/**
* Create a new ViewDescriptor for an extension.
@@ -64,7 +66,7 @@ public class SynchronizeParticipantDescriptor {
return description;
}
- public QualifiedName getId() {
+ public String getId() {
return id;
}
@@ -95,19 +97,18 @@ public class SynchronizeParticipantDescriptor {
* load a view descriptor from the registry.
*/
private void loadFromExtension() throws CoreException {
- String qualified_name = configElement.getAttribute(ATT_QUALIFIED_NAME);
- String local_name = configElement.getAttribute(ATT_LOCAL_NAME);
+ String identifier = configElement.getAttribute(ATT_ID);
label = configElement.getAttribute(ATT_NAME);
className = configElement.getAttribute(ATT_CLASS);
type = configElement.getAttribute(ATT_TYPE);
// Sanity check.
- if ((label == null) || (className == null) || (local_name == null)) {
+ if ((label == null) || (className == null) || (identifier == 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);
+ id = identifier;
}
/**
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 e6ea9da04..73ab80fe3 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
@@ -19,7 +19,7 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
public class SynchronizeParticipantRegistry extends RegistryReader {
- private static final String TAG_SYNCPARTICIPANT = "participant";
+ private static final String TAG_SYNCPARTICIPANT = "participant"; //$NON-NLS-1$
private Map participants = new HashMap();
public SynchronizeParticipantRegistry() {
@@ -35,7 +35,7 @@ public class SynchronizeParticipantRegistry extends RegistryReader {
SynchronizeParticipantDescriptor desc;
try {
desc = new SynchronizeParticipantDescriptor(element, descText);
- participants.put(desc.getId().getQualifier(), desc);
+ participants.put(desc.getId(), desc);
} catch (CoreException e) {
TeamUIPlugin.log(e);
}
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 ec0eb4df7..7353ead4a 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
@@ -21,7 +21,6 @@ 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.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.util.ListenerList;
import org.eclipse.team.core.ISaveContext;
@@ -32,6 +31,7 @@ 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.ui.ITeamUIConstants;
@@ -62,6 +62,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/**
* List of registered synchronize view pages
+ * {String id -> List participant instances}
*/
private Map synchronizeParticipants = new HashMap(10);
private SynchronizeParticipantRegistry participantRegistry = new SynchronizeParticipantRegistry();
@@ -73,9 +74,12 @@ public class SynchronizeManager implements ISynchronizeManager {
// save context constants
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_QUALIFIED_NAME = "qualified_name"; //$NON-NLS-1$
- private final static String CTX_LOCAL_NAME = "local_name"; //$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 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
@@ -197,7 +201,7 @@ public class SynchronizeManager implements ISynchronizeManager {
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.ISynchronizeManager#find(java.lang.String)
*/
- public ISynchronizeParticipant find(QualifiedName id) {
+ public ISynchronizeParticipant find(String id, String instance_id) {
return (ISynchronizeParticipant)synchronizeParticipants.get(id);
}
@@ -246,14 +250,13 @@ public class SynchronizeManager implements ISynchronizeManager {
*/
public void initialize() {
try {
- // Initialize the participant registry
+ // 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
+ // Instantiate and register any participants saved from a previous session.
restoreSynchronizeParticipants();
- // Instantiate and register any static participant that has not already been
- // created.
+ // 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++) {
@@ -281,15 +284,14 @@ public class SynchronizeManager implements ISynchronizeManager {
for (int i = 0; i < contexts.length; i++) {
ISaveContext context = contexts[i];
if(context.getName().equals(CTX_PARTICIPANT)) {
- String qualified_name = context.getAttribute(CTX_QUALIFIED_NAME);
- String local_name = context.getAttribute(CTX_LOCAL_NAME);
- SynchronizeParticipantDescriptor desc = participantRegistry.find(qualified_name);
- QualifiedName id = new QualifiedName(qualified_name, local_name);
+ 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(id, desc));
+ participants.add(createParticipant(instanceid, desc));
} else {
- TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("SynchronizeManager.9", id.toString()), null)); //$NON-NLS-1$
+ TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("SynchronizeManager.9", id), null)); //$NON-NLS-1$
}
}
}
@@ -302,10 +304,10 @@ public class SynchronizeManager implements ISynchronizeManager {
/**
* Creates a participant instance with the given id from the participant description
*/
- private ISynchronizeParticipant createParticipant(QualifiedName id, SynchronizeParticipantDescriptor desc) throws CoreException {
+ private ISynchronizeParticipant createParticipant(String instanceid, SynchronizeParticipantDescriptor desc) throws CoreException {
ISynchronizeParticipant participant = (ISynchronizeParticipant)TeamUIPlugin.createExtension(desc.getConfigurationElement(), SynchronizeParticipantDescriptor.ATT_CLASS);
- participant.setInitializationData(desc.getConfigurationElement(), id.toString(), id);
- participant.init(id);
+ participant.setInitializationData(desc.getConfigurationElement(), instanceid, null);
+ participant.init(instanceid);
return participant;
}
@@ -319,16 +321,20 @@ public class SynchronizeManager implements ISynchronizeManager {
List children = new ArrayList();
try {
for (Iterator it = synchronizeParticipants.values().iterator(); it.hasNext();) {
- ISynchronizeParticipant participant = (ISynchronizeParticipant) it.next();
- QualifiedName id = participant.getId();
- ISaveContext item = new SaveContext();
- item.setName(CTX_PARTICIPANT);
- Map attributes = new HashMap();
- attributes.put(CTX_QUALIFIED_NAME, id.getQualifier());
- attributes.put(CTX_LOCAL_NAME, id.getLocalName());
- item.setAttributes(attributes);
- children.add(item);
- participant.saveState();
+ 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++;
+ }
}
root.setChildren((SaveContext[])children.toArray(new SaveContext[children.size()]));
SaveContextXMLWriter.writeXMLPluginMetaFile(TeamUIPlugin.getPlugin(), FILENAME, (SaveContext)root);
@@ -336,4 +342,11 @@ public class SynchronizeManager implements ISynchronizeManager {
TeamUIPlugin.log(new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("SynchronizeManager.10"), e)); //$NON-NLS-1$
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizeManager#getParticipantDescriptor(java.lang.String)
+ */
+ public ISynchronizeParticipantDescriptor getParticipantDescriptor(String id) {
+ return participantRegistry.find(id);
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
index bd41f8008..062c9232e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/NavigateAction.java
@@ -32,12 +32,10 @@ import org.eclipse.ui.IWorkbenchActionConstants;
*/
public class NavigateAction extends Action {
private final int direction;
- private IViewPart part;
private TeamSubscriberParticipantPage page;
public NavigateAction(IViewPart part, TeamSubscriberParticipantPage page, int direction) {
this.page = page;
- this.part = part;
this.direction = direction;
IKeyBindingService kbs = part.getSite().getKeyBindingService();
@@ -69,12 +67,12 @@ public class NavigateAction extends Action {
if(info.getLocal().getType() != IResource.FILE) {
if(! navigable.gotoDifference(direction)) {
info = getSyncInfoFromSelection();
- OpenInCompareAction.openCompareEditor(part, info, true /* keep focus */);
+ OpenInCompareAction.openCompareEditor(page, info, true /* keep focus */);
}
return;
}
- IEditorPart editor = OpenInCompareAction.findOpenCompareEditor(part.getSite(), info.getLocal());
+ IEditorPart editor = OpenInCompareAction.findOpenCompareEditor(page.getSynchronizeView().getSite(), info.getLocal());
boolean atEnd = false;
CompareEditorInput input;
ICompareNavigator navigator;
@@ -87,19 +85,19 @@ public class NavigateAction extends Action {
if(navigator.selectChange(direction == INavigableControl.NEXT)) {
if(! navigable.gotoDifference(direction)) {
info = getSyncInfoFromSelection();
- OpenInCompareAction.openCompareEditor(part, info, true /* keep focus */);
+ OpenInCompareAction.openCompareEditor(page, info, true /* keep focus */);
}
}
}
} else {
// otherwise, select the next change and open a compare editor which will automatically
// show the first change.
- OpenInCompareAction.openCompareEditor(part, info, true /* keep focus */);
+ OpenInCompareAction.openCompareEditor(page, info, true /* keep focus */);
}
}
private SyncInfo getSyncInfoFromSelection() {
- IStructuredSelection selection = (IStructuredSelection)part.getSite().getPage().getSelection();
+ IStructuredSelection selection = (IStructuredSelection)page.getSynchronizeView().getSite().getPage().getSelection();
if(selection == null) return null;
Object obj = selection.getFirstElement();
SyncInfo info = OpenInCompareAction.getSyncInfo(obj);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
index b1cd30fa1..8ec603520 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java
@@ -28,7 +28,14 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.actions.TeamAction;
import org.eclipse.team.internal.ui.synchronize.compare.SyncInfoCompareInput;
-import org.eclipse.ui.*;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.TeamSubscriberParticipantPage;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IReusableEditor;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPartSite;
/**
* Action to open a compare editor from a SyncInfo object.
@@ -38,9 +45,9 @@ import org.eclipse.ui.*;
*/
public class OpenInCompareAction extends Action {
- private IViewPart part;
+ private TeamSubscriberParticipantPage part;
- public OpenInCompareAction(IViewPart part) {
+ public OpenInCompareAction(TeamSubscriberParticipantPage part) {
this.part = part;
Utils.initAction(this, "action.openInCompareEditor."); //$NON-NLS-1$
}
@@ -54,23 +61,23 @@ public class OpenInCompareAction extends Action {
}
}
- public static SyncInfoCompareInput openCompareEditor(IViewPart part, SyncInfo info, boolean keepFocus) {
- SyncInfoCompareInput input = getCompareInput(info);
+ public static SyncInfoCompareInput openCompareEditor(TeamSubscriberParticipantPage page, SyncInfo info, boolean keepFocus) {
+ SyncInfoCompareInput input = getCompareInput(page.getParticipant(), info);
if(input != null) {
- IWorkbenchPage page = part.getSite().getPage();
- IEditorPart editor = findReusableCompareEditor(page);
+ IWorkbenchPage wpage = page.getSite().getPage();
+ IEditorPart editor = findReusableCompareEditor(wpage);
if(editor != null) {
IEditorInput otherInput = editor.getEditorInput();
if(otherInput instanceof SyncInfoCompareInput && otherInput.equals(input)) {
// simply provide focus to editor
- page.activate(editor);
+ wpage.activate(editor);
} else {
// if editor is currently not open on that input either re-use existing
if (!prefetchFileContents(info)) return null;
if(editor != null && editor instanceof IReusableEditor) {
CompareUI.reuseCompareEditor(input, (IReusableEditor)editor);
- page.activate(editor);
+ wpage.activate(editor);
}
}
} else {
@@ -78,7 +85,7 @@ public class OpenInCompareAction extends Action {
}
if(keepFocus) {
- page.activate(part);
+ wpage.activate(page.getSynchronizeView());
}
return input;
}
@@ -122,9 +129,9 @@ public class OpenInCompareAction extends Action {
/**
* Returns a SyncInfoCompareInput instance for the current selection.
*/
- private static SyncInfoCompareInput getCompareInput(SyncInfo info) {
+ private static SyncInfoCompareInput getCompareInput(ISynchronizeParticipant participant, SyncInfo info) {
if (info != null && info.getLocal() instanceof IFile) {
- return SyncInfoCompareInput.createInput(info);
+ return SyncInfoCompareInput.createInput(participant, info);
}
return null;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
index 2a5716659..0720baf62 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenWithActionGroup.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider;
+import org.eclipse.team.ui.synchronize.TeamSubscriberParticipantPage;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.OpenWithMenu;
@@ -29,16 +30,18 @@ public class OpenWithActionGroup extends ActionGroup {
private OpenFileInSystemEditorAction openFileAction;
private OpenInCompareAction openInCompareAction;
+ private TeamSubscriberParticipantPage page;
private IViewPart part;
- public OpenWithActionGroup(IViewPart part) {
- this.part = part;
+ public OpenWithActionGroup(TeamSubscriberParticipantPage page) {
+ this.page = page;
+ this.part = page.getSynchronizeView();
makeActions();
}
protected void makeActions() {
openFileAction = new OpenFileInSystemEditorAction(part.getSite().getPage());
- openInCompareAction = new OpenInCompareAction(part);
+ openInCompareAction = new OpenInCompareAction(page);
}
public void fillContextMenu(IMenuManager menu) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshAction.java
index bd8f4bc53..08a4f02fe 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshAction.java
@@ -79,7 +79,7 @@ public class RefreshAction extends Action {
// The scheduled background refresh will restart automatically.
Platform.getJobManager().cancel(RefreshSubscriberJob.getFamily());
if(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_BACKGROUND_SYNC)) {
- RefreshSubscriberJob job = new RefreshSubscriberJob(Policy.bind("SyncViewRefresh.taskName", new Integer(resources.length).toString(), subscriber.getName()), resources, subscriber); //$NON-NLS-1$
+ RefreshSubscriberJob job = new RefreshSubscriberJob(Policy.bind("SyncViewRefresh.taskName", new Integer(resources.length).toString(), ""), resources, subscriber);
JobStatusHandler.schedule(job, SubscriberAction.SUBSCRIBER_JOB_TYPE);
} else {
runBlocking(subscriber, resources);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoCompareInput.java
index d2b7f24d6..928ca46d4 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/compare/SyncInfoCompareInput.java
@@ -29,15 +29,18 @@ import org.eclipse.team.core.sync.IRemoteResource;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.ui.ISharedImages;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
public class SyncInfoCompareInput extends CompareEditorInput {
private SyncInfo sync;
private SyncInfoDiffNode node;
private static Image titleImage;
+ private static ISynchronizeParticipant participant;
- public static SyncInfoCompareInput createInput(SyncInfo sync) {
+ public static SyncInfoCompareInput createInput(ISynchronizeParticipant participant, SyncInfo sync) {
+ SyncInfoCompareInput.participant = participant;
// Create the local ITypedElement
ITypedElement localTypedElement = SyncInfoDiffNode.createTypeElement(sync.getLocal(), sync.getKind());
@@ -109,7 +112,7 @@ public class SyncInfoCompareInput extends CompareEditorInput {
* @see org.eclipse.compare.CompareEditorInput#getTitle()
*/
public String getTitle() {
- return Policy.bind("SyncInfoCompareInput.title", sync.getSubscriber().getName(), node.getName()); //$NON-NLS-1$
+ return Policy.bind("SyncInfoCompareInput.title", participant.getName(), node.getName()); //$NON-NLS-1$
}
protected void updateLabels() {
@@ -156,7 +159,7 @@ public class SyncInfoCompareInput extends CompareEditorInput {
* @see org.eclipse.ui.IEditorInput#getToolTipText()
*/
public String getToolTipText() {
- return Policy.bind("SyncInfoCompareInput.tooltip", sync.getSubscriber().getName(), node.getName()); //$NON-NLS-1$
+ return Policy.bind("SyncInfoCompareInput.tooltip", participant.getName(), node.getName()); //$NON-NLS-1$
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SynchronizeViewNode.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SynchronizeViewNode.java
index 9ac04d469..50e10ed5d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SynchronizeViewNode.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SynchronizeViewNode.java
@@ -16,8 +16,7 @@ import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ui.synchronize.sets.SubscriberInput;
import org.eclipse.team.internal.ui.synchronize.sets.SyncSet;
-import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.ui.IActionFilter;
+import org.eclipse.team.ui.synchronize.ITeamSubscriberParticipantNode;
/**
* A SynchronizeViewNode instance appears in the Synchronize View. Actions contributed to
@@ -26,7 +25,7 @@ import org.eclipse.ui.IActionFilter;
* <p>
* @see org.eclipse.team.ui.sync.ISynchronizeViewNode
*/
-public class SynchronizeViewNode implements IAdaptable, IActionFilter, ITeamSubscriberParticipantNode {
+public class SynchronizeViewNode implements IAdaptable, ITeamSubscriberParticipantNode {
private IResource resource;
private SubscriberInput input;
@@ -114,21 +113,4 @@ public class SynchronizeViewNode implements IAdaptable, IActionFilter, ITeamSubs
public String toString() {
return "SynchronizeViewNode for " + getResource().getFullPath().toString(); //$NON-NLS-1$
}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionFilter#testAttribute(java.lang.Object, java.lang.String, java.lang.String)
- */
- public boolean testAttribute(Object target, String name, String value) {
- if (!(target instanceof SynchronizeViewNode)) {
- return false;
- }
- TeamSubscriber subscriber = ((SynchronizeViewNode) target).getTeamSubscriber();
- String qualifier = subscriber.getId().getQualifier();
- if (name.equals("startsWith")) { //$NON-NLS-1$
- return qualifier.startsWith(value);
- } else if(name.equals("equals")) { //$NON-NLS-1$
- return qualifier.equals(value);
- }
- return false;
- }
}
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 2b8b7e728..c5056759e 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
@@ -14,7 +14,6 @@ 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.QualifiedName;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.ListenerList;
@@ -37,7 +36,7 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
private ListenerList fListeners;
private String fName;
- private QualifiedName fId;
+ private String fId;
private ImageDescriptor fImageDescriptor;
protected IConfigurationElement configElement;
@@ -152,7 +151,7 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
*
* @see org.eclipse.team.ui.sync.ISynchronizeParticipant#getId()
*/
- public QualifiedName getId() {
+ public String getId() {
return fId;
}
@@ -210,7 +209,7 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
configElement = config;
// Id
- fId = new QualifiedName(config.getAttribute("qualified_name"), config.getAttribute("local_name"));
+ fId = config.getAttribute("id");
// Title.
fName = config.getAttribute("name"); //$NON-NLS-1$
@@ -252,10 +251,6 @@ public abstract class AbstractSynchronizeParticipant implements ISynchronizePart
protected void dispose() {
}
- protected void setId(QualifiedName id) {
- this.fId = id;
- }
-
/**
* Sets the image descriptor for this console to the specified value and
* notifies property listeners of the change.
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 38611a75c..f733ffda5 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
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
-import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.team.internal.ui.registry.ISynchronizeParticipantDescriptor;
import org.eclipse.ui.IWorkbenchPage;
/**
@@ -74,11 +74,21 @@ public interface ISynchronizeManager {
public ISynchronizeView showSynchronizeViewInActivePage(IWorkbenchPage page);
/**
- * Returns a registered synchronize participant with the given id, io <code>null</code>
- * if one with that id is not registered.
+ * 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.
*
- * @return a registered synchronize participant with the given id, io <code>null</code>
+ * @return a registered synchronize participant with the given id, or <code>null</code>
* if one with that id is not registered.
*/
- public ISynchronizeParticipant find(QualifiedName id);
-}
+ public ISynchronizeParticipant find(String id, String instance_id);
+
+ /**
+ * Returns the participant descriptor for the given participant id or
+ * <code>null</code> if a descriptor is not found for that id.
+ *
+ * @return the participant descriptor for the given participant id or
+ * <code>null</code> if a descriptor is not found for that id.
+ */
+ public ISynchronizeParticipantDescriptor getParticipantDescriptor(String id);
+} \ No newline at end of file
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 a51493e60..bac6bd8da 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
@@ -11,7 +11,6 @@
package org.eclipse.team.ui.synchronize;
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;
@@ -37,7 +36,7 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
* @return the unique id that identified the <i>type <i>of this
* synchronize participant.
*/
- public QualifiedName getId();
+ public String getId();
/**
* Returns the name of this synchronize participant.
@@ -84,12 +83,12 @@ public interface ISynchronizeParticipant extends IExecutableExtension {
* @exception PartInitException
* if this participant was not initialized successfully
*/
- public void init(QualifiedName id) throws PartInitException;
+ public void init(String id) throws PartInitException;
/**
* Saves the participants object state.
*/
- public void saveState();
+ public void saveState(int instanceid);
/**
* Adds a listener for changes to properties of this synchronize
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
index a5f1c5897..e23480b3c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantPage.java
@@ -148,7 +148,7 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
createViewer(composite);
// create actions
- openWithActions = new OpenWithActionGroup(view);
+ openWithActions = new OpenWithActionGroup(this);
refactorActions = new RefactorActionGroup(view);
gotoNext = new NavigateAction(view, this, INavigableControl.NEXT);
gotoPrevious = new NavigateAction(view, this, INavigableControl.PREVIOUS);
@@ -199,7 +199,7 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
private void hookContextMenu() {
if(getViewer() != null) {
- MenuManager menuMgr = new MenuManager(participant.getId().getQualifier()); //$NON-NLS-1$
+ MenuManager menuMgr = new MenuManager(participant.getId()); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
@@ -208,7 +208,7 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
});
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(participant.getId().getQualifier(), menuMgr, viewer);
+ getSite().registerContextMenu(participant.getId(), menuMgr, viewer);
}
}
@@ -595,4 +595,11 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
public TeamSubscriberParticipant getParticipant() {
return participant;
}
+
+ /**
+ * @return Returns the view.
+ */
+ public ISynchronizeView getSynchronizeView() {
+ return view;
+ }
} \ No newline at end of file

Back to the top