Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-05-05 15:17:29 -0400
committerJean Michel-Lemieux2004-05-05 15:17:29 -0400
commite5c627622271702e02f28e9cac52e223ee9a6e67 (patch)
tree1a55ea3e333686da89014735cde988a72e72e7c8
parente1a6d57ad8a2d17a40b321cb87f092d584fa6d81 (diff)
downloadeclipse.platform.team-e5c627622271702e02f28e9cac52e223ee9a6e67.tar.gz
eclipse.platform.team-e5c627622271702e02f28e9cac52e223ee9a6e67.tar.xz
eclipse.platform.team-e5c627622271702e02f28e9cac52e223ee9a6e67.zip
Allow user to decide if compare and merges are automatically added to the synchronize view.
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java26
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java26
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java27
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java25
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties1
7 files changed, 66 insertions, 41 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
index 226f07007..0ccfa8e39 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
@@ -11,34 +11,21 @@
package org.eclipse.team.internal.ccvs.ui;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
+import java.util.*;
import java.util.List;
+import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
@@ -73,6 +60,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
private Button determineVersionEnabled;
private Button confirmMoveTag;
private Button debugProtocol;
+ private Button showCompareMergeInSyncView;
private Button never;
private Button prompt;
@@ -186,6 +174,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
confirmMoveTag = createCheckBox(composite, Policy.bind("CVSPreferencePage.confirmMoveTag")); //$NON-NLS-1$
debugProtocol = createCheckBox(composite, Policy.bind("CVSPreferencePage.debugProtocol")); //$NON-NLS-1$
usePlatformLineend = createCheckBox(composite, Policy.bind("CVSPreferencePage.lineend")); //$NON-NLS-1$
+ showCompareMergeInSyncView = createCheckBox(composite, Policy.bind("CVSPreferencePage.showCompareMergeInSync")); //$NON-NLS-1$
createLabel(composite, ""); createLabel(composite, ""); //$NON-NLS-1$ //$NON-NLS-2$
@@ -293,6 +282,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
private void initializeValues() {
IPreferenceStore store = getPreferenceStore();
pruneEmptyDirectoriesField.setSelection(store.getBoolean(ICVSUIConstants.PREF_PRUNE_EMPTY_DIRECTORIES));
+ showCompareMergeInSyncView.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_COMPARE_MERGE_IN_SYNCVIEW));
timeoutValue.setText(new Integer(store.getInt(ICVSUIConstants.PREF_TIMEOUT)).toString());
repositoriesAreBinary.setSelection(store.getBoolean(ICVSUIConstants.PREF_REPOSITORIES_ARE_BINARY));
quietnessCombo.add(Policy.bind("CVSPreferencePage.notquiet")); //$NON-NLS-1$
@@ -358,6 +348,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
store.setValue(ICVSUIConstants.PREF_DETERMINE_SERVER_VERSION, determineVersionEnabled.getSelection());
store.setValue(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG, confirmMoveTag.getSelection());
store.setValue(ICVSUIConstants.PREF_DEBUG_PROTOCOL, debugProtocol.getSelection());
+ store.setValue(ICVSUIConstants.PREF_SHOW_COMPARE_MERGE_IN_SYNCVIEW, showCompareMergeInSyncView.getSelection());
CVSProviderPlugin.getPlugin().setReplaceUnmanaged(
store.getBoolean(ICVSUIConstants.PREF_REPLACE_UNMANAGED));
@@ -409,6 +400,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
repositoriesAreBinary.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_REPOSITORIES_ARE_BINARY));
confirmMoveTag.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG));
debugProtocol.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_DEBUG_PROTOCOL));
+ showCompareMergeInSyncView.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_COMPARE_MERGE_IN_SYNCVIEW));
}
private void createSaveCombo(Composite composite) {
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 f94824931..2439ef90d 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
@@ -600,6 +600,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
store.setDefault(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG, CVSProviderPlugin.DEFAULT_CONFIRM_MOVE_TAG);
store.setDefault(ICVSUIConstants.PREF_DEBUG_PROTOCOL, false);
store.setDefault(ICVSUIConstants.PREF_WARN_REMEMBERING_MERGES, true);
+ store.setDefault(ICVSUIConstants.PREF_SHOW_COMPARE_MERGE_IN_SYNCVIEW, false);
PreferenceConverter.setDefault(store, ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR, new RGB(0, 0, 0));
PreferenceConverter.setDefault(store, ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR, new RGB(0, 0, 255));
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
index 920559706..3ec884c4f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
@@ -85,6 +85,7 @@ public interface ICVSUIConstants {
public final String PREF_WARN_REMEMBERING_MERGES = "pref_remember_merges"; //$NON-NLS-1$
public final String PREF_FIRST_STARTUP = "pref_first_startup"; //$NON-NLS-1$
public final String PREF_EXT_CONNECTION_METHOD_PROXY = "pref_ext_connection_method_proxy"; //$NON-NLS-1$
+ public final String PREF_SHOW_COMPARE_MERGE_IN_SYNCVIEW = "pref_show_compare_merge_in_syncview"; //$NON-NLS-1$
// console preferences
public final String PREF_CONSOLE_COMMAND_COLOR = "pref_console_command_color"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
index bac0d81d2..c37036ff4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
@@ -13,13 +13,17 @@ package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.ui.PlatformUI;
/**
@@ -34,13 +38,21 @@ public class CompareWithRemoteAction extends WorkspaceAction {
final IResource[] resources = getSelectedResources();
// Show the 3-way comparison in a model dialog
WorkspaceSynchronizeParticipant participant = CVSUIPlugin.getPlugin().getCvsWorkspaceSynchronizeParticipant();
- ISynchronizePageConfiguration configuration = participant.createPageConfiguration();
- configuration.setProperty(ISynchronizePageConfiguration.P_TOOLBAR_MENU, new String[] {
- ISynchronizePageConfiguration.NAVIGATE_GROUP,
- ISynchronizePageConfiguration.MODE_GROUP,
- ISynchronizePageConfiguration.LAYOUT_GROUP });
- configuration.setWorkingSet(PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("", resources)); //$NON-NLS-1$
- participant.refreshInDialog(getShell(), resources, Policy.bind("Participant.comparing"), Policy.bind("Participant.comparingDetail", participant.getName(), Utils.stripAmpersand(calculateActionTagValue())), configuration, null); //$NON-NLS-1$ //$NON-NLS-2$
+ String taskName = Policy.bind("Participant.comparingDetail", participant.getName(), Utils.stripAmpersand(calculateActionTagValue()));
+ IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
+ boolean showInSyncView = store.getBoolean(ICVSUIConstants.PREF_SHOW_COMPARE_MERGE_IN_SYNCVIEW);
+ if(showInSyncView) {
+ TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[] {participant});
+ participant.refresh(resources, Policy.bind("Participant.comparing"), taskName, null); //$NON-NLS-1$
+ } else {
+ ISynchronizePageConfiguration configuration = participant.createPageConfiguration();
+ configuration.setProperty(ISynchronizePageConfiguration.P_TOOLBAR_MENU, new String[] {
+ ISynchronizePageConfiguration.NAVIGATE_GROUP,
+ ISynchronizePageConfiguration.MODE_GROUP,
+ ISynchronizePageConfiguration.LAYOUT_GROUP });
+ configuration.setWorkingSet(PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSet("", resources)); //$NON-NLS-1$
+ participant.refreshInDialog(getShell(), resources, Policy.bind("Participant.comparing"), taskName, configuration, null); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
/*
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 03d0b4acd..6d269f59d 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,12 +15,16 @@ 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.preference.IPreferenceStore;
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.Policy;
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.ISynchronizePageConfiguration;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
public class CompareWithTagAction extends WorkspaceAction {
@@ -33,15 +37,20 @@ public class CompareWithTagAction extends WorkspaceAction {
// Run the comparison
CVSCompareSubscriber s = new CVSCompareSubscriber(resources, tag);
CompareParticipant participant = new CompareParticipant(s);
-
- ISynchronizePageConfiguration configuration = participant.createPageConfiguration();
- configuration.setProperty(ISynchronizePageConfiguration.P_TOOLBAR_MENU, new String[] {
- ISynchronizePageConfiguration.NAVIGATE_GROUP,
- ISynchronizePageConfiguration.MODE_GROUP,
- ISynchronizePageConfiguration.LAYOUT_GROUP });
- configuration.setProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID, CVSCompareSubscriber.ID_MODAL);
-
- participant.refreshInDialog(getShell(), resources, Policy.bind("Participant.comparing"), participant.getName(), configuration, null); //$NON-NLS-1$
+ IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
+ boolean showInSyncView = store.getBoolean(ICVSUIConstants.PREF_SHOW_COMPARE_MERGE_IN_SYNCVIEW);
+ if(showInSyncView) {
+ TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[] {participant});
+ participant.refresh(resources, Policy.bind("Participant.comparing"), participant.getName(), null); //$NON-NLS-1$
+ } else {
+ ISynchronizePageConfiguration configuration = participant.createPageConfiguration();
+ configuration.setProperty(ISynchronizePageConfiguration.P_TOOLBAR_MENU, new String[] {
+ ISynchronizePageConfiguration.NAVIGATE_GROUP,
+ ISynchronizePageConfiguration.MODE_GROUP,
+ ISynchronizePageConfiguration.LAYOUT_GROUP });
+ configuration.setProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID, CVSCompareSubscriber.ID_MODAL);
+ participant.refreshInDialog(getShell(), resources, Policy.bind("Participant.comparing"), participant.getName(), configuration, null); //$NON-NLS-1$
+ }
}
protected CVSTag promptForTag(IResource[] resources) {
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 a8332727d..78da800a4 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
@@ -13,6 +13,7 @@ package org.eclipse.team.internal.ccvs.ui.merge;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
@@ -20,7 +21,9 @@ import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.ui.*;
public class MergeWizard extends Wizard {
@@ -60,14 +63,20 @@ public class MergeWizard extends Wizard {
CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag);
MergeSynchronizeParticipant participant = new MergeSynchronizeParticipant(s);
-
- ISynchronizePageConfiguration configuration = participant.createPageConfiguration();
- configuration.setProperty(ISynchronizePageConfiguration.P_TOOLBAR_MENU, new String[] {
- ISynchronizePageConfiguration.NAVIGATE_GROUP,
- ISynchronizePageConfiguration.MODE_GROUP,
- ISynchronizePageConfiguration.LAYOUT_GROUP });
- configuration.setProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID, CVSMergeSubscriber.ID_MODAL);
- participant.refreshInDialog(Utils.findShell(), s.roots(), Policy.bind("Participant.merging"), Policy.bind("Participant.mergingDetail", participant.getName()), configuration, null); //$NON-NLS-1$ //$NON-NLS-2$
+ IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
+ boolean showInSyncView = store.getBoolean(ICVSUIConstants.PREF_SHOW_COMPARE_MERGE_IN_SYNCVIEW);
+ if(showInSyncView) {
+ TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[] {participant});
+ participant.refresh(resources, Policy.bind("Participant.merging"), Policy.bind("Participant.mergingDetail", participant.getName()), null); //$NON-NLS-1$
+ } else {
+ ISynchronizePageConfiguration configuration = participant.createPageConfiguration();
+ configuration.setProperty(ISynchronizePageConfiguration.P_TOOLBAR_MENU, new String[] {
+ ISynchronizePageConfiguration.NAVIGATE_GROUP,
+ ISynchronizePageConfiguration.MODE_GROUP,
+ ISynchronizePageConfiguration.LAYOUT_GROUP });
+ configuration.setProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID, CVSMergeSubscriber.ID_MODAL);
+ participant.refreshInDialog(Utils.findShell(), s.roots(), Policy.bind("Participant.merging"), Policy.bind("Participant.mergingDetail", participant.getName()), configuration, null); //$NON-NLS-1$ //$NON-NLS-2$
+ }
return true;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index 4f3f3fed8..00d271789 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -221,6 +221,7 @@ CVSPreferencePage.Auto-&save_4=&Auto-save
CVSPreferencePage.repositoriesAreBinary=&Treat all new files as binary
CVSPreferencePage.determineVersionEnabled=&Validate server version compatibility on first connection
CVSPreferencePage.confirmMoveTag=Confirm &move tag on tag operation
+CVSPreferencePage.showCompareMergeInSync=Display &compare and merge results in the Synchronize View
CVSRemoteFilePropertySource.name=Name
CVSRemoteFilePropertySource.revision=Revision

Back to the top