diff options
author | Michael Valenta | 2007-08-07 21:59:05 +0000 |
---|---|---|
committer | Michael Valenta | 2007-08-07 21:59:05 +0000 |
commit | 80392b695991d03e208f36155be02d3f4fdde930 (patch) | |
tree | 01aa4ad4bfbbf1b62130b4c240b7b7eea8a6f95f | |
parent | 693672e15e90862a2e0e682f5b2bdde0126ffb25 (diff) | |
download | eclipse.platform.team-80392b695991d03e208f36155be02d3f4fdde930.tar.gz eclipse.platform.team-80392b695991d03e208f36155be02d3f4fdde930.tar.xz eclipse.platform.team-80392b695991d03e208f36155be02d3f4fdde930.zip |
Bug 198457 "Open a compare editor when comparing a single file" doesn't seem to work
-rw-r--r-- | bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java | 21 |
1 files changed, 14 insertions, 7 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 bf87edb86..0687c34d2 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 @@ -30,6 +30,10 @@ import org.eclipse.team.ui.synchronize.ISynchronizeParticipant; public class CompareWithTagAction extends WorkspaceTraversalAction { + private static boolean isOpenEditorForSingleFile() { + return CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.PREF_OPEN_COMPARE_EDITOR_FOR_SINGLE_FILE); + } + public void execute(IAction action) throws InvocationTargetException, InterruptedException { // First, determine the tag to compare with @@ -38,6 +42,16 @@ public class CompareWithTagAction extends WorkspaceTraversalAction { if (tag == null) return; + if (isOpenEditorForSingleFile()) { + IFile file = getSelectedFile(); + if (file != null && SyncAction.isOKToShowSingleFile(file)) { + CVSCompareSubscriber compareSubscriber = new CVSCompareSubscriber(resources, tag); + SyncAction.showSingleFileComparison(getShell(), compareSubscriber, file, getTargetPage()); + compareSubscriber.dispose(); + return; + } + } + // Create a subscriber that can cover all projects involved if (isShowModelSync()) { final CVSCompareSubscriber compareSubscriber = new CVSCompareSubscriber(getProjects(resources), tag); @@ -59,13 +73,6 @@ public class CompareWithTagAction extends WorkspaceTraversalAction { TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[]{participant}); participant.run(getTargetPart()); } else { - IFile file = getSelectedFile(); - if (file != null && SyncAction.isOKToShowSingleFile(file)) { - CVSCompareSubscriber compareSubscriber = new CVSCompareSubscriber(resources, tag); - SyncAction.showSingleFileComparison(getShell(), compareSubscriber, file, getTargetPage()); - compareSubscriber.dispose(); - return; - } CVSCompareSubscriber compareSubscriber = new CVSCompareSubscriber(getProjects(resources), tag); ResourceMapping[] resourceMappings = getCVSResourceMappings(); if (isLogicalModel(resourceMappings)) { |