Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Pogorzelski2010-04-21 10:52:11 +0000
committerPawel Pogorzelski2010-04-21 10:52:11 +0000
commitc20db7ee6c47df1d22155a43fbd0a6ea44881f5c (patch)
tree983ec29d5efd0426f10697aaa3212e259d841f9f /bundles/org.eclipse.team.ui/src/org/eclipse/team
parentf376c62e18cc69ab370f0d32f73b4e2d49bc55c2 (diff)
downloadeclipse.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
Diffstat (limited to 'bundles/org.eclipse.team.ui/src/org/eclipse/team')
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIMessages.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java12
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchOperation.java33
6 files changed, 30 insertions, 29 deletions
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

Back to the top