Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-08-19 15:30:43 -0400
committerJean Michel-Lemieux2003-08-19 15:30:43 -0400
commitb9ece82275b1fcd67eb620093feb38b4696783f6 (patch)
tree2668231f1006dc82c5addac0541a552110e69dc1
parent129851dd36f96d38e80b599b1d23f2c7d4339129 (diff)
downloadeclipse.platform.team-b9ece82275b1fcd67eb620093feb38b4696783f6.tar.gz
eclipse.platform.team-b9ece82275b1fcd67eb620093feb38b4696783f6.tar.xz
eclipse.platform.team-b9ece82275b1fcd67eb620093feb38b4696783f6.zip
Mode selection is saved as a user preference and preference to use both mode has been removed.Root_branch_SyncViewStatisticsExperiments
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IPreferenceIds.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/SyncViewerPreferencePage.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java41
4 files changed, 32 insertions, 16 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 42ae2f5f9..b5b8c3457 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
@@ -18,7 +18,7 @@ public interface IPreferenceIds {
public static final String SYNCVIEW_SCHEDULED_SYNC = PREFIX + "scheduled_sync"; //$NON-NLS-1$
public static final String SYNCVIEW_DELAY = PREFIX + "scheduled_sync_delay"; //$NON-NLS-1$
public static final String SYNCVIEW_COMPRESS_FOLDERS = PREFIX + "compress_folders"; //$NON-NLS-1$
- public static final String SYNCVIEW_USEBOTHMODE = PREFIX + "syncview_use_bothmode"; //$NON-NLS-1$
+ public static final String SYNCVIEW_SELECTED_MODE = PREFIX + "syncview_selected_mode"; //$NON-NLS-1$
public static final String SYNCVIEW_DEFAULT_PERSPECTIVE = PREFIX + "syncview_default_perspective"; //$NON-NLS-1$
public static final String SYNCVIEW_DEFAULT_PERSPECTIVE_NONE = PREFIX + "sync_view_perspective_none"; //$NON-NLS-1$
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 fcb3d00bd..9f18abc07 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
@@ -32,6 +32,7 @@ import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.graphics.Image;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberInputJob;
import org.eclipse.team.internal.ui.jobs.RefreshSubscriberJob;
+import org.eclipse.team.internal.ui.sync.actions.SyncViewerDirectionFilters;
import org.eclipse.team.internal.ui.sync.views.SyncViewerTableSorter;
import org.eclipse.team.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchPage;
@@ -149,6 +150,7 @@ public class TeamUIPlugin extends AbstractUIPlugin implements IPropertyChangeLis
store.setDefault(IPreferenceIds.SYNCVIEW_COMPRESS_FOLDERS, true);
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_TABLESORT, SyncViewerTableSorter.COL_NAME);
store.setDefault(IPreferenceIds.SYNCVIEW_VIEW_TABLESORT_REVERSED, false);
+ store.setDefault(IPreferenceIds.SYNCVIEW_SELECTED_MODE, SyncViewerDirectionFilters.BOTH_MODE);
store.setDefault(IPreferenceIds.SYNCVIEW_DEFAULT_PERSPECTIVE, "org.eclipse.team.internal.ui.sync.views.TeamSynchronizingPerspective"); //$NON-NLS-1$
}
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 e81757e9c..ba221ce57 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
@@ -148,9 +148,6 @@ public class SyncViewerPreferencePage extends FieldEditorPreferencePage implemen
compressFolders = new BooleanFieldEditor(SYNCVIEW_COMPRESS_FOLDERS, Policy.bind("SyncViewerPreferencePage.9"), SWT.NONE, displayGroup); //$NON-NLS-1$
addField(compressFolders);
- useBothMode = new BooleanFieldEditor(SYNCVIEW_USEBOTHMODE, Policy.bind("SyncViewerPreferencePage.10"), SWT.NONE, displayGroup); //$NON-NLS-1$
- addField(useBothMode);
-
refreshGroup = createGroup(getFieldEditorParent(), Policy.bind("SyncViewerPreferencePage.11")); //$NON-NLS-1$
bkgRefresh = new BooleanFieldEditor(SYNCVIEW_BACKGROUND_SYNC, Policy.bind("SyncViewerPreferencePage.12"), SWT.NONE, refreshGroup); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java
index d55b92c48..fc79110a4 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerDirectionFilters.java
@@ -48,6 +48,11 @@ public class SyncViewerDirectionFilters extends SyncViewerActionGroup {
private DirectionFilterAction conflictsMode;
private final static int[] DEFAULT_FILTER = new int[] {SyncInfo.INCOMING, SyncInfo.OUTGOING, SyncInfo.CONFLICTING};
+
+ public final static int INCOMING_MODE = 1;
+ public final static int OUTGOING_MODE = 2;
+ public final static int BOTH_MODE = 3;
+ public final static int CONFLICTING_MODE = 4;
/**
* Action for toggling the sync mode.
@@ -56,9 +61,11 @@ public class SyncViewerDirectionFilters extends SyncViewerActionGroup {
// The sync mode that this action enables
private int[] syncMode;
private boolean toggled;
- public DirectionFilterAction(String prefix,String commandId, int[] mode) {
+ private int modeId;
+ public DirectionFilterAction(String prefix,String commandId, int[] mode, int modeId) {
super("", AS_RADIO_BUTTON); //$NON-NLS-1$
this.syncMode = mode;
+ this.modeId = modeId;
Utils.initAction(this, prefix);
Action a = new Action() {
public void run() {
@@ -70,6 +77,7 @@ public class SyncViewerDirectionFilters extends SyncViewerActionGroup {
Utils.registerAction(kbs, a, commandId); //$NON-NLS-1$
}
public void run() {
+ TeamUIPlugin.getPlugin().getPreferenceStore().setValue(IPreferenceIds.SYNCVIEW_SELECTED_MODE, modeId);
updateFilter(this);
}
public int[] getFilter() {
@@ -88,16 +96,16 @@ public class SyncViewerDirectionFilters extends SyncViewerActionGroup {
*/
private void createActions() {
// Create the actions
- incomingMode = new DirectionFilterAction("action.directionFilterIncoming.", "org.eclipse.team.ui.syncview.incomingFilter", new int[] {SyncInfo.INCOMING, SyncInfo.CONFLICTING}); //$NON-NLS-1$ //$NON-NLS-2$
+ incomingMode = new DirectionFilterAction("action.directionFilterIncoming.", "org.eclipse.team.ui.syncview.incomingFilter", new int[] {SyncInfo.INCOMING, SyncInfo.CONFLICTING}, INCOMING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
actions.add(incomingMode);
- outgoingMode = new DirectionFilterAction("action.directionFilterOutgoing.", "org.eclipse.team.ui.syncview.outgoingFilter", new int[] {SyncInfo.OUTGOING, SyncInfo.CONFLICTING}); //$NON-NLS-1$ //$NON-NLS-2$
+ outgoingMode = new DirectionFilterAction("action.directionFilterOutgoing.", "org.eclipse.team.ui.syncview.outgoingFilter", new int[] {SyncInfo.OUTGOING, SyncInfo.CONFLICTING}, OUTGOING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
actions.add(outgoingMode);
- bothMode = new DirectionFilterAction("action.directionFilterBoth.", "org.eclipse.team.ui.syncview.bothFilter", new int[] {SyncInfo.OUTGOING, SyncInfo.INCOMING, SyncInfo.CONFLICTING}); //$NON-NLS-1$ //$NON-NLS-2$
+ bothMode = new DirectionFilterAction("action.directionFilterBoth.", "org.eclipse.team.ui.syncview.bothFilter", new int[] {SyncInfo.OUTGOING, SyncInfo.INCOMING, SyncInfo.CONFLICTING}, BOTH_MODE); //$NON-NLS-1$ //$NON-NLS-2$
actions.add(bothMode);
- conflictsMode = new DirectionFilterAction("action.directionFilterConflicts.", "org.eclipse.team.ui.syncview.conflictsFilter", new int[] {SyncInfo.CONFLICTING}); //$NON-NLS-1$ //$NON-NLS-2$
+ conflictsMode = new DirectionFilterAction("action.directionFilterConflicts.", "org.eclipse.team.ui.syncview.conflictsFilter", new int[] {SyncInfo.CONFLICTING}, CONFLICTING_MODE); //$NON-NLS-1$ //$NON-NLS-2$
actions.add(conflictsMode);
updateEnablement(null);
@@ -180,15 +188,24 @@ public class SyncViewerDirectionFilters extends SyncViewerActionGroup {
} else {
outgoingMode.setEnabled(true);
}
- if(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_USEBOTHMODE)) {
- bothMode.setChecked(true);
- incomingMode.setChecked(false);
- } else {
- incomingMode.setChecked(true);
- bothMode.setChecked(false);
- }
+ int defaultMode = TeamUIPlugin.getPlugin().getPreferenceStore().getInt(IPreferenceIds.SYNCVIEW_SELECTED_MODE);
+ bothMode.setChecked(false);
+ incomingMode.setChecked(false);
outgoingMode.setChecked(false);
conflictsMode.setChecked(false);
+ switch(defaultMode) {
+ case INCOMING_MODE: incomingMode.setChecked(true); break;
+ case CONFLICTING_MODE: conflictsMode.setChecked(true); break;
+ case BOTH_MODE: bothMode.setChecked(true); break;
+ case OUTGOING_MODE:
+ // handle the case where the outgoing mode is disabled.
+ if(outgoingMode.isEnabled()) {
+ outgoingMode.setChecked(true);
+ } else {
+ incomingMode.setChecked(true);
+ }
+ break;
+ }
}
}

Back to the top