Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-03-02 05:19:21 +0000
committerJean Michel-Lemieux2004-03-02 05:19:21 +0000
commit1838546a58fb3d5de008d81f42d19a17b36f74d3 (patch)
treeeb24005387e1fb1ff8f52139312639d4f2d6acdd
parent3a1c826bdaab0f63b4a16b1dbe5c75787922995a (diff)
downloadeclipse.platform.team-1838546a58fb3d5de008d81f42d19a17b36f74d3.tar.gz
eclipse.platform.team-1838546a58fb3d5de008d81f42d19a17b36f74d3.tar.xz
eclipse.platform.team-1838546a58fb3d5de008d81f42d19a17b36f74d3.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java2
-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/actions/CompareWithRevisionAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java97
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshSubscriberJob.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java57
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/OpenInCompareAction.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/TeamParticipantRefreshAction.java33
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java (renamed from bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java)2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListener.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java40
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java35
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java15
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java57
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java35
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java4
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00039.html16
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00041.html34
28 files changed, 357 insertions, 162 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
index 085dd4e3a..d53859d04 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
@@ -323,8 +323,8 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
initLabels();
DiffNode diffRoot = new DiffNode(Differencer.NO_CHANGE);
+ ITypedElement left = new ResourceNode(resource);
for (int i = 0; i < editions.length; i++) {
- ITypedElement left = new TypedBufferedContent(resource);
ITypedElement right = new ResourceRevisionNode(editions[i]);
diffRoot.add(new VersionCompareDiffNode(left, right));
}
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 e9334f94d..114991786 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
@@ -739,7 +739,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
WorkspaceSynchronizeParticipant cvsPage = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
view.display(cvsPage);
if (resources != null) {
- cvsPage.refreshWithRemote(resources, false);
+ cvsPage.refreshWithRemote(resources);
}
if (mode != 0) {
cvsPage.setMode(mode);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
index b41b7886f..9ac10076c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
@@ -86,9 +86,8 @@ public class CompareWithRevisionAction extends WorkspaceAction {
// Show the compare viewer
run(new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
- CompareUI.openCompareEditorOnPage(
- new CVSCompareRevisionsInput((IFile)getSelectedResources()[0], entries[0]),
- getTargetPage());
+ CompareUI.openCompareDialog(
+ new CVSCompareRevisionsInput((IFile)getSelectedResources()[0], entries[0]));
}
}, false /* cancelable */, PROGRESS_BUSYCURSOR);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
index 34393d71d..787cf6d32 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
@@ -12,41 +12,108 @@ package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareUI;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.events.TreeAdapter;
+import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.internal.ccvs.ui.subscriber.CompareParticipant;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.team.ui.synchronize.subscriber.*;
+import org.eclipse.team.ui.synchronize.viewers.*;
+import org.eclipse.team.ui.synchronize.viewers.CompareDialog;
+import org.eclipse.team.ui.synchronize.viewers.SyncInfoCompareInput;
public class CompareWithTagAction extends WorkspaceAction {
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
- IResource[] resources = getSelectedResources();
+ final IResource[] resources = getSelectedResources();
CVSTag tag = promptForTag(resources);
if (tag == null)
return;
- IWorkbenchWindow wWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+
+ // Run the comparison
+ CVSCompareSubscriber s = new CVSCompareSubscriber(resources, tag);
+ final CompareParticipant participant = new CompareParticipant(s);
+ RefreshAction.run(null, participant.getName(), s.roots(), participant.getSubscriberSyncInfoCollector(), new IRefreshSubscriberListener() {
+ public void refreshStarted(IRefreshEvent event) {
+ }
+ public void refreshDone(final IRefreshEvent event) {
+ CVSUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (event.getChanges().length == 0) {
+ MessageDialog.openInformation(getShell(), "Compare Complete", "No changes found comparing resources");
+ }
+ if (isFolderCompare(resources)) {
+ compareAndOpenDialog(event, participant);
+ } else {
+ MessageDialog.openInformation(getShell(), "Compare Complete", event.getChanges().length + " change(s) found comparing " + resources.length + " files. Compare editors will now be opened to show the changes.");
+ compareAndOpenEditors(event, participant);
+ }
+ }
+ });
+ }
+ });
+
+
+ /*IWorkbenchWindow wWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage activePage = null;
if (wWindow != null) {
activePage = wWindow.getActivePage();
+ }*/
+
+ }
+
+ /**
+ * Return <code>true</code> if at least one element in the selection
+ * is a folder.
+ *
+ * @param resources resources to check
+ * @return <code>true</code> if at least one element in the selection
+ * is a folder and <code>false</code> otherwise.
+ */
+ protected boolean isFolderCompare(IResource[] resources) {
+ for (int i = 0; i < resources.length; i++) {
+ if(resources[i].getType() != IResource.FILE) {
+ return true;
+ }
}
- // Create the synchronize view participant
- CVSCompareSubscriber s = new CVSCompareSubscriber(resources, tag);
- CompareParticipant participant = (CompareParticipant)SubscriberParticipant.find(s);
- boolean addParticipant = false;
- if(participant == null) {
- participant = new CompareParticipant(s);
- addParticipant = true;
+ return false;
+ }
+
+ protected void compareAndOpenEditors(IRefreshEvent event, CompareParticipant participant) {
+ SyncInfo[] changes= event.getChanges();
+ for (int i = 0; i < changes.length; i++) {
+ SyncInfo info = changes[i];
+ CompareUI.openCompareDialog(new SyncInfoCompareInput(event.getSubscriber().getName(), info));
}
- participant.refreshWithRemote(s.roots(), addParticipant);
}
-
+
+ protected void compareAndOpenDialog(IRefreshEvent event, CompareParticipant participant) {
+ TreeViewerAdvisor advisor = new TreeViewerAdvisor(participant.getId(), participant.getSubscriberSyncInfoCollector().getSyncInfoTree());
+ CompareConfiguration cc = new CompareConfiguration();
+ SynchronizeCompareInput input = new SynchronizeCompareInput(cc, advisor);
+ try {
+ input.run(new NullProgressMonitor());
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ CompareDialog dialog = new CompareDialog(getShell(), input);
+ dialog.setBlockOnOpen(true);
+ dialog.open();
+ }
+
protected CVSTag promptForTag(IResource[] resources) {
IProject[] projects = new IProject[resources.length];
for (int i = 0; i < resources.length; i++) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
index 8f1c0767f..97be6fabe 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
@@ -68,7 +68,7 @@ public class MergeWizard extends Wizard {
participant = new MergeSynchronizeParticipant(s);
addParticipant = true;
}
- participant.refreshWithRemote(s.roots(), addParticipant);
+ participant.refreshWithRemote(s.roots());
return true;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
index 90c98db82..3462ab803 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
@@ -21,7 +21,7 @@ import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.ui.part.IPageBookViewPage;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage;
public class CompareParticipant extends SubscriberParticipant {
@@ -62,7 +62,7 @@ public class CompareParticipant extends SubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#doCreatePage(org.eclipse.team.ui.synchronize.ISynchronizeView)
*/
- protected IPageBookViewPage doCreatePage(ISynchronizeView view) {
+ protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
return new CompareParticipantPage(this, view);
}
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 877e8228d..f4b59323a 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
@@ -21,11 +21,12 @@ import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.team.ui.synchronize.subscriber.*;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
+import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.IPageBookViewPage;
public class MergeSynchronizeParticipant extends SubscriberParticipant {
@@ -103,7 +104,7 @@ public class MergeSynchronizeParticipant extends SubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#createPage(org.eclipse.team.ui.synchronize.ISynchronizeView)
*/
- protected IPageBookViewPage doCreatePage(ISynchronizeView view) {
+ protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
return new MergeSynchronizePage(this, view);
}
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 bde067da7..edac01341 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
@@ -14,9 +14,9 @@ import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
+import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipantPage;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.IPageBookViewPage;
public class WorkspaceSynchronizeParticipant extends SubscriberParticipant {
@@ -25,7 +25,7 @@ public class WorkspaceSynchronizeParticipant extends SubscriberParticipant {
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant#doCreatePage(org.eclipse.team.ui.synchronize.ISynchronizeView)
*/
- protected IPageBookViewPage doCreatePage(ISynchronizeView view) {
+ protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
return new WorkspaceSynchronizePage(this, view);
}
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 439cc04f8..731e56f6c 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
@@ -22,8 +22,8 @@ import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.synchronize.IRefreshEvent;
-import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
+import org.eclipse.team.ui.synchronize.subscriber.IRefreshEvent;
+import org.eclipse.team.ui.synchronize.subscriber.IRefreshSubscriberListener;
/**
* Job to refresh a subscriber with its remote state.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
index 52191239a..72fa69f83 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/jobs/RefreshUserNotificationPolicy.java
@@ -1,32 +1,26 @@
package org.eclipse.team.internal.ui.jobs;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.*;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.synchronize.SyncInfo;
-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.synchronize.IRefreshEvent;
-import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
+import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.synchronize.RefreshCompleteDialog;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.ISynchronizeManager;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
+import org.eclipse.team.ui.synchronize.subscriber.*;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener {
private SubscriberParticipant participant;
- private boolean addIfNeeded;
-
- public RefreshUserNotificationPolicy(SubscriberParticipant participant, boolean addIfNeeded) {
+ public RefreshUserNotificationPolicy(SubscriberParticipant participant) {
this.participant = participant;
- this.addIfNeeded = addIfNeeded;
}
/*
@@ -42,7 +36,7 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener
*
* @see org.eclipse.team.internal.ui.jobs.IRefreshSubscriberListener#refreshDone(org.eclipse.team.internal.ui.jobs.IRefreshEvent)
*/
- public void refreshDone(IRefreshEvent event) {
+ public void refreshDone(final IRefreshEvent event) {
if(event.getSubscriber() != participant.getSubscriberSyncInfoCollector().getSubscriber()) return;
int type = event.getRefreshType();
@@ -53,7 +47,7 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener
boolean promptWhenNoChangesBkg = TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_VIEW_BKG_PROMPT_WHEN_NO_CHANGES);
boolean shouldPrompt = false;
- SyncInfo[] infos = event.getChanges();
+ final SyncInfo[] infos = event.getChanges();
if (type == IRefreshEvent.USER_REFRESH) {
if (promptWhenNoChanges && infos.length == 0) {
@@ -70,21 +64,26 @@ public class RefreshUserNotificationPolicy implements IRefreshSubscriberListener
}
// If there are interesting changes, ensure the sync view is showing them
- // Also, add the participant to the sync view only if changes have been found.
+ // Also, select them in the sync view
if (infos.length > 0) {
- participant.setMode(SubscriberParticipant.INCOMING_MODE);
- final ISynchronizeManager manager = TeamUI.getSynchronizeManager();
- if (addIfNeeded) {
- manager.addSynchronizeParticipants(new ISynchronizeParticipant[]{participant});
- TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- ISynchronizeView view = manager.showSynchronizeViewInActivePage(null);
- if (view != null) {
- view.display(participant);
+ participant.setMode(SubscriberParticipant.BOTH_MODE);
+ }
+
+ {
+ TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ ISynchronizeView view = TeamUI.getSynchronizeManager().showSynchronizeViewInActivePage(null);
+ if (view != null) {
+ view.display(participant);
+ List selectedResources = new ArrayList();
+ selectedResources.addAll(Arrays.asList(event.getResources()));
+ for (int i = 0; i < infos.length; i++) {
+ selectedResources.add(infos[i].getLocal());
}
+ participant.selectResources((IResource[])selectedResources.toArray(new IResource[selectedResources.size()]));
}
- });
- }
+ }
+ });
}
// Prompt user if preferences are set for this type of refresh.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java
deleted file mode 100644
index 12bb707a5..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshSubscriberListener.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.eclipse.team.internal.ui.synchronize;
-
-public interface IRefreshSubscriberListener {
- public void refreshStarted(IRefreshEvent event);
- public void refreshDone(IRefreshEvent event);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
index d6b1776fc..aa3f621b5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshCompleteDialog.java
@@ -28,6 +28,7 @@ import org.eclipse.team.core.subscribers.FilteredSyncInfoCollector;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.dialogs.DetailsDialog;
+import org.eclipse.team.ui.synchronize.subscriber.*;
import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
import org.eclipse.team.ui.synchronize.viewers.TreeViewerAdvisor;
import org.eclipse.team.ui.synchronize.viewers.SynchronizeCompareInput;
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 bb4784fc7..0a99a1f94 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.team.internal.ui.synchronize.actions;
-import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.CompareUI;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -95,9 +94,7 @@ public class OpenInCompareAction extends Action {
*/
private static SyncInfoCompareInput getCompareInput(ISynchronizeParticipant participant, SyncInfo info) {
if (info != null && info.getLocal() instanceof IFile) {
- CompareConfiguration cc = new CompareConfiguration();
- //cc.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, Boolean.TRUE);
- return new SyncInfoCompareInput(cc, participant.getName(), info);
+ return new SyncInfoCompareInput(participant.getName(), info);
}
return null;
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/TeamParticipantRefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/TeamParticipantRefreshAction.java
deleted file mode 100644
index 1dbb8fce9..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/TeamParticipantRefreshAction.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ui.synchronize.actions;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
-import org.eclipse.team.ui.synchronize.subscriber.RefreshAction;
-import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant;
-import org.eclipse.ui.IWorkbenchSite;
-
-/**
- * A specialized RefreshAction that extracts the required components from a
- * particpant.
- */
-public class TeamParticipantRefreshAction extends RefreshAction {
-
- public TeamParticipantRefreshAction(ISelectionProvider provider, SubscriberParticipant participant, boolean addIfNeeded, boolean refreshAll) {
- super(provider, participant.getName(), participant.getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(participant, addIfNeeded), refreshAll);
- }
-
- public static void run(IWorkbenchSite site, IResource[] resources, SubscriberParticipant participant, boolean addIfNeeded) {
- run(site, participant.getName(), resources, participant.getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(participant, addIfNeeded));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java
index 1fd7579a0..995db2767 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/IRefreshEvent.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshEvent.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.team.internal.ui.synchronize;
+package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListener.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListener.java
new file mode 100644
index 000000000..ef57f1b5f
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/IRefreshSubscriberListener.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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.ui.synchronize.subscriber;
+
+public interface IRefreshSubscriberListener {
+ public void refreshStarted(IRefreshEvent event);
+ public void refreshDone(IRefreshEvent event);
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
index a3b999a5a..d280e5ce6 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/RefreshAction.java
@@ -11,16 +11,11 @@
package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.*;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
-import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
-import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
import org.eclipse.ui.IWorkbenchSite;
/**
@@ -56,13 +51,34 @@ public class RefreshAction extends Action {
}
}
- public static void run(IWorkbenchSite site, String description, IResource[] resources, final SubscriberSyncInfoCollector collector, IRefreshSubscriberListener listener) {
- // Cancel the scheduled background refresh or any other refresh that is happening.
- // The scheduled background refresh will restart automatically.
- Platform.getJobManager().cancel(RefreshSubscriberJob.getFamily());
- RefreshSubscriberJob job = new RefreshSubscriberJob(Policy.bind("SyncViewRefresh.taskName", description), resources, collector); //$NON-NLS-1$
+ /**
+ * Policy.bind("SyncViewRefresh.taskName");
+ *
+ * @param site
+ * @param taskName
+ * @param description
+ * @param resources
+ * @param collector
+ * @param listener
+ */
+ public static void run(IWorkbenchSite site, String taskName, IResource[] resources, final SubscriberSyncInfoCollector collector, final IRefreshSubscriberListener listener) {
+ RefreshSubscriberJob job = new RefreshSubscriberJob(taskName, resources, collector); //$NON-NLS-1$
+ IRefreshSubscriberListener autoListener = new IRefreshSubscriberListener() {
+ public void refreshStarted(IRefreshEvent event) {
+ if(listener != null) {
+ listener.refreshStarted(event);
+ }
+ }
+ public void refreshDone(IRefreshEvent event) {
+ if(listener != null) {
+ listener.refreshDone(event);
+ RefreshSubscriberJob.removeRefreshListener(this);
+ }
+ }
+ };
+
if (listener != null) {
- RefreshSubscriberJob.addRefreshListener(listener);
+ RefreshSubscriberJob.addRefreshListener(autoListener);
}
Utils.schedule(job, site);
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java
index 5a9ef43d3..69805db9b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipant.java
@@ -17,19 +17,11 @@ import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.subscribers.SubscriberSyncInfoCollector;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.internal.ui.IPreferenceIds;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.synchronize.actions.TeamParticipantRefreshAction;
+import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.team.ui.synchronize.ISynchronizeView;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.ui.*;
import org.eclipse.ui.part.IPageBookViewPage;
/**
@@ -50,7 +42,7 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
private ISynchronizeView view;
- private boolean starting = true;
+ private SubscriberParticipantPage page;
/**
* Key for settings in memento
@@ -101,10 +93,11 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
*/
public final IPageBookViewPage createPage(ISynchronizeView view) {
this.view = view;
- return doCreatePage(view);
+ this.page = doCreatePage(view);
+ return this.page;
}
- protected IPageBookViewPage doCreatePage(ISynchronizeView view) {
+ protected SubscriberParticipantPage doCreatePage(ISynchronizeView view) {
return new SubscriberParticipantPage(this, view);
}
@@ -144,13 +137,17 @@ public abstract class SubscriberParticipant extends AbstractSynchronizeParticipa
return workingSet;
}
- public void refreshWithRemote(IResource[] resources, boolean addIfNeeded) {
+ public void selectResources(IResource[] resources) {
+ page.setSelection(resources, true);
+ }
+
+ public void refreshWithRemote(IResource[] resources) {
IWorkbenchSite site = view != null ? view.getSite() : null;
+ IResource[] resourcesToRefresh = resources;
if((resources == null || resources.length == 0)) {
- TeamParticipantRefreshAction.run(site, collector.getWorkingSet(), this, addIfNeeded);
- } else {
- TeamParticipantRefreshAction.run(site, resources, this, addIfNeeded);
+ resourcesToRefresh = collector.getWorkingSet();
}
+ RefreshAction.run(site, getName(), resourcesToRefresh, getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(this));
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java
index 712c82176..fe705c96b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberParticipantPage.java
@@ -11,6 +11,7 @@
package org.eclipse.team.ui.synchronize.subscriber;
import org.eclipse.compare.internal.INavigatable;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.*;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -21,10 +22,12 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
import org.eclipse.team.internal.ui.synchronize.ChangesSection;
import org.eclipse.team.internal.ui.synchronize.ConfigureRefreshScheduleDialog;
import org.eclipse.team.internal.ui.synchronize.actions.*;
import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor;
import org.eclipse.team.ui.synchronize.viewers.TreeViewerAdvisor;
import org.eclipse.ui.*;
import org.eclipse.ui.part.*;
@@ -58,7 +61,7 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
private NavigateAction gotoPrevious;
private Action configureSchedule;
private SyncViewerShowPreferencesAction showPreferences;
- private TeamParticipantRefreshAction refreshAllAction;
+ private RefreshAction refreshAllAction;
private Action collapseAll;
private WorkingSetFilterActionGroup workingSetGroup;
private StatusLineContributionGroup statusLine;
@@ -101,7 +104,7 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
};
gotoNext = new NavigateAction(view, nav, true /*next*/);
gotoPrevious = new NavigateAction(view, nav, false /*previous*/);
- refreshAllAction = new TeamParticipantRefreshAction(getSite().getSelectionProvider(), getParticipant(), false, true /* refresh all */);
+ refreshAllAction = new RefreshAction(getSite().getSelectionProvider(), getParticipant().getName(), getParticipant().getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(getParticipant()), true /* refresh all */);
refreshAllAction.setWorkbenchSite(view.getSite());
collapseAll = new Action() {
public void run() {
@@ -297,8 +300,8 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
getSite().setSelectionProvider(viewer);
return viewer;
}
-
- public TreeViewerAdvisor getViewerConfiguration() {
+
+ public StructuredViewerAdvisor getViewerConfiguration() {
return viewerAdvisor;
}
@@ -309,4 +312,8 @@ public class SubscriberParticipantPage implements IPageBookViewPage, IPropertyCh
protected SynchronizeViewerAdvisor createSynchronizeViewerAdvisor() {
return new SynchronizeViewerAdvisor(getSynchronizeView(), getParticipant());
}
+
+ public void setSelection(IResource[] resources, boolean reveal) {
+ getViewerConfiguration().setSelection(resources, reveal);
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java
index 1b8a8c7f8..17acfd648 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SubscriberRefreshSchedule.java
@@ -9,8 +9,6 @@ import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
-import org.eclipse.team.internal.ui.synchronize.IRefreshEvent;
-import org.eclipse.team.internal.ui.synchronize.IRefreshSubscriberListener;
import org.eclipse.ui.IMemento;
public class SubscriberRefreshSchedule {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java
index 31a3d86ba..82a2df9fb 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/subscriber/SynchronizeViewerAdvisor.java
@@ -16,9 +16,12 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.*;
import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.synchronize.actions.*;
-import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.team.ui.synchronize.viewers.*;
+import org.eclipse.team.internal.ui.jobs.RefreshUserNotificationPolicy;
+import org.eclipse.team.internal.ui.synchronize.actions.OpenWithActionGroup;
+import org.eclipse.team.internal.ui.synchronize.actions.RefactorActionGroup;
+import org.eclipse.team.ui.synchronize.ISynchronizeView;
+import org.eclipse.team.ui.synchronize.viewers.SyncInfoModelElement;
+import org.eclipse.team.ui.synchronize.viewers.TreeViewerAdvisor;
/**
* Overrides the SyncInfoDiffViewerConfiguration to configure the diff viewer
@@ -30,7 +33,7 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
private SubscriberParticipant participant;
private OpenWithActionGroup openWithActions;
private RefactorActionGroup refactorActions;
- private TeamParticipantRefreshAction refreshSelectionAction;
+ private RefreshAction refreshSelectionAction;
public SynchronizeViewerAdvisor(ISynchronizeView view, SubscriberParticipant participant) {
super(participant.getId(), participant.getSubscriberSyncInfoCollector().getSyncInfoTree());
@@ -46,7 +49,7 @@ public class SynchronizeViewerAdvisor extends TreeViewerAdvisor {
super.initializeActions(treeViewer);
openWithActions = new OpenWithActionGroup(view, participant);
refactorActions = new RefactorActionGroup(view);
- refreshSelectionAction = new TeamParticipantRefreshAction(treeViewer, participant, false /* refresh */, false);
+ refreshSelectionAction = new RefreshAction(view.getSite().getSelectionProvider(), getParticipant().getName(), getParticipant().getSubscriberSyncInfoCollector(), new RefreshUserNotificationPolicy(getParticipant()), true /* refresh all */);
refreshSelectionAction.setWorkbenchSite(view.getSite());
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java
new file mode 100644
index 000000000..d46d0b03f
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/CompareDialog.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.ui.synchronize.viewers;
+
+import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.*;
+;
+
+
+public class CompareDialog extends Dialog {
+
+ private CompareEditorInput fCompareEditorInput;
+
+ public CompareDialog(Shell shell, CompareEditorInput input) {
+ super(shell);
+ setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX);
+ Assert.isNotNull(input);
+ fCompareEditorInput= input;
+ }
+
+ /* (non-Javadoc)
+ * Method declared on Dialog.
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, "Done", false);
+ }
+
+ /* (non-Javadoc)
+ * Method declared on Dialog.
+ */
+ protected Control createDialogArea(Composite parent2) {
+
+ Composite parent= (Composite) super.createDialogArea(parent2);
+
+ Control c= fCompareEditorInput.createContents(parent);
+ c.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Shell shell= c.getShell();
+ shell.setText(fCompareEditorInput.getTitle());
+ shell.setImage(fCompareEditorInput.getTitleImage());
+ Dialog.applyDialogFont(parent2);
+ return parent;
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
index fa5b10140..e9b87355c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/StructuredViewerAdvisor.java
@@ -10,20 +10,11 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize.viewers;
-import org.eclipse.compare.structuremergeviewer.DiffNode;
-import org.eclipse.compare.structuremergeviewer.ICompareInput;
-import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
+import org.eclipse.compare.structuremergeviewer.*;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.*;
import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.widgets.Control;
@@ -194,6 +185,26 @@ public abstract class StructuredViewerAdvisor {
public abstract boolean navigate(boolean next);
/**
+ * Sets a new selection for this viewer and optionally makes it visible. The advisor will try and
+ * convert the objects into the appropriate viewer objects. This is required because the model
+ * provider controls the actual model elements in the viewer and must be consulted in order to
+ * understand what objects can be selected in the viewer.
+ *
+ * @param object the objects to select
+ * @param reveal <code>true</code> if the selection is to be made visible, and
+ * <code>false</code> otherwise
+ */
+ public void setSelection(Object[] objects, boolean reveal) {
+ Object[] viewerObjects = new Object[objects.length];
+ if (modelProvider != null) {
+ for (int i = 0; i < objects.length; i++) {
+ viewerObjects[i] = modelProvider.getMapping(objects[i]);
+ }
+ viewer.setSelection(new StructuredSelection(viewerObjects), reveal);
+ }
+ }
+
+ /**
* Creates the model that will be shown in the viewers. This can be called before the
* viewer has been created.
* <p>
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java
index 2cea55b65..df88a8e80 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SyncInfoCompareInput.java
@@ -85,8 +85,8 @@ public final class SyncInfoCompareInput extends CompareEditorInput implements IR
* is displayed to the user.
* @param sync the <code>SyncInfo</code> used as the base for the compare input.
*/
- public SyncInfoCompareInput(CompareConfiguration cc, String description, SyncInfo sync) {
- super(cc);
+ public SyncInfoCompareInput(String description, SyncInfo sync) {
+ super(getDefaultCompareConfiguration());
Assert.isNotNull(sync);
Assert.isNotNull(description);
this.description = description;
@@ -96,6 +96,12 @@ public final class SyncInfoCompareInput extends CompareEditorInput implements IR
initializeResourceChangeListeners();
}
+ private static CompareConfiguration getDefaultCompareConfiguration() {
+ CompareConfiguration cc = new CompareConfiguration();
+ //cc.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, true);
+ return cc;
+ }
+
private void initializeContentChangeListeners() {
ITypedElement te = node.getLeft();
if (te instanceof IContentChangeNotifier) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
index 0486ce71f..3f03b9bd0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeCompareInput.java
@@ -19,6 +19,7 @@ import org.eclipse.compare.CompareViewerPane;
import org.eclipse.compare.NavigationAction;
import org.eclipse.compare.internal.INavigatable;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.Separator;
@@ -193,4 +194,12 @@ public class SynchronizeCompareInput extends CompareEditorInput {
throw new InvocationTargetException(e);
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.CompareEditorInput#saveChanges(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void saveChanges(IProgressMonitor pm) throws CoreException {
+ // TODO Auto-generated method stub
+ super.saveChanges(pm);
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java
index 8633c6ecf..df93b98e5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/viewers/SynchronizeModelProvider.java
@@ -153,6 +153,10 @@ public abstract class SynchronizeModelProvider implements ISyncInfoSetChangeList
return getModelRoot();
}
+ public Object getMapping(Object object) {
+ return resourceMap.get(object);
+ }
+
/**
* Dispose of the builder
*/
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00039.html b/tests/org.eclipse.team.tests.cvs.core/html/00039.html
index b9035d03f..acfb57ec6 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/00039.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00039.html
@@ -4,7 +4,7 @@
<meta NAME="since" content="">
</head><h2>Local resources with a repository</h2>
<p>Since: M8<br>
-Last Modified: $Date: 2003/11/27 22:04:58 $</p><body>
+Last Modified: $Date: 2004/03/01 20:37:55 $</p><body>
<p>
You should be able to select a project/folder/resource and compare againts
another branch or version. Multi-select should work across projects in
@@ -15,7 +15,19 @@ We should support multi-selection of files, but I'm not sure what should be
shown to the user in those cases.</p>
<h3>Comparing with another branch or version</h3>
<ul>
-<li>
+<li>one file selected
+<p>If the file has differences open a compare editor and show then. Otherwise notify the user that the files are
+the same. You should be able to see the details about the file you are comparing (revision, date, name, repo)</p>
+<li>multiple files selected
+<p>Same as 'one file selected' but operate on all selected files. This means that multiple compare editors may be opened
+for each file that is different.</p>
+<li>one folder selected
+<p>Entire contents of the folder are compared deep. If changes are found the user is notified and they are
+shown in a dialog. If no changes are found the user is notified. The dialog should allow the user to browse
+the changes and merge anything into his workspace. If the user wants to keep the comparison non-model, he
+can add it to the synchronize view. There is a button to do so on the compare dialog.</p>
+<li>mixture of files and folders selected
+<p>Same as 'one folder selected' case above.</p>
</ul>
<h3>Multi-select files</h3>
<ul>
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00041.html b/tests/org.eclipse.team.tests.cvs.core/html/00041.html
new file mode 100644
index 000000000..6013cc6fd
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00041.html
@@ -0,0 +1,34 @@
+<html><head><title>File Revisions</title>
+<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
+<meta NAME="keywords" content="">
+<meta NAME="since" content="">
+</head><h2>File Revisions</h2>
+<p>Since: M8<br>
+Last Modified: $Date: 2003/11/27 22:04:58 $</p><body>
+
+Comparing
+-> Team > Synchronize with Repository... (file, folder)
+-> Compare With > latest on branch/version (file, folder)
+ three way is possible with default cvs workspace subscriber
+-> Compare With > Two other branches or versions (file, folder) [note: this is meant to be a quick way of comparing two lineups you don't have locally. instead of having to browse the repo view all the time]
+-> Compare With > Another branch/version (file, folder)
+-> Compare With > Revision (file)
+
+Options:
+-> sync view
+ (is long lived, model updates, separates sync overview from browsing changes)
+-> modal dialog
+ (model is simple, user performs task then dis-misses dialog, cons is that the user can't do anything else)
+ - provide option of keeping compare around (e.g. put into sync view)
+-> compare editor
+ (same as model dialog but user expects the local side to stay in sync with local resources changes made outside,
+ these aren't used anymore, instead if local is editable, use sync view).
+
+Features:
+- ensure editor/dialog title
+- ensure left/right labels and images are ok
+- ensure editable property is ok
+- ensure save behavior
+- can you see the history for each file?
+
+</body></html> \ No newline at end of file

Back to the top