diff options
author | Michael Valenta | 2005-04-06 17:20:34 +0000 |
---|---|---|
committer | Michael Valenta | 2005-04-06 17:20:34 +0000 |
commit | 09aa1421a93847470bfd7ac0c0ce886870246975 (patch) | |
tree | 9d5a837cd124b2abd06950f9649e86b60b6c0ab1 /bundles | |
parent | 5b2c832711972751e26ad320e91ebb6d9d4b1582 (diff) | |
download | eclipse.platform.team-09aa1421a93847470bfd7ac0c0ce886870246975.tar.gz eclipse.platform.team-09aa1421a93847470bfd7ac0c0ce886870246975.tar.xz eclipse.platform.team-09aa1421a93847470bfd7ac0c0ce886870246975.zip |
Bug 52196 [Sync View] synchronize view - reuse wrong view
Diffstat (limited to 'bundles')
3 files changed, 26 insertions, 22 deletions
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 081fe91e3..d8e7e2277 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 @@ -44,7 +44,7 @@ public class CompareWithTagAction extends WorkspaceTraversalAction { // Finally, create a subscriber specifically for the resources for display to the user compareSubscriber = new CVSCompareSubscriber(resources, tag); if (SyncAction.isSingleFile(resources)) { - SyncAction.showSingleFileComparison(getShell(), compareSubscriber, resources[0]); + SyncAction.showSingleFileComparison(getShell(), compareSubscriber, resources[0], getTargetPage()); compareSubscriber.dispose(); } else { try { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java index 8aca56b2c..567003cf1 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java @@ -13,7 +13,6 @@ package org.eclipse.team.internal.ccvs.ui.actions; import java.lang.reflect.InvocationTargetException; import java.util.*; -import org.eclipse.compare.CompareUI; import org.eclipse.core.resources.*; import org.eclipse.core.resources.mapping.ResourceMapping; import org.eclipse.core.runtime.IProgressMonitor; @@ -30,10 +29,10 @@ import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant; import org.eclipse.team.internal.ui.Utils; +import org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction; import org.eclipse.team.ui.TeamUI; import org.eclipse.team.ui.synchronize.*; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.*; /** * Action to initiate a CVS workspace synchronize @@ -45,7 +44,7 @@ public class SyncAction extends WorkspaceTraversalAction { if (resources == null || resources.length == 0) return; if(isSingleFile(resources)) { - showSingleFileComparison(getShell(), CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(), resources[0]); + showSingleFileComparison(getShell(), CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(), resources[0], getTargetPage()); } else { // First check if there is an existing matching participant WorkspaceSynchronizeParticipant participant = (WorkspaceSynchronizeParticipant)SubscriberParticipant.getMatchingParticipant(WorkspaceSynchronizeParticipant.ID, resources); @@ -115,7 +114,7 @@ public class SyncAction extends WorkspaceTraversalAction { * * @param resources the file to refresh and compare */ - public static void showSingleFileComparison(final Shell shell, final Subscriber subscriber, final IResource resource) { + public static void showSingleFileComparison(final Shell shell, final Subscriber subscriber, final IResource resource, final IWorkbenchPage page) { try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { @@ -134,7 +133,7 @@ public class SyncAction extends WorkspaceTraversalAction { MessageDialog.openInformation(shell, CVSUIMessages.SyncAction_noChangesTitle, CVSUIMessages.SyncAction_noChangesMessage); //$NON-NLS-1$ //$NON-NLS-2$ } else { SyncInfoCompareInput input = new SyncInfoCompareInput(subscriber.getName(), info); - CompareUI.openCompareEditor(input); + OpenInCompareAction.openCompareEditor(input, page); } } }); 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 cf4c5e775..f30f768d7 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 @@ -75,21 +75,7 @@ public class OpenInCompareAction extends Action { if(page != null) { - IEditorPart editor = findReusableCompareEditor(page); - - if(editor != null) { - IEditorInput otherInput = editor.getEditorInput(); - if(otherInput.equals(input)) { - // simply provide focus to editor - page.activate(editor); - } else { - // if editor is currently not open on that input either re-use existing - CompareUI.reuseCompareEditor(input, (IReusableEditor)editor); - page.activate(editor); - } - } else { - CompareUI.openCompareEditor(input); - } + openCompareEditor(input, page); if(site != null && keepFocus) { site.setFocus(); @@ -98,6 +84,25 @@ public class OpenInCompareAction extends Action { } return null; } + + public static void openCompareEditor(SyncInfoCompareInput input, IWorkbenchPage page) { + if (page == null || input == null) + return; + IEditorPart editor = findReusableCompareEditor(page); + if(editor != null) { + IEditorInput otherInput = editor.getEditorInput(); + if(otherInput.equals(input)) { + // simply provide focus to editor + page.activate(editor); + } else { + // if editor is currently not open on that input either re-use existing + CompareUI.reuseCompareEditor(input, (IReusableEditor)editor); + page.activate(editor); + } + } else { + CompareUI.openCompareEditor(input); + } + } /** * Returns an editor that can be re-used. An open compare editor that |