diff options
author | Jean Michel-Lemieux | 2004-02-26 22:12:18 +0000 |
---|---|---|
committer | Jean Michel-Lemieux | 2004-02-26 22:12:18 +0000 |
commit | 2eeff85910a913b48264f96bc82f9c19c5d5a0dd (patch) | |
tree | d19ef7727a8a1624b6564cdee15e34fc4702fd70 | |
parent | 0461d9139d4d407c119ef3d35a20a990a787dcf9 (diff) | |
download | eclipse.platform.team-2eeff85910a913b48264f96bc82f9c19c5d5a0dd.tar.gz eclipse.platform.team-2eeff85910a913b48264f96bc82f9c19c5d5a0dd.tar.xz eclipse.platform.team-2eeff85910a913b48264f96bc82f9c19c5d5a0dd.zip |
Supported refresh that add participant if needed.
4 files changed, 24 insertions, 34 deletions
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 443e4708d..7c9f7694e 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 @@ -738,7 +738,7 @@ public class CVSUIPlugin extends AbstractUIPlugin { WorkspaceSynchronizeParticipant cvsPage = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant(); view.display(cvsPage); if (resources != null) { - cvsPage.refreshWithRemote(resources); + cvsPage.refreshWithRemote(resources, false); } if (mode != 0) { cvsPage.setMode(mode); 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 5acb560be..7927b5855 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 @@ -15,13 +15,17 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber; import org.eclipse.team.internal.ccvs.core.CVSTag; -import org.eclipse.team.internal.ccvs.ui.*; +import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog; import org.eclipse.team.internal.ccvs.ui.subscriber.CompareParticipant; import org.eclipse.team.ui.TeamUI; -import org.eclipse.team.ui.synchronize.*; -import org.eclipse.ui.*; +import org.eclipse.team.ui.synchronize.ISynchronizeParticipant; +import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; public class CompareWithTagAction extends WorkspaceAction { @@ -37,17 +41,13 @@ public class CompareWithTagAction extends WorkspaceAction { } // Create the synchronize view participant CVSCompareSubscriber s = new CVSCompareSubscriber(resources, tag); - CompareParticipant participant = new CompareParticipant(s); - // Show the participant in the view - ISynchronizeManager manager = TeamUI.getSynchronizeManager(); - manager.addSynchronizeParticipants(new ISynchronizeParticipant[]{participant}); - ISynchronizeView view = manager.showSynchronizeViewInActivePage(null); - if (view != null) { - view.display(participant); - participant.refreshWithRemote(s.roots()); - } else { - CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$ + CompareParticipant participant = (CompareParticipant)SubscriberParticipant.find(s); + boolean addParticipant = false; + if(participant == null) { + participant = new CompareParticipant(s); + addParticipant = true; } + participant.refreshWithRemote(s.roots(), addParticipant); } protected CVSTag promptForTag(IResource[] resources) { @@ -65,4 +65,4 @@ public class CompareWithTagAction extends WorkspaceAction { protected boolean isEnabledForNonExistantResources() { return true; } -} +}
\ No newline at end of file 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 44f6b4e9f..8f1c0767f 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 @@ -21,10 +21,7 @@ import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; import org.eclipse.team.internal.ccvs.ui.Policy; import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant; -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.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; @@ -65,18 +62,13 @@ public class MergeWizard extends Wizard { CVSTag endTag = endPage.getTag(); CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag); - MergeSynchronizeParticipant participant = new MergeSynchronizeParticipant(s); - ISynchronizeManager manager = TeamUI.getSynchronizeManager(); - manager.addSynchronizeParticipants(new ISynchronizeParticipant[] {participant}); - - ISynchronizeView view = manager.showSynchronizeViewInActivePage(null); - if(view != null) { - view.display(participant); - participant.refreshWithRemote(s.roots()); - } else { - CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$ - return false; - } + MergeSynchronizeParticipant participant = (MergeSynchronizeParticipant)SubscriberParticipant.find(s); + boolean addParticipant = false; + if(participant == null) { + participant = new MergeSynchronizeParticipant(s); + addParticipant = true; + } + participant.refreshWithRemote(s.roots(), addParticipant); 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 cb199eb5e..90c98db82 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 @@ -24,8 +24,6 @@ import org.eclipse.team.ui.synchronize.subscriber.SubscriberParticipant; import org.eclipse.ui.part.IPageBookViewPage; public class CompareParticipant extends SubscriberParticipant { - - public final static String ID = "org.eclipse.team.cvs.ui.compare-participant"; //$NON-NLS-1$ private SyncInfoFilter contentComparison = new SyncInfoFilter() { private SyncInfoFilter contentCompare = new SyncInfoFilter.ContentComparisonSyncInfoFilter(); @@ -47,7 +45,7 @@ public class CompareParticipant extends SubscriberParticipant { protected void setSubscriber(Subscriber subscriber) { super.setSubscriber(subscriber); try { - ISynchronizeParticipantDescriptor descriptor = TeamUI.getSynchronizeManager().getParticipantDescriptor(ID); + ISynchronizeParticipantDescriptor descriptor = TeamUI.getSynchronizeManager().getParticipantDescriptor(CVSCompareSubscriber.ID); setInitializationData(descriptor); } catch (CoreException e) { CVSUIPlugin.log(e); |