diff options
author | Pawel Pogorzelski | 2010-04-21 10:52:11 +0000 |
---|---|---|
committer | Pawel Pogorzelski | 2010-04-21 10:52:11 +0000 |
commit | c20db7ee6c47df1d22155a43fbd0a6ea44881f5c (patch) | |
tree | 983ec29d5efd0426f10697aaa3212e259d841f9f | |
parent | f376c62e18cc69ab370f0d32f73b4e2d49bc55c2 (diff) | |
download | eclipse.platform.team-c20db7ee6c47df1d22155a43fbd0a6ea44881f5c.tar.gz eclipse.platform.team-c20db7ee6c47df1d22155a43fbd0a6ea44881f5c.tar.xz eclipse.platform.team-c20db7ee6c47df1d22155a43fbd0a6ea44881f5c.zip |
Bug 309921 - [Sync View][Apply Patch] Move "Apply patch in Synchronize view" to Team preferences
8 files changed, 30 insertions, 34 deletions
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java index dfed7b07b..11a62dac6 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java @@ -86,7 +86,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP public static final String SHOW_PSEUDO_CONFLICTS= PREFIX + "ShowPseudoConflicts"; //$NON-NLS-1$ public static final String INITIALLY_SHOW_ANCESTOR_PANE= PREFIX + "InitiallyShowAncestorPane"; //$NON-NLS-1$ public static final String PREF_SAVE_ALL_EDITORS= PREFIX + "SaveAllEditors"; //$NON-NLS-1$ - public static final String APPLY_PATCH_IN_SYNCHRONIZE_VIEW= PREFIX + "applyPatchInSychronizeView"; //$NON-NLS-1$ public static final String IGNORE_WHITESPACE= PREFIX + "IgnoreWhitespace"; //$NON-NLS-1$ //public static final String USE_SPLINES= PREFIX + "UseSplines"; //$NON-NLS-1$ @@ -115,7 +114,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, SYNCHRONIZE_SCROLLING), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, SHOW_PSEUDO_CONFLICTS), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, INITIALLY_SHOW_ANCESTOR_PANE), - new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, APPLY_PATCH_IN_SYNCHRONIZE_VIEW), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IGNORE_WHITESPACE), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PREF_SAVE_ALL_EDITORS), new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ADDED_LINES_REGEX), @@ -137,7 +135,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP store.setDefault(SYNCHRONIZE_SCROLLING, true); store.setDefault(SHOW_PSEUDO_CONFLICTS, false); store.setDefault(INITIALLY_SHOW_ANCESTOR_PANE, false); - store.setDefault(APPLY_PATCH_IN_SYNCHRONIZE_VIEW, false); store.setDefault(IGNORE_WHITESPACE, false); store.setDefault(PREF_SAVE_ALL_EDITORS, false); store.setDefault(ADDED_LINES_REGEX, ""); //$NON-NLS-1$ @@ -271,7 +268,6 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP // a spacer new Label(composite, SWT.NONE); - addCheckBox(composite, "ComparePreferencePage.applyPatchInSynchronizeView.label", APPLY_PATCH_IN_SYNCHRONIZE_VIEW, 0); //$NON-NLS-1$ addCheckBox(composite, "ComparePreferencePage.saveBeforePatching.label", PREF_SAVE_ALL_EDITORS, 0); //$NON-NLS-1$ // a spacer diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties index 4e8035e73..c8e2865c7 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties @@ -114,7 +114,6 @@ ComparePreferencePage.structureOutline.label= Show structure compare in Outline ComparePreferencePage.showMoreInfo.label= &Show additional compare information in the status line ComparePreferencePage.ignoreWhitespace.label= Ignore &white space ComparePreferencePage.saveBeforePatching.label= A&utomatically save dirty editors before browsing patches -ComparePreferencePage.applyPatchInSynchronizeView.label=Apply patch in &Synchronize view ComparePreferencePage.regex.description=Enter regular expressions used to identify added or removed lines in a patch\n(e.g. '^\\+\\s*\\S' for an added line with at least one word character). ComparePreferencePage.regexAdded.label=Added lines diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java index e3a9ff3db..88e08739d 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -53,7 +53,12 @@ public interface IPreferenceIds { * Preference to enable the import of a project set to be run in the background */ public static final String RUN_IMPORT_IN_BACKGROUND= PREFIX + "run_import_in_background_"; //$NON-NLS-1$ - + + /* + * Preference to enable synchronizing with a patch via Apply Patch action + */ + public static final String APPLY_PATCH_IN_SYNCHRONIZE_VIEW = PREFIX + "apply_patch_in_sychronize_view"; //$NON-NLS-1$ + /* * Preference to manage the perspective used to synchronize. */ diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java index 5a6e1bd01..3541fce5a 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java @@ -279,6 +279,7 @@ public class TeamUIMessages extends NLS { public static String SyncViewerPreferencePage_44; public static String SyncViewerPreferencePage_45; public static String SyncViewerPreferencePage_46; + public static String SyncViewerPreferencePage_47; public static String TeamAction_internal; public static String TextPreferencePage_add; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java index 796ce5901..749746ac0 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -146,6 +146,7 @@ public class TeamUIPlugin extends AbstractUIPlugin { store.setDefault(IPreferenceIds.MAKE_FILE_WRITTABLE_IF_CONTEXT_MISSING, false); store.setDefault(IPreferenceIds.REUSE_OPEN_COMPARE_EDITOR, true); store.setDefault(IPreferenceIds.RUN_IMPORT_IN_BACKGROUND, false); + store.setDefault(IPreferenceIds.APPLY_PATCH_IN_SYNCHRONIZE_VIEW, false); store.setDefault(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS, true); store.setDefault(IPreferenceIds.SYNCVIEW_DEFAULT_LAYOUT, IPreferenceIds.COMPRESSED_LAYOUT); store.setDefault(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE, TeamSynchronizingPerspective.ID); 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 01c0ff6d7..b8acd5c83 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 @@ -198,6 +198,7 @@ SyncViewerPreferencePage_43=Show the &file author in compare editors SyncViewerPreferencePage_44=When &editing file in non-shared projects, automatically make files writable if prompting is not possible SyncViewerPreferencePage_45=Re&use open compare editors when opening comparisons SyncViewerPreferencePage_46=Run Project Set import in the &background +SyncViewerPreferencePage_47=&Apply patch in Synchronize view PreferencePageContainerDialog_6=Synchronize Preferences diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java index 6813d2e36..5c52ec805 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -94,8 +94,14 @@ public class SyncViewerPreferencePage extends FieldEditorPreferencePage implemen RUN_IMPORT_IN_BACKGROUND, TeamUIMessages.SyncViewerPreferencePage_46, BooleanFieldEditor.DEFAULT, - getFieldEditorParent())); - + getFieldEditorParent())); + + addField(new BooleanFieldEditor( + APPLY_PATCH_IN_SYNCHRONIZE_VIEW, + TeamUIMessages.SyncViewerPreferencePage_47, + BooleanFieldEditor.DEFAULT, + getFieldEditorParent())); + if (isIncludeDefaultLayout()) { defaultLayout = new RadioGroupFieldEditor(SYNCVIEW_DEFAULT_LAYOUT, TeamUIMessages.SyncViewerPreferencePage_0, 3, diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchOperation.java index 2670c907e..1a6fa5f16 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchOperation.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchOperation.java @@ -18,22 +18,14 @@ import org.eclipse.compare.internal.ComparePreferencePage; import org.eclipse.compare.internal.CompareUIPlugin; import org.eclipse.compare.internal.core.patch.FilePatch2; import org.eclipse.compare.internal.core.patch.PatchReader; -import org.eclipse.compare.internal.patch.FilePatch; -import org.eclipse.compare.internal.patch.PatchWizard; -import org.eclipse.compare.internal.patch.PatchWizardDialog; -import org.eclipse.compare.internal.patch.Utilities; +import org.eclipse.compare.internal.patch.*; import org.eclipse.compare.patch.IFilePatch; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.core.resources.*; +import org.eclipse.core.runtime.*; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.widgets.Shell; +import org.eclipse.team.internal.ui.IPreferenceIds; +import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.ide.IDE; @@ -163,14 +155,10 @@ public class ApplyPatchOperation implements Runnable { private PatchWizard createPatchWizard(IStorage patch, IResource target, CompareConfiguration configuration) { - if (configuration != null) { - IPreferenceStore ps = configuration.getPreferenceStore(); - if (ps != null) { - if (ps.getBoolean(ComparePreferencePage.APPLY_PATCH_IN_SYNCHRONIZE_VIEW)) - return new ApplyPatchSynchronizationWizard(patch, target, - configuration); - } - } + if (TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean( + IPreferenceIds.APPLY_PATCH_IN_SYNCHRONIZE_VIEW)) + return new ApplyPatchSynchronizationWizard(patch, target, + configuration); return new PatchWizard(patch, target, configuration); } @@ -249,5 +237,4 @@ public class ApplyPatchOperation implements Runnable { } } - -} +}
\ No newline at end of file |