Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-07-23 18:24:13 +0000
committerJean Michel-Lemieux2003-07-23 18:24:13 +0000
commit76e91fc45bd4757b12a3b6f7af0438104d58d023 (patch)
tree261ca343a5cbe94db595b03844580bca00457f3f
parent7e553f027d9e9007461c3c2c1d3dd1813c1ffbb9 (diff)
downloadeclipse.platform.team-76e91fc45bd4757b12a3b6f7af0438104d58d023.tar.gz
eclipse.platform.team-76e91fc45bd4757b12a3b6f7af0438104d58d023.tar.xz
eclipse.platform.team-76e91fc45bd4757b12a3b6f7af0438104d58d023.zip
Removed setSelection() method in favour of selectSubscriber()
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java31
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java2
6 files changed, 26 insertions, 29 deletions
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 28e6dde28..47ca97b68 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
@@ -43,8 +43,10 @@ public class SyncAction extends WorkspaceAction {
if(view != null) {
CVSWorkspaceSubscriber cvsWorkspaceSubscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
view.setWorkingSet(workingSet);
- view.setSelection(cvsWorkspaceSubscriber, resources, view.getCurrentViewType());
+ view.selectSubscriber(cvsWorkspaceSubscriber);
view.refreshWithRemote(cvsWorkspaceSubscriber, resources);
+ } else {
+ CVSUIPlugin.openError(getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
executeInOldSyncView(action);
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 bd1fd8ca0..aa8bc33a2 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
@@ -30,6 +30,7 @@ import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.sync.ISynchronizeView;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
public class MergeWizard extends Wizard {
@@ -82,7 +83,13 @@ public class MergeWizard extends Wizard {
}
});
ISynchronizeView view = TeamUI.showSyncViewInActivePage(null /* no default page */);
- view.setSelection(s, new IResource[0], view.getCurrentViewType());
+ IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(resources, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$
+ if(view != null) {
+ view.setWorkingSet(workingSet);
+ view.selectSubscriber(s);
+ } else {
+ CVSUIPlugin.openError(getContainer().getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null);
+ }
} catch (InvocationTargetException e) {
CVSUIPlugin.openError(getContainer().getShell(), null, null, e);
return false;
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 d3581f1c1..a16fa509a 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
@@ -1008,3 +1008,5 @@ UpdateOnlyMergeable.taskName=Updating mergeable changes
UpdateDialog.overwriteTitle=Overwrite Unmergable Resources?
UpdateDialog.overwriteMessage=All mergable resources have been updated. However, some non-mergable resources remain. Should these resources be updated, overwriting any local changes?
ReplaceOperation.taskName=Replacing...
+
+Error.unableToShowSyncView=Error opening Synchronize View. Please ensure that the Team plugin is installed correctly.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index d080851d9..99e6aedf7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -300,8 +300,11 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
}
ISynchronizeView view = TeamUI.showSyncViewInActivePage(null);
if(view != null) {
- IWorkingSet ws = CVSUIPlugin.getWorkingSet(new IResource[] {project}, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$
- view.setSelection(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber(), new IResource[] {project}, ISynchronizeView.TREE_VIEW);
+ IWorkingSet workingSet = CVSUIPlugin.getWorkingSet(new IResource[] {project}, Policy.bind("SyncAction.workingSetName")); //$NON-NLS-1$)
+ view.setWorkingSet(workingSet);
+ view.selectSubscriber(CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber());
+ } else {
+ CVSUIPlugin.openError(getContainer().getShell(), Policy.bind("error"), Policy.bind("Error.unableToShowSyncView"), null);
}
}
} catch (InterruptedException e) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java
index 8fd441f65..599de883e 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/views/SynchronizeView.java
@@ -11,12 +11,10 @@
package org.eclipse.team.internal.ui.sync.views;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -76,7 +74,6 @@ import org.eclipse.team.internal.ui.sync.actions.RefreshAction;
import org.eclipse.team.internal.ui.sync.actions.SyncViewerActions;
import org.eclipse.team.internal.ui.sync.sets.ISyncSetChangedListener;
import org.eclipse.team.internal.ui.sync.sets.SubscriberInput;
-import org.eclipse.team.internal.ui.sync.sets.SyncSet;
import org.eclipse.team.internal.ui.sync.sets.SyncSetChangedEvent;
import org.eclipse.team.ui.ISharedImages;
import org.eclipse.team.ui.sync.ISynchronizeView;
@@ -447,15 +444,14 @@ public class SynchronizeView extends ViewPart implements ITeamResourceChangeList
}
-
-
-
public void activateSubscriber(TeamSubscriber subscriber) {
- SubscriberInput input = (SubscriberInput)subscriberInputs.get(subscriber.getId());
- if (input == null) {
+ SubscriberInput newInput = (SubscriberInput)subscriberInputs.get(subscriber.getId());
+ if (newInput == null) {
addSubscriber(subscriber);
};
- initializeSubscriberInput(input);
+ if(! newInput.getSubscriber().getId().equals(getInput().getSubscriber().getId())) {
+ initializeSubscriberInput(newInput);
+ }
}
/*
* Synchronize - (showing N of M changes) - {Subscriber name}
@@ -765,21 +761,8 @@ public class SynchronizeView extends ViewPart implements ITeamResourceChangeList
}
}
- public void setSelection(TeamSubscriber subscriber, IResource[] resources, int viewType) {
- switchViewerType(viewType);
- List syncResource = new ArrayList(resources.length);
- for (int i = 0; i < resources.length; i++) {
- syncResource.add(new SyncResource((SyncSet)viewer.getInput(), resources[i]));
- }
- if(! syncResource.isEmpty()) {
- viewer.setSelection(new StructuredSelection(syncResource), true /* reveal */);
- if(viewer instanceof AbstractTreeViewer) {
- ((AbstractTreeViewer)viewer).expandToLevel(2);
- }
- }
- if(subscriber != null) {
- activateSubscriber(subscriber);
- }
+ public void selectSubscriber(TeamSubscriber subscriber) {
+ activateSubscriber(subscriber);
}
/**
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java
index 098ed6185..61dd575a8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ISynchronizeView.java
@@ -36,7 +36,7 @@ public interface ISynchronizeView {
* @param resources the resources to select
* @param viewType the view configuration in which to select the resources
*/
- public void setSelection(TeamSubscriber subscriber, IResource[] resources, int viewType);
+ public void selectSubscriber(TeamSubscriber subscriber);
/**
* Refreshes the resources from the specified subscriber. The working set or filters applied

Back to the top