Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-05-17 03:58:59 +0000
committerfbecker2011-05-17 03:58:59 +0000
commitd533df8a379abd520c7e6527fe636d519eab0caf (patch)
treed619822e2d14797258b98bc783a1dab6941558b5 /org.eclipse.mylyn.bugzilla.ui/src
parent670febf5997ef2b0316bbd8e3c15fbf2bff90a58 (diff)
downloadorg.eclipse.mylyn.tasks-d533df8a379abd520c7e6527fe636d519eab0caf.tar.gz
org.eclipse.mylyn.tasks-d533df8a379abd520c7e6527fe636d519eab0caf.tar.xz
org.eclipse.mylyn.tasks-d533df8a379abd520c7e6527fe636d519eab0caf.zip
ASSIGNED - bug 344632: Show attachment in task editor link opens web page when no attachment pressent
https://bugs.eclipse.org/bugs/show_bug.cgi?id=344632
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui/src')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/Messages.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentTableEditorHyperlink.java11
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/messages.properties2
3 files changed, 15 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/Messages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/Messages.java
index 3a9571d0c..73e075954 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/Messages.java
@@ -20,6 +20,10 @@ public class Messages extends NLS {
public static String TaskAttachmentHyperlink_Open_Attachment_X_in_Y;
+ public static String TaskAttachmentTableEditorHyperlink_AttachmentNotFound;
+
+ public static String TaskAttachmentTableEditorHyperlink_QuestionMsg;
+
public static String TaskAttachmentTableEditorHyperlink_Show_Attachment_X_in_Y;
static {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentTableEditorHyperlink.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentTableEditorHyperlink.java
index 385b49886..e53a8e297 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentTableEditorHyperlink.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/TaskAttachmentTableEditorHyperlink.java
@@ -14,14 +14,17 @@ package org.eclipse.mylyn.internal.bugzilla.ui;
import java.text.MessageFormat;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
+import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
@@ -61,8 +64,12 @@ public final class TaskAttachmentTableEditorHyperlink implements IHyperlink {
AbstractTaskEditorPage page = getTaskEditorPage();
if (page != null) {
if (!page.selectReveal(TaskAttribute.PREFIX_ATTACHMENT + attachmentId)) {
- String url = repository.getUrl() + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachmentId;
- TasksUiUtil.openUrl(url);
+ String msg = NLS.bind(Messages.TaskAttachmentTableEditorHyperlink_QuestionMsg, attachmentId);
+ if (MessageDialog.openQuestion(WorkbenchUtil.getShell(),
+ Messages.TaskAttachmentTableEditorHyperlink_AttachmentNotFound, msg)) {
+ String url = repository.getUrl() + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachmentId;
+ TasksUiUtil.openUrl(url);
+ }
}
}
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/messages.properties
index 08f87b54d..3c38989fe 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/messages.properties
@@ -10,4 +10,6 @@
###############################################################################
BugzillaUiPlugin_Configuration_Refresh_Failed=Configuration Refresh Failed
TaskAttachmentHyperlink_Open_Attachment_X_in_Y=Open Attachment {0} in {1}
+TaskAttachmentTableEditorHyperlink_AttachmentNotFound=Attachment not found\!
+TaskAttachmentTableEditorHyperlink_QuestionMsg=Attachment {0} is not attached to the open bug.\n\nOpen attachment in web browser?
TaskAttachmentTableEditorHyperlink_Show_Attachment_X_in_Y=Show Attachment {0} in Task Editor

Back to the top