summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2013-04-08 08:45:50 (EDT)
committerGerrit Code Review @ Eclipse.org2013-04-17 18:39:05 (EDT)
commit0d8225e9483fb56e2a1f86af6d6f89a943553ea5 (patch)
treed7536940b0b1ead682714a8611f03dd9f53e4683
parent138f726935f292f6b37f60e7735d3e62eb5fdac1 (diff)
downloadorg.eclipse.mylyn.tasks-0d8225e9483fb56e2a1f86af6d6f89a943553ea5.zip
org.eclipse.mylyn.tasks-0d8225e9483fb56e2a1f86af6d6f89a943553ea5.tar.gz
org.eclipse.mylyn.tasks-0d8225e9483fb56e2a1f86af6d6f89a943553ea5.tar.bz2
394850: add progress monitoring for attachmentsrefs/changes/21/11721/3
Change-Id: I181cccd051a005e4651652af20145a5eda3626a8 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=394850
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/Messages.java2
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java4
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/messages.properties1
3 files changed, 7 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/Messages.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/Messages.java
index 73e3f70..bbf6489 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/Messages.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/Messages.java
@@ -25,6 +25,8 @@ public class Messages extends NLS {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
+ public static String TracAttachmentHandler_Downloading_attachment;
+
public static String TracAttachmentHandler_Uploading_attachment;
public static String TracAttribute_Assigned_to;
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java
index 9fc9352..4341f86 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracAttachmentHandler.java
@@ -51,7 +51,9 @@ public class TracAttachmentHandler extends AbstractTaskAttachmentHandler {
+ repository.getRepositoryUrl() + " failed, missing attachment filename.")); //$NON-NLS-1$
}
+ monitor = Policy.monitorFor(monitor);
try {
+ monitor.beginTask(Messages.TracAttachmentHandler_Downloading_attachment, IProgressMonitor.UNKNOWN);
ITracClient client = connector.getClientManager().getTracClient(repository);
int id = Integer.parseInt(task.getTaskId());
return client.getAttachmentData(id, filename, monitor);
@@ -59,6 +61,8 @@ public class TracAttachmentHandler extends AbstractTaskAttachmentHandler {
throw e;
} catch (Exception e) {
throw new CoreException(TracCorePlugin.toStatus(e, repository));
+ } finally {
+ monitor.done();
}
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/messages.properties b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/messages.properties
index 5341e46..0cf06b0 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/messages.properties
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/messages.properties
@@ -8,6 +8,7 @@
# Contributors:
# Steffen Pingel - initial API and implementation
###############################################################################
+TracAttachmentHandler_Downloading_attachment=Downloading attachment
TracAttachmentHandler_Uploading_attachment=Uploading attachment
TracAttribute_Assigned_to=Assigned to: