Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-03-05 16:20:52 +0000
committerMichael Valenta2004-03-05 16:20:52 +0000
commitc67c95d957bf06493f7eca78d6d12faaf0801dec (patch)
tree21825bdd60e45392637dcff2eb1ff04fce732a73
parent888c83d1b525f52f8274de7ac2f083f0e865e088 (diff)
downloadeclipse.platform.team-c67c95d957bf06493f7eca78d6d12faaf0801dec.tar.gz
eclipse.platform.team-c67c95d957bf06493f7eca78d6d12faaf0801dec.tar.xz
eclipse.platform.team-c67c95d957bf06493f7eca78d6d12faaf0801dec.zip
53867: Error dialog pops up after cancelling a synchronization
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/ITeamStatus.java9
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java2
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties1
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java10
7 files changed, 27 insertions, 6 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ITeamStatus.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ITeamStatus.java
index d1ed783e3..e8311a6e8 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ITeamStatus.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/ITeamStatus.java
@@ -20,7 +20,7 @@ public interface ITeamStatus extends IStatus {
/**
* An error occurred trying to obtain the <code>SyncInfo</code> for a single resource.
- * The error will be cleared when the set is reset or when a sync info is added to
+ * The error will be cleared when the set is reset or possibly when a sync info is added to
* the set for the resource for which the error occurred.
*/
public static final int RESOURCE_SYNC_INFO_ERROR = 1;
@@ -30,6 +30,13 @@ public interface ITeamStatus extends IStatus {
* The error will be cleared when the set is reset.
*/
public static final int SYNC_INFO_SET_ERROR = 2;
+
+ /**
+ * The collection of sync info for a sync info set has been cancelled so the
+ * contents fdo not reflect the state of the system.
+ * The error will be cleared when the set is reset.
+ */
+ public static final int SYNC_INFO_SET_CANCELLATION = 3;
/**
* Return the resource associated with this status.
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java
index 260fca9d9..047c0ae54 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/Subscriber.java
@@ -307,6 +307,8 @@ abstract public class Subscriber {
SyncInfoSet set,
IProgressMonitor monitor) {
+ Policy.checkCanceled(monitor);
+
if (resource.getType() != IResource.FILE
&& depth != IResource.DEPTH_ZERO) {
try {
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties
index 8e89babab..241e0b64d 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/messages.properties
@@ -127,3 +127,4 @@ ResourceVariantTreeSubscriber.1=Errors occurred during refresh of {0}
ResourceVariantTreeSubscriber.2=An error occurred refreshing {0}: {1}
SyncByteConverter.1=Malformed sync byte format detected in {0}
BatchingLock.11=An error occurred while flushing batched changes
+SubscriberEventHandler.12=Synchronization state collection cancelled by a user action.
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java
index a37c9dfa7..3f86cdc7c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberEventHandler.java
@@ -386,6 +386,11 @@ public class SubscriberEventHandler extends BackgroundEventHandler {
Policy.subMonitorFor(monitor, 64));
break;
}
+ } catch (OperationCanceledException e) {
+ // the job has been cancelled.
+ // Clear the queue and propogate the cancellation through the sets.
+ resultCache.clear();
+ syncSetInput.handleError(new TeamStatus(IStatus.ERROR, TeamPlugin.ID, ITeamStatus.SYNC_INFO_SET_CANCELLATION, Policy.bind("SubscriberEventHandler.12"), e, ResourcesPlugin.getWorkspace().getRoot())); //$NON-NLS-1$
} catch (RuntimeException e) {
// handle the exception and keep processing
handleException(new TeamException(Policy.bind("SubscriberEventHandler.10"), e), event.getResource(), ITeamStatus.SYNC_INFO_SET_ERROR, Policy.bind("SubscriberEventHandler.11", event.getResource().getFullPath().toString(), e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java
index 3523b562b..0af4902c9 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSWorkspaceSubscriber.java
@@ -191,6 +191,7 @@ public class CVSWorkspaceSubscriber extends CVSSyncTreeSubscriber implements IRe
resource.accept(new IResourceVisitor() {
public boolean visit(IResource innerResource) throws CoreException {
try {
+ Policy.checkCanceled(monitor);
if (innerResource.getType() != IResource.FILE) {
monitor.subTask(Policy.bind("CVSWorkspaceSubscriber.1", innerResource.getFullPath().toString())); //$NON-NLS-1$
}
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 ff1864851..9b93efdf6 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
@@ -372,3 +372,8 @@ RefreshSchedule.12=minute
RefreshSchedule.13=Every {0} {1}
RefreshSchedule.14=Scheduled refresh of ''{0}''
DiffNodeControllerHierarchical.0=Updating labels
+ChangesSection.8=Show Errors
+ChangesSection.9=Reset View
+ChangesSection.10=Errors have occurred calculating the synchronization state for {0}
+ChangesSection.11=Errors Populating View
+ChangesSection.12=Multiple errors occurred while attempting to populate the view.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
index 1984ea0ed..6ae1b6723 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
@@ -305,7 +305,7 @@ public class ChangesSection extends Composite {
composite.setLayoutData(data);
Hyperlink link = new Hyperlink(composite, SWT.WRAP);
- link.setText("Show Errors");
+ link.setText(Policy.bind("ChangesSection.8")); //$NON-NLS-1$
link.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
showErrors();
@@ -315,7 +315,7 @@ public class ChangesSection extends Composite {
link.setUnderlined(true);
link = new Hyperlink(composite, SWT.WRAP);
- link.setText("Reset View");
+ link.setText(Policy.bind("ChangesSection.9")); //$NON-NLS-1$
link.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
participant.getSubscriberSyncInfoCollector().reset();
@@ -324,18 +324,18 @@ public class ChangesSection extends Composite {
link.setBackground(getBackgroundColor());
link.setUnderlined(true);
- createDescriptionLabel(composite, "Errors have occurred calculating the synchronization state for {0}" + participant.getName());
+ createDescriptionLabel(composite, Policy.bind("ChangesSection.10", participant.getName())); //$NON-NLS-1$
return composite;
}
/* private */ void showErrors() {
ITeamStatus[] status = participant.getSubscriberSyncInfoCollector().getSyncInfoTree().getErrors();
- String title = "Errors Populating View";
+ String title = Policy.bind("ChangesSection.11"); //$NON-NLS-1$
if (status.length == 1) {
ErrorDialog.openError(getShell(), title, status[0].getMessage(), status[0]);
} else {
- MultiStatus multi = new MultiStatus(TeamUIPlugin.ID, 0, status, "Multiple errors occurred while attempting to populate the view.", null);
+ MultiStatus multi = new MultiStatus(TeamUIPlugin.ID, 0, status, Policy.bind("ChangesSection.12"), null); //$NON-NLS-1$
ErrorDialog.openError(getShell(), title, null, multi);
}
}

Back to the top