Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-10-27 15:15:32 +0000
committerJean Michel-Lemieux2003-10-27 15:15:32 +0000
commitd9a5e7af090c48b909ee73aad2ac048d3d76e756 (patch)
tree0c09bdc7bf4643e3ea3a2efd0cd6b2ce2add7739
parent730f6aba4c42f2275099a9f3a95718e05936a12c (diff)
downloadeclipse.platform.team-d9a5e7af090c48b909ee73aad2ac048d3d76e756.tar.gz
eclipse.platform.team-d9a5e7af090c48b909ee73aad2ac048d3d76e756.tar.xz
eclipse.platform.team-d9a5e7af090c48b909ee73aad2ac048d3d76e756.zip
*** empty log message ***
-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.ui/plugin.xml44
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java98
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java74
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java13
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeParticipant.java27
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java10
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml15
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantPage.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSynchronizingPerspective.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TeamSynchronizingPerspective.java)3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java17
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantLabelProvider.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncViewerLabelProvider.java)60
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/package.html17
15 files changed, 274 insertions, 145 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 932b4e145..b79356c0e 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
@@ -58,8 +58,8 @@ import org.eclipse.team.internal.core.SaveContext;
*/
public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResourceChangeListener, ITeamResourceChangeListener {
- private final static String QUALIFIED_NAME = "org.eclipse.team.cvs.ui.cvsmerge-participant"; //$NON-NLS-1$
- public static final String UNIQUE_ID_PREFIX = "merge-"; //$NON-NLS-1$
+ public static final String QUALIFIED_NAME = "org.eclipse.team.cvs.ui.cvsmerge-participant"; //$NON-NLS-1$
+ private static final String UNIQUE_ID_PREFIX = "merge-"; //$NON-NLS-1$
private CVSTag start, end;
private List roots;
@@ -85,7 +85,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
private static QualifiedName getUniqueId() {
String uniqueId = Long.toString(System.currentTimeMillis());
- return new QualifiedName(QUALIFIED_NAME, "CVS" + UNIQUE_ID_PREFIX + uniqueId);
+ return new QualifiedName(QUALIFIED_NAME, "CVS" + UNIQUE_ID_PREFIX + uniqueId); //$NON-NLS-1$
}
public CVSMergeSubscriber(IResource[] roots, CVSTag start, CVSTag end) {
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 8b2ad3634..5f2332d32 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -285,7 +285,7 @@
tooltip="%GenerateDiff.tooltip"
class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
menubarPath="team.main/group1"
- helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
+ helpContextId="org.eclipse.team.cvs.ui.team_create__action_context"
id="org.eclipse.team.ccvs.ui.GenerateDiff">
</action>
<action
@@ -626,7 +626,47 @@
class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndUpdateAction"
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overupdate_action"
id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overupdate">
- </action>
+ </action>
+ <action
+ label="%ShowHistoryAction.label"
+ tooltip="%ShowHistoryAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
+ id="org.eclipse.team.ccvs.ui.showHistory">
+ </action>
+ <action
+ label="%ShowAnnotationAction.label"
+ tooltip="%ShowAnnotationAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
+ id="org.eclipse.team.ccvs.ui.showAnnotation">
+ </action>
+ <action
+ label="%BranchAction.label"
+ tooltip="%BranchAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
+ id="org.eclipse.team.ccvs.ui.branch">
+ </action>
+ <action
+ label="%GenerateDiff.label"
+ tooltip="%GenerateDiff.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
+ id="org.eclipse.team.ccvs.ui.GenerateDiff">
+ </action>
+ <action
+ label="%IgnoreAction.label"
+ tooltip="%IgnoreAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
+ menubarPath="SubscriberActionsGroup3"
+ helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
+ id="org.eclipse.team.ccvs.ui.ignore">
+ </action>
</viewerContribution>
<viewerContribution
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
index ceb1d565b..c7a6db016 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
@@ -83,6 +83,30 @@ public class CVSLightweightDecorator
}
}
+ public static class Decoration implements IDecoration {
+ public String prefix, suffix;
+ public ImageDescriptor overlay;
+
+ /**
+ * @see org.eclipse.jface.viewers.IDecoration#addPrefix(java.lang.String)
+ */
+ public void addPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+ /**
+ * @see org.eclipse.jface.viewers.IDecoration#addSuffix(java.lang.String)
+ */
+ public void addSuffix(String suffix) {
+ this.suffix = suffix;
+ }
+ /**
+ * @see org.eclipse.jface.viewers.IDecoration#addOverlay(org.eclipse.jface.resource.ImageDescriptor)
+ */
+ public void addOverlay(ImageDescriptor overlay) {
+ this.overlay = overlay;
+ }
+ }
+
static {
dirty = new CachedImageDescriptor(TeamUIPlugin.getImageDescriptor(ISharedImages.IMG_DIRTY_OVR));
checkedIn = new CachedImageDescriptor(TeamUIPlugin.getImageDescriptor(ISharedImages.IMG_CHECKEDIN_OVR));
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
index 58d40796e..1495b3fcf 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
@@ -48,7 +48,7 @@ import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ui.actions.TeamAction;
import org.eclipse.team.internal.ui.dialogs.IPromptCondition;
-import org.eclipse.team.ui.synchronize.ITeamSubscriberParticipantNode;
+import org.eclipse.team.internal.ui.synchronize.views.SynchronizeViewNode;
import org.eclipse.ui.PlatformUI;
/**
@@ -79,7 +79,7 @@ abstract public class CVSAction extends TeamAction {
handle(e);
}
}
-
+
/**
* This method gets invoked before the <code>CVSAction#execute(IAction)</code>
* method. It can preform any prechecking and initialization required before
@@ -96,12 +96,12 @@ abstract public class CVSAction extends TeamAction {
}
return true;
}
-
+
/**
* Actions must override to do their work.
*/
abstract protected void execute(IAction action) throws InvocationTargetException, InterruptedException;
-
+
/**
* This method gets invoked after <code>CVSAction#execute(IAction)</code>
* if no exception occured. Sunclasses may override but should invoke this
@@ -145,7 +145,7 @@ abstract public class CVSAction extends TeamAction {
protected String getWarningTitle() {
return Policy.bind("CVSAction.warningTitle"); //$NON-NLS-1$
}
-
+
/**
* Return the message to be used for the parent MultiStatus when
* mulitple errors occur during an action.
@@ -201,7 +201,7 @@ abstract public class CVSAction extends TeamAction {
handle(exception, getErrorTitle(), null);
return;
}
-
+
// For now, display both the exception and the problem status
// Later, we can determine how to display both together
if (exception != null) {
@@ -223,7 +223,7 @@ abstract public class CVSAction extends TeamAction {
}
CVSUIPlugin.openError(getShell(), title, message, new CVSException(statusToDisplay));
}
-
+
/**
* Convenience method for running an operation with the appropriate progress.
* Any exceptions are propogated so they can be handled by the
@@ -246,31 +246,31 @@ abstract public class CVSAction extends TeamAction {
switch (progressKind) {
case PROGRESS_WORKBENCH_WINDOW :
try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, runnable);
- } catch (InterruptedException e1) {
- exceptions[0] = null;
- e1.printStackTrace();
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, runnable);
+ } catch (InterruptedException e1) {
+ exceptions[0] = null;
+ e1.printStackTrace();
+ } catch (InvocationTargetException e) {
+ exceptions[0] = e;
+ }
+ break;
+ case PROGRESS_BUSYCURSOR :
+ BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
+ public void run() {
+ try {
+ innerRunnable.run(new NullProgressMonitor());
} catch (InvocationTargetException e) {
exceptions[0] = e;
+ } catch (InterruptedException e) {
+ exceptions[0] = e;
}
- break;
- case PROGRESS_BUSYCURSOR :
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- public void run() {
- try {
- innerRunnable.run(new NullProgressMonitor());
- } catch (InvocationTargetException e) {
- exceptions[0] = e;
- } catch (InterruptedException e) {
- exceptions[0] = e;
- }
- }
- });
- break;
- case PROGRESS_DIALOG :
- default :
- new ProgressMonitorDialog(getShell()).run(cancelable, true, innerRunnable);
- break;
+ }
+ });
+ break;
+ case PROGRESS_DIALOG :
+ default :
+ new ProgressMonitorDialog(getShell()).run(cancelable, true, innerRunnable);
+ break;
}
if (exceptions[0] != null) {
if (exceptions[0] instanceof InvocationTargetException)
@@ -289,6 +289,8 @@ abstract public class CVSAction extends TeamAction {
return false;
}
+
+
/**
* Returns the selected CVS resources
*/
@@ -298,11 +300,7 @@ abstract public class CVSAction extends TeamAction {
resources = new ArrayList();
Iterator elements = ((IStructuredSelection) selection).iterator();
while (elements.hasNext()) {
- Object next = elements.next();
- if(next instanceof ITeamSubscriberParticipantNode) {
- resources.add(((ITeamSubscriberParticipantNode)next).getSyncInfo().getRemote());
- continue;
- }
+ Object next = elements.next();
if (next instanceof ICVSResource) {
resources.add(next);
continue;
@@ -322,7 +320,7 @@ abstract public class CVSAction extends TeamAction {
}
return new ICVSResource[0];
}
-
+
/**
* Get selected CVS remote folders
*/
@@ -352,7 +350,7 @@ abstract public class CVSAction extends TeamAction {
}
return new ICVSRemoteFolder[0];
}
-
+
/**
* Returns the selected remote resources
*/
@@ -388,7 +386,7 @@ abstract public class CVSAction extends TeamAction {
}
return new ICVSRemoteResource[0];
}
-
+
/**
* A helper prompt condition for prompting for CVS dirty state.
*/
@@ -403,7 +401,7 @@ abstract public class CVSAction extends TeamAction {
}
};
}
-
+
/**
* Checks if a the resources' parent's tags are different then the given tag.
* Prompts the user that they are adding mixed tags and returns <code>true</code> if
@@ -435,7 +433,7 @@ abstract public class CVSAction extends TeamAction {
MessageDialog.QUESTION,
new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL},
0);
-
+
result[0] = dialog.open() == 0;
if(result[0] && dialog.isDontShowAgain()) {
store.setValue(ICVSUIConstants.PREF_PROMPT_ON_MIXED_TAGS, false);
@@ -480,5 +478,25 @@ abstract public class CVSAction extends TeamAction {
protected RepositoryManager getRepositoryManager() {
return CVSUIPlugin.getPlugin().getRepositoryManager();
}
-
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.actions.TeamAction#getSelectedResources()
+ */
+ protected IResource[] getSelectedResources() {
+ if(selection.isEmpty()) return new IResource[0];
+ Iterator it = selection.iterator();
+ List resources = new ArrayList();
+ while(it.hasNext()) {
+ Object element = it.next();
+ if(element instanceof SynchronizeViewNode) {
+ resources.add(((SynchronizeViewNode)element).getResource());
+ } else {
+ Object adapter = getAdapter(element, IResource.class);
+ if (adapter instanceof IResource) {
+ resources.add(adapter);
+ }
+ }
+ }
+ return (IResource[]) resources.toArray(new IResource[resources.size()]);
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
index a456be8b7..230a3638e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
@@ -42,12 +42,11 @@ import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
-public class ShowAnnotationAction extends CVSAction {
-
-/**
- * Action to open a CVS Annotate View
- */
+public class ShowAnnotationAction extends WorkspaceAction {
+ /**
+ * Action to open a CVS Annotate View
+ */
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
// Get the selected resource.
final ICVSResource cvsResource = getSingleSelectedCVSResource();
@@ -58,43 +57,43 @@ public class ShowAnnotationAction extends CVSAction {
final AnnotateListener listener = new AnnotateListener();
if (cvsResource == null) {
- return;
+ return;
}
// Get the selected revision
final String revision;
try {
ResourceSyncInfo info = cvsResource.getSyncInfo();
- if(info == null) {
- handle(new CVSException(Policy.bind("ShowAnnotationAction.noSyncInfo", cvsResource.getName())));
+ if (info == null) {
+ handle(new CVSException(Policy.bind("ShowAnnotationAction.noSyncInfo", cvsResource.getName()))); //$NON-NLS-1$
return;
}
revision = cvsResource.getSyncInfo().getRevision();
} catch (CVSException e) {
throw new InvocationTargetException(e);
}
-
+
// Run the CVS Annotate action with a progress monitor
run(new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
fetchAnnotation(listener, cvsResource, revision, monitor);
- }
+ }
}, true, PROGRESS_DIALOG);
-
if (listener.hasError()) {
throw new InvocationTargetException(new CVSException(Policy.bind("ShowAnnotationAction.1", listener.getError()))); //$NON-NLS-1$
}
-
+
// Open the view
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
try {
PlatformUI.getWorkbench().showPerspective("org.eclipse.team.cvs.ui.cvsPerspective", window); //$NON-NLS-1$
} catch (WorkbenchException e1) {
- // If this does not work we will just open the view in the curren perspective.
+ // If this does not work we will just open the view in the
+ // curren perspective.
}
}
-
+
try {
AnnotateView view = AnnotateView.openInActivePerspective();
view.showAnnotations(cvsResource, listener.getCvsAnnotateBlocks(), listener.getContents());
@@ -105,6 +104,7 @@ public class ShowAnnotationAction extends CVSAction {
/**
* Send the CVS annotate command
+ *
* @param listener
* @param cvsResource
* @param revision
@@ -112,14 +112,17 @@ public class ShowAnnotationAction extends CVSAction {
* @throws InvocationTargetException
*/
private void fetchAnnotation(final AnnotateListener listener, final ICVSResource cvsResource, final String revision, IProgressMonitor monitor) throws InvocationTargetException {
-
+
try {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(null, 100);
ICVSFolder folder = cvsResource.getParent();
final FolderSyncInfo info = folder.getFolderSyncInfo();
ICVSRepositoryLocation location = CVSProviderPlugin.getPlugin().getRepository(info.getRoot());
- Session session = new Session(location, folder, true /* output to console */);
+ Session session = new Session(location, folder, true /*
+ * output to
+ * console
+ */);
session.open(Policy.subMonitorFor(monitor, 10), false /* read-only */);
try {
Command.QuietOption quietness = CVSProviderPlugin.getPlugin().getQuietness();
@@ -127,16 +130,12 @@ public class ShowAnnotationAction extends CVSAction {
CVSProviderPlugin.getPlugin().setQuietness(Command.VERBOSE);
final Command.LocalOption[] localOption;
if (revision == null) {
- localOption = Command.NO_LOCAL_OPTIONS;
+ localOption = Command.NO_LOCAL_OPTIONS;
} else {
- localOption = new Command.LocalOption[1];
+ localOption = new Command.LocalOption[1];
localOption[0] = Annotate.makeRevisionOption(revision);
}
- IStatus status = Command.ANNOTATE.execute(
- session,
- Command.NO_GLOBAL_OPTIONS,
- localOption, new ICVSResource[] { cvsResource }, listener,
- Policy.subMonitorFor(monitor, 90));
+ IStatus status = Command.ANNOTATE.execute(session, Command.NO_GLOBAL_OPTIONS, localOption, new ICVSResource[]{cvsResource}, listener, Policy.subMonitorFor(monitor, 90));
if (status.getCode() == CVSStatus.SERVER_ERROR) {
throw new CVSServerException(status);
}
@@ -156,13 +155,14 @@ public class ShowAnnotationAction extends CVSAction {
* Ony enabled for single resource selection
*/
protected boolean isEnabled() throws TeamException {
- return (selection.size() == 1);
+ ICVSResource resource = getSingleSelectedCVSResource();
+ return (resource != null && ! resource.isFolder());
}
/**
- * This action is called from one of a Resource Navigator a
- * CVS Resource Navigator or a History Log Viewer. Return
- * the selected resource as an ICVSResource
+ * This action is called from one of a Resource Navigator a CVS Resource
+ * Navigator or a History Log Viewer. Return the selected resource as an
+ * ICVSResource
*
* @return ICVSResource
*/
@@ -172,22 +172,22 @@ public class ShowAnnotationAction extends CVSAction {
if (cvsResources.length == 1) {
return cvsResources[0];
}
-
+
// Selected from a History Viewer
- Object[] logEntries = getSelectedResources(LogEntry.class);
+ Object[] logEntries = getSelectedResources(LogEntry.class);
if (logEntries.length == 1) {
LogEntry aLogEntry = (LogEntry) logEntries[0];
ICVSRemoteFile cvsRemoteFile = aLogEntry.getRemoteFile();
return cvsRemoteFile;
}
-
+
// Selected from a Resource Navigator
- IResource[] resources = getSelectedResources();
- if (resources.length == 1) {
- IContainer parent = resources[0].getParent();
- ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor(parent);
- return CVSWorkspaceRoot.getCVSResourceFor(resources[0]);
- }
+ IResource[] resources = getSelectedResources();
+ if (resources.length == 1) {
+ IContainer parent = resources[0].getParent();
+ ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor(parent);
+ return CVSWorkspaceRoot.getCVSResourceFor(resources[0]);
+ }
return null;
}
-}
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSMergeSynchronizeParticipant.java
index bb6dafba9..3e388b55e 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
@@ -11,11 +11,15 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jface.action.*;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.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.*;
+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.core.SaveContext;
import org.eclipse.team.internal.core.SaveContextXMLWriter;
import org.eclipse.team.internal.ui.TeamUIPlugin;
@@ -55,7 +59,7 @@ public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
private void makeActions() {
removeAction = new RemoveSynchronizeParticipantAction(this);
modes = new DirectionFilterActionGroup(this, INCOMING_MODE | CONFLICTING_MODE);
- updateAdapter = new CVSActionDelegate(new MergeUpdateAction(), this);
+ updateAdapter = new CVSActionDelegate(new MergeUpdateAction());
Utilities.initAction(updateAdapter, "action.SynchronizeViewUpdate.", Policy.getBundle());
setMode(INCOMING_MODE);
}
@@ -108,10 +112,11 @@ public class CVSMergeSynchronizeParticipant extends CVSSynchronizeParticipant {
*/
protected void dispose() {
super.dispose();
+ ((CVSMergeSubscriber)getInput().getSubscriber()).cancel();
SaveContextXMLWriter.deleteXMLPluginMetaFile(CVSUIPlugin.getPlugin(), getMetaFileName(getId().getLocalName())); //$NON-NLS-1$
}
private String getMetaFileName(String id) {
- return "mergeSyncPartners" + id + ".xml";
+ return "mergeSyncPartners" + id + ".xml"; //$NON-NLS-1$ //$NON-NLS-2$
}
} \ No newline at end of file
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 2728520c1..7ec78d5b1 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
@@ -14,14 +14,18 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator;
import org.eclipse.team.internal.ui.synchronize.sets.ISyncSetChangedListener;
import org.eclipse.team.internal.ui.synchronize.sets.SubscriberInput;
import org.eclipse.team.internal.ui.synchronize.sets.SyncSetChangedEvent;
import org.eclipse.team.ui.synchronize.TeamSubscriberParticipant;
+import org.eclipse.team.ui.synchronize.TeamSubscriberParticipantLabelProvider;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.part.IPageBookViewPage;
@@ -30,17 +34,15 @@ public abstract class CVSSynchronizeParticipant extends TeamSubscriberParticipan
private List delegates = new ArrayList(2);
protected class CVSActionDelegate extends Action {
- private TeamSubscriberParticipant participant;
private IActionDelegate delegate;
- public CVSActionDelegate(IActionDelegate delegate, TeamSubscriberParticipant participant) {
+ public CVSActionDelegate(IActionDelegate delegate) {
this.delegate = delegate;
- this.participant = participant;
addDelegate(this);
}
public void run() {
- IStructuredContentProvider cp = (IStructuredContentProvider)participant.getPage().getViewer().getContentProvider();
+ IStructuredContentProvider cp = (IStructuredContentProvider)getPage().getViewer().getContentProvider();
StructuredSelection selection = new StructuredSelection(cp.getElements(CVSSynchronizeParticipant.this.getInput()));
if(! selection.isEmpty()) {
delegate.selectionChanged(this, selection);
@@ -114,4 +116,21 @@ public abstract class CVSSynchronizeParticipant extends TeamSubscriberParticipan
public SubscriberInput getSubscriberInput() {
return getInput();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.TeamSubscriberParticipant#getLabelProvider()
+ */
+ public ILabelProvider getLabelProvider() {
+ return new TeamSubscriberParticipantLabelProvider() {
+ protected String decorateText(String input, Object resource) {
+ if(resource instanceof IResource) {
+ CVSLightweightDecorator.Decoration decoration = new CVSLightweightDecorator.Decoration();
+ CVSLightweightDecorator.decorateTextLabel((IResource)resource, decoration, false, true);
+ return decoration.prefix + input + decoration.suffix;
+ } else {
+ return input;
+ }
+ }
+ };
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSWorkspaceSynchronizeParticipant.java
index d547bec92..0cc9630c7 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
@@ -29,17 +29,17 @@ public class CVSWorkspaceSynchronizeParticipant extends CVSSynchronizeParticipan
private Action commitToolbar;
private Action updateToolbar;
- public final static QualifiedName ID = new QualifiedName("org.eclipse.team.cvs.ui.cvsworkspace-participant", "syncparticipant");
+ public final static QualifiedName ID = new QualifiedName("org.eclipse.team.cvs.ui.cvsworkspace-participant", "syncparticipant"); //$NON-NLS-1$ //$NON-NLS-2$
protected void setSubscriber(TeamSubscriber subscriber) {
super.setSubscriber(subscriber);
modes = new DirectionFilterActionGroup(this, ALL_MODES);
- commitToolbar = new CVSActionDelegate(new SubscriberCommitAction(), this);
- updateToolbar = new CVSActionDelegate(new WorkspaceUpdateAction(), this);
+ commitToolbar = new CVSActionDelegate(new SubscriberCommitAction());
+ updateToolbar = new CVSActionDelegate(new WorkspaceUpdateAction());
- Utilities.initAction(commitToolbar, "action.SynchronizeViewCommit.", Policy.getBundle());
- Utilities.initAction(updateToolbar, "action.SynchronizeViewUpdate.", Policy.getBundle());
+ Utilities.initAction(commitToolbar, "action.SynchronizeViewCommit.", Policy.getBundle()); //$NON-NLS-1$
+ Utilities.initAction(updateToolbar, "action.SynchronizeViewUpdate.", Policy.getBundle()); //$NON-NLS-1$
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index 47ca2048f..adad335a5 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -137,7 +137,7 @@
<perspective
name="%Synchronizing.perspective"
icon="icons/full/cview16/synch_synch.gif"
- class="org.eclipse.team.internal.ui.sync.views.TeamSynchronizingPerspective"
+ class="org.eclipse.team.internal.ui.synchronize.TeamSynchronizingPerspective"
id="org.eclipse.team.ui.TeamSynchronizingPerspective">
</perspective>
</extension>
@@ -148,10 +148,6 @@
<perspectiveShortcut
id="org.eclipse.team.ui.TeamSynchronizingPerspective">
</perspectiveShortcut>
- <view id="org.eclipse.team.sync.views.SyncViewer"
- relative="org.eclipse.ui.views.ResourceNavigator"
- visible="false"
- relationship="stack"/>
</perspectiveExtension>
</extension>
<!-- ****************** Import Wizards ********************* -->
@@ -190,15 +186,6 @@
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
- targetID="org.eclipse.ui.resourcePerspective">
- <view
- relative="org.eclipse.ui.views.ResourceNavigator"
- visible="false"
- relationship="stack"
- id="org.eclipse.team.ui.sync.SyncView">
- </view>
- </perspectiveExtension>
- <perspectiveExtension
targetID="org.eclipse.team.internal.ui.sync.views.TeamSynchronizingPerspective">
<showInPart
id="org.eclipse.ui.views.ResourceNavigator">
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index f542d4fbc..3fe912743 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -379,9 +379,9 @@ action.refreshSubscriber.tooltip=Registered Synchronize Partners
action.refreshSubscriber.description=Registered Synchronize Partners
action.refreshSubscriber.image=contents.gif
-action.comparisonCriteria.label=Synchronize Comparison Criteria
-action.comparisonCriteria.tooltip=Synchronize Comparison Criteria
-action.comparisonCriteria.description=Synchronize Comparison Criteria
+action.comparisonCriteria.label=Compare
+action.comparisonCriteria.tooltip=Select the comparison method
+action.comparisonCriteria.description=Select the comparison method
action.comparisonCriteria.image=showsync_rn.gif
action.navigateNext.label=Go to Next Difference
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantPage.java
index 160f0f7b0..18d3ce8ae 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSubscriberParticipantPage.java
@@ -59,7 +59,6 @@ import org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider;
import org.eclipse.team.internal.ui.synchronize.views.SyncSetTableContentProvider;
import org.eclipse.team.internal.ui.synchronize.views.SyncTableViewer;
import org.eclipse.team.internal.ui.synchronize.views.SyncTreeViewer;
-import org.eclipse.team.internal.ui.synchronize.views.SyncViewerLabelProvider;
import org.eclipse.team.internal.ui.synchronize.views.SyncViewerSorter;
import org.eclipse.team.internal.ui.synchronize.views.SyncViewerTableSorter;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
@@ -286,7 +285,7 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
protected void createTreeViewerPartControl(Composite parent) {
GridData data = new GridData(GridData.FILL_BOTH);
viewer = new SyncTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setLabelProvider(new SyncViewerLabelProvider());
+ viewer.setLabelProvider(participant.getLabelProvider());
viewer.setSorter(new SyncViewerSorter(ResourceSorter.NAME));
((TreeViewer)viewer).getTree().setLayoutData(data);
}
@@ -312,7 +311,7 @@ public class TeamSubscriberParticipantPage implements IPageBookViewPage, IProper
// Set the table contents
viewer = tableViewer;
viewer.setContentProvider(new SyncSetTableContentProvider());
- viewer.setLabelProvider(new SyncViewerLabelProvider());
+ viewer.setLabelProvider(participant.getLabelProvider());
viewer.setSorter(new SyncViewerTableSorter());
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TeamSynchronizingPerspective.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSynchronizingPerspective.java
index 1a8b522b8..37516716c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/TeamSynchronizingPerspective.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/TeamSynchronizingPerspective.java
@@ -8,9 +8,8 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.synchronize.views;
+package org.eclipse.team.internal.ui.synchronize;
-import org.eclipse.team.internal.ui.synchronize.SynchronizeView;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java
index db3ad6f6f..ff6871543 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipant.java
@@ -3,13 +3,14 @@ package org.eclipse.team.ui.synchronize;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.team.core.subscribers.TeamSubscriber;
import org.eclipse.team.internal.ui.IPreferenceIds;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberInputJob;
+import org.eclipse.team.internal.ui.synchronize.TeamSubscriberParticipantPage;
import org.eclipse.team.internal.ui.synchronize.actions.RefreshAction;
import org.eclipse.team.internal.ui.synchronize.sets.SubscriberInput;
-import org.eclipse.team.internal.ui.synchronize.TeamSubscriberParticipantPage;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.part.IPageBookViewPage;
@@ -74,10 +75,6 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
return page;
}
- public TeamSubscriberParticipantPage getPage() {
- return page;
- }
-
public void setMode(int mode) {
int oldMode = getMode();
currentMode = mode;
@@ -116,6 +113,10 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
public void setActionsBars(IActionBars actionBars, IToolBarManager detailsToolbar) {
}
+ public ILabelProvider getLabelProvider() {
+ return new TeamSubscriberParticipantLabelProvider();
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.AbstractSynchronizeViewPage#dispose()
*/
@@ -148,4 +149,8 @@ public abstract class TeamSubscriberParticipant extends AbstractSynchronizeParti
this.input = new SubscriberInput(subscriber);
this.currentMode = BOTH_MODE;
}
-}
+
+ protected TeamSubscriberParticipantPage getPage() {
+ return page;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncViewerLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantLabelProvider.java
index 582855d4a..1f6da9042 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/views/SyncViewerLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/TeamSubscriberParticipantLabelProvider.java
@@ -1,4 +1,4 @@
-package org.eclipse.team.internal.ui.synchronize.views;
+package org.eclipse.team.ui.synchronize;
import java.util.HashMap;
import java.util.Iterator;
@@ -18,13 +18,20 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.synchronize.sets.SubscriberInput;
import org.eclipse.team.internal.ui.synchronize.sets.SyncInfoStatistics;
import org.eclipse.team.internal.ui.synchronize.sets.SyncSet;
+import org.eclipse.team.internal.ui.synchronize.views.CompressedFolder;
+import org.eclipse.team.internal.ui.synchronize.views.SyncSetContentProvider;
+import org.eclipse.team.internal.ui.synchronize.views.SynchronizeViewNode;
import org.eclipse.team.ui.ISharedImages;
import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
- * The SyncViewerLabelProvider can be used in either a tree or table.
+ * Provides basic labels for the subscriber participant synchronize view
+ * page. This class provides a facility for subclasses to define annotations
+ * on the labels and icons of adaptable objects.
+ *
+ * @since 3.0
*/
-public class SyncViewerLabelProvider extends LabelProvider implements ITableLabelProvider {
+public class TeamSubscriberParticipantLabelProvider extends LabelProvider implements ITableLabelProvider {
//column constants
private static final int COL_RESOURCE = 0;
@@ -47,7 +54,15 @@ public class SyncViewerLabelProvider extends LabelProvider implements ITableLabe
return compressedFolderImage;
}
- public SyncViewerLabelProvider() {
+ public TeamSubscriberParticipantLabelProvider() {
+ }
+
+ protected String decorateText(String input, Object resource) {
+ return input;
+ }
+
+ protected Image decorateImage(Image base, Object resource) {
+ return base;
}
public String getText(Object element) {
@@ -58,7 +73,7 @@ public class SyncViewerLabelProvider extends LabelProvider implements ITableLabe
} else {
name = workbenchLabelProvider.getText(resource);
}
- return name;
+ return decorateText(name, resource);
}
/**
@@ -69,25 +84,28 @@ public class SyncViewerLabelProvider extends LabelProvider implements ITableLabe
*/
public Image getImage(Object element) {
Image decoratedImage = null;
- IResource resource = SyncSetContentProvider.getResource(element);
-
+ IResource resource = SyncSetContentProvider.getResource(element);
if (element instanceof CompressedFolder) {
decoratedImage = compareConfig.getImage(getCompressedFolderImage(), IRemoteSyncElement.IN_SYNC);
- } else {
- int kind = SyncSetContentProvider.getSyncKind(element);
- switch (kind & IRemoteSyncElement.DIRECTION_MASK) {
- case IRemoteSyncElement.OUTGOING:
- kind = (kind &~ IRemoteSyncElement.OUTGOING) | IRemoteSyncElement.INCOMING;
- break;
- case IRemoteSyncElement.INCOMING:
- kind = (kind &~ IRemoteSyncElement.INCOMING) | IRemoteSyncElement.OUTGOING;
- break;
- }
+ } else {
Image image = workbenchLabelProvider.getImage(resource);
- decoratedImage = compareConfig.getImage(image, kind);
- }
-
- return propagateConflicts(decoratedImage, element, resource);
+ decoratedImage = getCompareImage(image, element);
+ }
+ decoratedImage = propagateConflicts(decoratedImage, element, resource);
+ return decorateImage(decoratedImage, element);
+ }
+
+ private Image getCompareImage(Image base, Object element) {
+ int kind = SyncSetContentProvider.getSyncKind(element);
+ switch (kind & SyncInfo.DIRECTION_MASK) {
+ case SyncInfo.OUTGOING:
+ kind = (kind &~ SyncInfo.OUTGOING) | SyncInfo.INCOMING;
+ break;
+ case IRemoteSyncElement.INCOMING:
+ kind = (kind &~ SyncInfo.INCOMING) | SyncInfo.OUTGOING;
+ break;
+ }
+ return compareConfig.getImage(base, kind);
}
private Image propagateConflicts(Image base, Object element, IResource resource) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/package.html b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/package.html
index 54009a59c..e81dc4b4e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/package.html
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/package.html
@@ -27,6 +27,21 @@ Clients implementing synchronize participants should subclass this
may be displayed simultaneously in multiple synchronize views, in different
workbench windows.</p>
<p>The class <b>TeamSubscriberParticipant</b> provides an implementation of a
- synchronize participant that enables synchronization for a <b>TeamSubscriber</b>.</p>
+ synchronize participant that enables synchronization for a <b>TeamSubscriber</b>.
+ For providers that implement a <strong>TeamSubscriber</strong> this is the easiest
+ method of integrating into the Synchronize View. The steps would be:</p>
+<ul>
+ <li>Implement a concrete subclass of <strong>TeamSubscriber</strong>.</li>
+ <li>Subclass <strong>TeamSubscriberParticipant</strong> and provide concrete
+ implementations for init(QualifiedName) and saveState().</li>
+ <li>Add actions to the context menu of the participant by creating a viewerContribution
+ in your plugin.xml with the targetID field equal to that of your participants
+ qualifier part of their id. For example:
+ <pre>&lt;viewerContribution id=&quot;org.eclipse.myteamplugin.syncparticipant.actions&quot;
+ targetID=&quot;org.eclipse.myteamplugin.syncparticipant&quot;&gt;</pre>
+ </li>
+ <li>Add actions to the view's action bar by appending them via the TeamSubscriberParticipant#setActionBars
+ method.</li>
+</ul>
</body>
</html> \ No newline at end of file

Back to the top