Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-07-16 16:13:54 +0000
committerJean Michel-Lemieux2003-07-16 16:13:54 +0000
commitac5f6f63d6e88f7e44c670310c7feb1ad6a3ba4b (patch)
treebb4aa41d2e9dd04de05e9eab0413f078de742cc3
parent851e2538651f49b97c90607c9e887668ba34012d (diff)
downloadeclipse.platform.team-ac5f6f63d6e88f7e44c670310c7feb1ad6a3ba4b.tar.gz
eclipse.platform.team-ac5f6f63d6e88f7e44c670310c7feb1ad6a3ba4b.tar.xz
eclipse.platform.team-ac5f6f63d6e88f7e44c670310c7feb1ad6a3ba4b.zip
Reverting to use old sync action and pop-up the old sync view.
-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/WorkInProgressPreferencePage.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java47
4 files changed, 40 insertions, 10 deletions
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 2506ec37b..1ccfe1742 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
@@ -558,6 +558,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
// work in progress START
store.setDefault(ICVSUIConstants.BACKGROUND_REPOVIEW, false);
store.setDefault(ICVSUIConstants.BACKGROUND_OPERATIONS, false);
+ store.setDefault(ICVSUIConstants.USE_NEW_SYNCVIEW, false);
// work in progress END
store.setDefault(ICVSUIConstants.PREF_REPOSITORIES_ARE_BINARY, false);
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 601b615dc..eb57e23ca 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
@@ -136,5 +136,6 @@ public interface ICVSUIConstants {
// work in progress preferences
public final String BACKGROUND_REPOVIEW = PREFIX + "background_repoview";
public final String BACKGROUND_OPERATIONS = PREFIX + "background_operations";
+ public final String USE_NEW_SYNCVIEW = PREFIX + "old_sync_view";
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
index d6b233686..9683e7f9e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
@@ -40,6 +40,7 @@ public class WorkInProgressPreferencePage extends FieldEditorPreferencePage impl
public void createFieldEditors() {
addField(new BooleanFieldEditor(ICVSUIConstants.BACKGROUND_REPOVIEW, "Enable background fetching of resources in the CVS Repositories view", SWT.NONE, getFieldEditorParent()));
addField(new BooleanFieldEditor(ICVSUIConstants.BACKGROUND_OPERATIONS, "Enable operations to be run in the background (e.g. checkout, update, commit)", SWT.NONE, getFieldEditorParent()));
+ addField(new BooleanFieldEditor(ICVSUIConstants.USE_NEW_SYNCVIEW, "Enable the CVS sync actions to open the new sync view", SWT.NONE, getFieldEditorParent()));
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
index c6722ce5e..f151c1ec2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
@@ -18,6 +18,11 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSWorkspaceSubscriber;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
+import org.eclipse.team.internal.ui.sync.SyncCompareInput;
+import org.eclipse.team.internal.ui.sync.SyncView;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.sync.ISyncViewer;
@@ -27,16 +32,39 @@ import org.eclipse.team.ui.sync.ISyncViewer;
public class SyncAction extends WorkspaceAction {
public void execute(IAction action) throws InvocationTargetException {
- IResource[] resources = getResourcesToSync();
- if (resources == null || resources.length == 0) return;
-
- ISyncViewer view = TeamUI.showSyncViewInActivePage(null);
- if(view != null) {
- CVSWorkspaceSubscriber cvsWorkspaceSubscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
- view.setSelection(cvsWorkspaceSubscriber, resources, view.getCurrentViewType());
- view.refreshWithRemote(cvsWorkspaceSubscriber, resources);
+ if(CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.USE_NEW_SYNCVIEW)) {
+ IResource[] resources = getResourcesToSync();
+ if (resources == null || resources.length == 0) return;
+
+ ISyncViewer view = TeamUI.showSyncViewInActivePage(null);
+ if(view != null) {
+ CVSWorkspaceSubscriber cvsWorkspaceSubscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
+ view.setSelection(cvsWorkspaceSubscriber, resources, view.getCurrentViewType());
+ view.refreshWithRemote(cvsWorkspaceSubscriber, resources);
+ }
+ } else {
+ executeInOldSyncView(action);
+ }
+ }
+
+ public void executeInOldSyncView(IAction action) throws InvocationTargetException {
+ try {
+ IResource[] resources = getResourcesToSync();
+ if (resources == null || resources.length == 0) return;
+ SyncCompareInput input = getCompareInput(resources);
+ if (input == null) return;
+ SyncView view = SyncView.findViewInActivePage(getTargetPage());
+ if (view != null) {
+ view.showSync(input, getTargetPage());
+ }
+ } catch (CVSException e) {
+ throw new InvocationTargetException(e);
}
}
+
+ protected SyncCompareInput getCompareInput(IResource[] resources) throws CVSException {
+ return new CVSSyncCompareInput(resources);
+ }
protected IResource[] getResourcesToSync() {
return getSelectedResources();
@@ -51,5 +79,4 @@ public class SyncAction extends WorkspaceAction {
protected boolean isEnabledForCVSResource(ICVSResource cvsResource) throws CVSException {
return super.isEnabledForCVSResource(cvsResource) || cvsResource.getParent().isCVSFolder();
}
-
-}
+} \ No newline at end of file

Back to the top