Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-01-24 14:30:08 +0000
committerfbecker2010-01-24 14:30:08 +0000
commite3dedca614a22dab5d1af6ed04e66b2aeaa71fcd (patch)
tree68913c806ef58d65409b2998895069566b81aa56
parent9feb36df276712024253f84cca1ed264371cddcf (diff)
downloadorg.eclipse.mylyn.tasks-e3dedca614a22dab5d1af6ed04e66b2aeaa71fcd.tar.gz
org.eclipse.mylyn.tasks-e3dedca614a22dab5d1af6ed04e66b2aeaa71fcd.tar.xz
org.eclipse.mylyn.tasks-e3dedca614a22dab5d1af6ed04e66b2aeaa71fcd.zip
ASSIGNED - bug 272207: [patch] Include iplog flag for patches on bugzilla task editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=272207
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java82
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java37
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java20
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java95
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java3
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties12
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java167
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/plugin.xml10
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/BugzillaAttachmentUpdateAction.java186
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/ChangeAttachmentJob.java130
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/Messages.java1
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/messages.properties1
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/dialogs/BugzillaAttachmentDialog.java289
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/FlagAttributeEditor.java37
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java7
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties4
18 files changed, 1049 insertions, 36 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java
index eac7fdbd1..5aee75eff 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * Copyright (c) 2009 Frank Becker and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Tasktop Technologies - initial API and implementation
+ * Frank Becker - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.internal.bugzilla.core;
@@ -15,6 +15,7 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
import org.eclipse.mylyn.tasks.core.data.TaskData;
/**
@@ -33,19 +34,83 @@ public class BugzillaAttachmentMapper extends TaskAttachmentMapper {
@Override
public void applyTo(TaskAttribute taskAttribute) {
- // ignore
- super.applyTo(taskAttribute);
-
Assert.isNotNull(taskAttribute);
TaskData taskData = taskAttribute.getTaskData();
TaskAttributeMapper mapper = taskData.getAttributeMapper();
-
+ taskAttribute.getMetaData().defaults().setType(TaskAttribute.TYPE_ATTACHMENT);
+ if (getAttachmentId() != null) {
+ mapper.setValue(taskAttribute, getAttachmentId());
+ }
+ if (getAuthor() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_AUTHOR);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_PERSON);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_Author);
+ mapper.setRepositoryPerson(child, getAuthor());
+ }
+ if (getContentType() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_CONTENT_TYPE);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_SHORT_TEXT);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_Content_Type);
+ mapper.setValue(child, getContentType());
+ }
+ if (getCreationDate() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_DATE);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_DATE);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_Creation_Date);
+ mapper.setDateValue(child, getCreationDate());
+ }
+ if (getDescription() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_SHORT_TEXT);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_Description);
+ mapper.setValue(child, getDescription());
+ }
+ if (getFileName() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_FILENAME);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_SHORT_TEXT);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_Filename);
+ mapper.setValue(child, getFileName());
+ }
+ if (isDeprecated() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_IS_DEPRECATED);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_BOOLEAN);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_obsolete);
+ mapper.setBooleanValue(child, isDeprecated());
+ }
+ if (isPatch() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_IS_PATCH);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_BOOLEAN);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_patch);
+ mapper.setBooleanValue(child, isPatch());
+ }
+ if (getLength() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_SIZE);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_SHORT_TEXT);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_Size);
+ mapper.setLongValue(child, getLength());
+ }
+ if (getUrl() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_URL);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_URL);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_URL);
+ mapper.setValue(child, getUrl());
+ }
if (getToken() != null) {
TaskAttribute child = taskAttribute.createMappedAttribute(BugzillaAttribute.TOKEN.getKey());
- child.getMetaData().defaults().setType(TaskAttribute.TYPE_SHORT_TEXT);
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_SHORT_TEXT);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_Token);
mapper.setValue(child, getToken());
}
-
}
public static BugzillaAttachmentMapper createFrom(TaskAttribute taskAttribute) {
@@ -98,5 +163,4 @@ public class BugzillaAttachmentMapper extends TaskAttachmentMapper {
}
return attachment;
}
-
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index 2a30ef549..29ad61a45 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -889,9 +889,9 @@ public class BugzillaClient {
Collection<TaskAttribute> attributes = taskAttribute.getAttributes().values();
Iterator<TaskAttribute> itr = attributes.iterator();
while (itr.hasNext()) {
- TaskAttribute a = itr.next();
- String id = a.getId();
- String value = a.getValue();
+ TaskAttribute attrib = itr.next();
+ String id = attrib.getId();
+ String value = attrib.getValue();
if (id.equals(TaskAttribute.ATTACHMENT_AUTHOR) || id.equals("date") || id.equals("size") //$NON-NLS-1$ //$NON-NLS-2$
|| id.equals(TaskAttribute.ATTACHMENT_URL)) {
continue;
@@ -910,7 +910,36 @@ public class BugzillaClient {
if (id.equals(TaskAttribute.ATTACHMENT_IS_PATCH)) {
id = "ispatch"; //$NON-NLS-1$
}
- formData.add(new NameValuePair(id, value));
+ if (id.startsWith("task.common.kind.flag_type")) { //$NON-NLS-1$
+ TaskAttribute requestee = attrib.getAttribute("requestee"); //$NON-NLS-1$
+ TaskAttribute state = attrib.getAttribute("state"); //$NON-NLS-1$
+ String requesteeName = "requestee_type-" + id.substring(26); //$NON-NLS-1$
+ String requesteeValue = requestee.getValue();
+ value = state.getValue();
+ if (value.equals(" ")) { //$NON-NLS-1$
+ value = "X"; //$NON-NLS-1$
+ }
+ if (value.equals("?")) { //$NON-NLS-1$
+ formData.add(new NameValuePair(requesteeName, requesteeValue));
+ }
+ id = "flag_type-" + id.substring(26); //$NON-NLS-1$
+ } else if (id.startsWith("task.common.kind.flag")) { //$NON-NLS-1$
+ TaskAttribute requestee = attrib.getAttribute("requestee"); //$NON-NLS-1$
+ TaskAttribute state = attrib.getAttribute("state"); //$NON-NLS-1$
+ String requesteeName = "requestee-" + id.substring(21); //$NON-NLS-1$
+ String requesteeValue = requestee.getValue();
+ value = state.getValue();
+ if (value.equals(" ") | value.equals("")) { //$NON-NLS-1$//$NON-NLS-2$
+ value = "X"; //$NON-NLS-1$
+ }
+ if (value.equals("?")) { //$NON-NLS-1$
+ formData.add(new NameValuePair(requesteeName, requesteeValue));
+ }
+ id = "flag-" + id.substring(21); //$NON-NLS-1$
+ }
+ if (!value.equals("")) { //$NON-NLS-1$
+ formData.add(new NameValuePair(id, value));
+ }
}
GzipPostMethod method = null;
InputStream input = null;
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
index a1f5bb8b5..80388a123 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
@@ -177,6 +177,26 @@ public class Messages extends NLS {
public static String BugzillaAttribute_Worked;
+ public static String BugzillaAttachmentMapper_Author;
+
+ public static String BugzillaAttachmentMapper_Content_Type;
+
+ public static String BugzillaAttachmentMapper_Creation_Date;
+
+ public static String BugzillaAttachmentMapper_Description;
+
+ public static String BugzillaAttachmentMapper_Filename;
+
+ public static String BugzillaAttachmentMapper_obsolete;
+
+ public static String BugzillaAttachmentMapper_patch;
+
+ public static String BugzillaAttachmentMapper_Size;
+
+ public static String BugzillaAttachmentMapper_Token;
+
+ public static String BugzillaAttachmentMapper_URL;
+
public static String BugzillaClient_could_not_post_form_null_returned;
public static String BugzillaClient_description_required_when_submitting_attachments;
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
index 481a8b921..c224dcd77 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
@@ -375,6 +375,8 @@ public class RepositoryConfiguration implements Serializable {
if (localuser) {
removeDomain(taskData);
}
+ addMissingAttachmentFlags(taskData, connector);
+ updateAttachmentOptions(taskData);
}
}
@@ -731,6 +733,99 @@ public class RepositoryConfiguration implements Serializable {
return encoding;
}
+ public void updateAttachmentOptions(TaskData existingReport) {
+ for (TaskAttribute attribute : new HashSet<TaskAttribute>(existingReport.getRoot().getAttributes().values())) {
+
+ if (!attribute.getId().startsWith("task.common.attachment")) { //$NON-NLS-1$
+ continue;
+ }
+
+ for (TaskAttribute attachmentAttribute : attribute.getAttributes().values()) {
+ if (!attachmentAttribute.getId().startsWith("task.common.kind.flag")) { //$NON-NLS-1$
+ continue;
+ }
+
+ TaskAttribute state = attachmentAttribute.getAttribute("state"); //$NON-NLS-1$
+ attachmentAttribute.clearOptions();
+
+ String nameValue = state.getMetaData().getLabel();
+ state.putOption("", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ for (BugzillaFlag bugzillaFlag : flags) {
+ if (nameValue.equals(bugzillaFlag.getName()) && bugzillaFlag.getType().equals("attachment")) { //$NON-NLS-1$
+ if ("attachment".equals(bugzillaFlag.getType())) { //$NON-NLS-1$
+ if (bugzillaFlag.isRequestable()) {
+ state.putOption("?", "?"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ break;
+ }
+ }
+ }
+ state.putOption("-", "-"); //$NON-NLS-1$ //$NON-NLS-2$
+ state.putOption("+", "+"); //$NON-NLS-1$ //$NON-NLS-2$
+ String flagNameValue = state.getMetaData().getLabel();
+ for (BugzillaFlag bugzillaFlag : flags) {
+ if (flagNameValue.equals(bugzillaFlag.getName()) && bugzillaFlag.getType().equals("attachment")) { //$NON-NLS-1$
+ TaskAttribute requestee = attachmentAttribute.getAttribute("requestee"); //$NON-NLS-1$
+ if (requestee == null) {
+ requestee = attachmentAttribute.createMappedAttribute("requestee"); //$NON-NLS-1$
+ requestee.getMetaData().defaults().setType(TaskAttribute.TYPE_SHORT_TEXT);
+ requestee.setValue(""); //$NON-NLS-1$
+ }
+ requestee.getMetaData().setReadOnly(!bugzillaFlag.isSpecifically_requestable());
+ }
+ }
+
+ }
+ }
+ }
+
+ private void addMissingAttachmentFlags(TaskData taskData, BugzillaRepositoryConnector connector) {
+ List<String> existingFlags = new ArrayList<String>();
+ List<BugzillaFlag> flags = getFlags();
+ for (TaskAttribute attribute : new HashSet<TaskAttribute>(taskData.getRoot().getAttributes().values())) {
+
+ if (!attribute.getId().startsWith("task.common.attachment")) { //$NON-NLS-1$
+ continue;
+ }
+ existingFlags.clear();
+ for (TaskAttribute attachmentAttribute : attribute.getAttributes().values()) {
+ if (!attachmentAttribute.getId().startsWith("task.common.kind.flag")) { //$NON-NLS-1$
+ continue;
+ }
+ TaskAttribute state = attachmentAttribute.getAttribute("state"); //$NON-NLS-1$
+ if (state != null) {
+ String nameValue = state.getMetaData().getLabel();
+ if (!existingFlags.contains(nameValue)) {
+ existingFlags.add(nameValue);
+ }
+ }
+ }
+ TaskAttribute productAttribute = taskData.getRoot().getMappedAttribute(BugzillaAttribute.PRODUCT.getKey());
+ TaskAttribute componentAttribute = taskData.getRoot().getMappedAttribute(
+ BugzillaAttribute.COMPONENT.getKey());
+ for (BugzillaFlag bugzillaFlag : flags) {
+ if (!bugzillaFlag.getType().equals("attachment")) { //$NON-NLS-1$
+ continue;
+ }
+ if (!bugzillaFlag.isUsedIn(productAttribute.getValue(), componentAttribute.getValue())) {
+ continue;
+ }
+ if (existingFlags.contains(bugzillaFlag.getName()) && !bugzillaFlag.isMultiplicable()) {
+ continue;
+ }
+ BugzillaFlagMapper mapper = new BugzillaFlagMapper(connector);
+ mapper.setRequestee(""); //$NON-NLS-1$
+ mapper.setSetter(""); //$NON-NLS-1$
+ mapper.setState(" "); //$NON-NLS-1$
+ mapper.setFlagId(bugzillaFlag.getName());
+ mapper.setNumber(0);
+ mapper.setDescription(bugzillaFlag.getDescription());
+ TaskAttribute newattribute = attribute.createAttribute("task.common.kind.flag_type" + bugzillaFlag.getFlagId()); //$NON-NLS-1$
+ mapper.applyTo(newattribute);
+ }
+ }
+ }
+
public void setETagValue(String eTagValue) {
this.eTagValue = eTagValue;
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
index 203414dd1..c86d3fdfc 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
@@ -18,7 +18,6 @@ import java.util.Locale;
import java.util.Map;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
-import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskCommentMapper;
@@ -521,7 +520,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler {
List<TaskAttribute> taskAttachments = repositoryTaskData.getAttributeMapper().getAttributesByType(
repositoryTaskData, TaskAttribute.TYPE_ATTACHMENT);
for (TaskAttribute attachment : taskAttachments) {
- TaskAttachmentMapper attachmentMapper = TaskAttachmentMapper.createFrom(attachment);
+ BugzillaAttachmentMapper attachmentMapper = BugzillaAttachmentMapper.createFrom(attachment);
TaskCommentMapper taskComment = attachIdToComment.get(attachmentMapper.getAttachmentId());
if (taskComment != null) {
attachmentMapper.setAuthor(taskComment.getAuthor());
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
index 45aa4ecb4..ce3cb9ae0 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
@@ -84,6 +84,18 @@ BugzillaAttribute_Votes=Votes:
BugzillaAttribute_who=who
BugzillaAttribute_who_name=who_name
BugzillaAttribute_Worked=Worked:
+
+BugzillaAttachmentMapper_Author=Attachment Author:
+BugzillaAttachmentMapper_Content_Type=Content Type:
+BugzillaAttachmentMapper_Creation_Date=Creation Date:
+BugzillaAttachmentMapper_Description=Description:
+BugzillaAttachmentMapper_Filename=Filename:
+BugzillaAttachmentMapper_obsolete=obsolete
+BugzillaAttachmentMapper_patch=patch
+BugzillaAttachmentMapper_Size=Size in Bytes:
+BugzillaAttachmentMapper_Token=Token:
+BugzillaAttachmentMapper_URL=URL:
+
BugzillaClient_could_not_post_form_null_returned=Could not post form, client returned null method.
BugzillaClient_description_required_when_submitting_attachments=A description is required when submitting attachments.
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java
index a82a63ef4..671903e55 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaAttachmentHandlerTest.java
@@ -58,6 +58,173 @@ public class BugzillaAttachmentHandlerTest extends AbstractBugzillaTest {
super.tearDown();
}
+ public void testUpdateAttachmentFlags() throws Exception {
+ TaskData taskData = BugzillaFixture.current().createTask(PrivilegeLevel.USER, "update of Attachment Flags",
+ "description for testUpdateAttachmentFlags");
+ assertNotNull(taskData);
+ int numAttached = taskData.getAttributeMapper()
+ .getAttributesByType(taskData, TaskAttribute.TYPE_ATTACHMENT)
+ .size();
+ assertEquals(0, numAttached);
+ assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY));
+ assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY).getUserName());
+ assertNotNull(repository.getCredentials(AuthenticationType.REPOSITORY).getPassword());
+ BugzillaClient client = connector.getClientManager().getClient(repository, new NullProgressMonitor());
+
+ TaskAttribute attrAttachment = taskData.getAttributeMapper().createTaskAttachment(taskData);
+ TaskAttachmentMapper attachmentMapper = TaskAttachmentMapper.createFrom(attrAttachment);
+ /* Test uploading a proper file */
+ String fileName = "test-attach-1.txt";
+ File attachFile = new File(fileName);
+ attachFile.createNewFile();
+ BufferedWriter write = new BufferedWriter(new FileWriter(attachFile));
+ write.write("test file from " + System.currentTimeMillis());
+ write.close();
+
+ FileTaskAttachmentSource attachment = new FileTaskAttachmentSource(attachFile);
+ attachment.setContentType("text/plain");
+ attachment.setDescription("Description");
+ attachment.setName("My Attachment 1");
+
+ try {
+ client.postAttachment(taskData.getTaskId(), attachmentMapper.getComment(), attachment, attrAttachment,
+ new NullProgressMonitor());
+ } catch (Exception e) {
+ fail("never reach this!");
+ }
+ taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
+ assertNotNull(taskData);
+ numAttached = taskData.getAttributeMapper().getAttributesByType(taskData, TaskAttribute.TYPE_ATTACHMENT).size();
+ assertEquals(1, numAttached);
+ TaskAttribute attachmentAttribute = taskData.getAttributeMapper().getAttributesByType(taskData,
+ TaskAttribute.TYPE_ATTACHMENT).get(0);
+ int flagCount = 0;
+ int flagCountUnused = 0;
+ TaskAttribute attachmentFlag1 = null;
+ TaskAttribute attachmentFlag2 = null;
+ for (TaskAttribute attribute : attachmentAttribute.getAttributes().values()) {
+ if (!attribute.getId().startsWith("task.common.kind.flag")) { //$NON-NLS-1$
+ continue;
+ }
+ flagCount++;
+ if (attribute.getId().startsWith("task.common.kind.flag_type")) { //$NON-NLS-1$
+ flagCountUnused++;
+ TaskAttribute stateAttribute = taskData.getAttributeMapper().getAssoctiatedAttribute(attribute);
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag1")) {
+ attachmentFlag1 = attribute;
+ }
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag2")) {
+ attachmentFlag2 = attribute;
+ }
+ }
+ }
+ assertEquals(2, flagCount);
+ assertEquals(2, flagCountUnused);
+ assertNotNull(attachmentFlag1);
+ assertNotNull(attachmentFlag2);
+ TaskAttribute stateAttribute1 = taskData.getAttributeMapper().getAssoctiatedAttribute(attachmentFlag1);
+ stateAttribute1.setValue("?");
+ TaskAttribute requestee = attachmentFlag1.getAttribute("requestee"); //$NON-NLS-1$
+ requestee.setValue("guest@mylyn.eclipse.org");
+ client.postUpdateAttachment(attachmentAttribute, "update", null);
+ taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
+ assertNotNull(taskData);
+ attachmentAttribute = taskData.getAttributeMapper()
+ .getAttributesByType(taskData, TaskAttribute.TYPE_ATTACHMENT)
+ .get(0);
+ assertNotNull(attachmentAttribute);
+ flagCount = 0;
+ flagCountUnused = 0;
+ attachmentFlag1 = null;
+ attachmentFlag2 = null;
+ TaskAttribute attachmentFlag1used = null;
+ TaskAttribute attachmentFlag2used = null;
+
+ for (TaskAttribute attribute : attachmentAttribute.getAttributes().values()) {
+ if (!attribute.getId().startsWith("task.common.kind.flag")) { //$NON-NLS-1$
+ continue;
+ }
+ flagCount++;
+ if (attribute.getId().startsWith("task.common.kind.flag_type")) { //$NON-NLS-1$
+ flagCountUnused++;
+ TaskAttribute stateAttribute = taskData.getAttributeMapper().getAssoctiatedAttribute(attribute);
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag1")) {
+ attachmentFlag1 = attribute;
+ }
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag2")) {
+ attachmentFlag2 = attribute;
+ }
+ } else {
+ TaskAttribute stateAttribute = taskData.getAttributeMapper().getAssoctiatedAttribute(attribute);
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag1")) {
+ attachmentFlag1used = attribute;
+ }
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag2")) {
+ attachmentFlag2used = attribute;
+ }
+ }
+
+ }
+ assertEquals(3, flagCount);
+ assertEquals(2, flagCountUnused);
+ assertNotNull(attachmentFlag1);
+ assertNotNull(attachmentFlag2);
+ assertNotNull(attachmentFlag1used);
+ assertNull(attachmentFlag2used);
+ TaskAttribute stateAttribute1used = taskData.getAttributeMapper().getAssoctiatedAttribute(attachmentFlag1used);
+ TaskAttribute requesteeused = attachmentFlag1used.getAttribute("requestee"); //$NON-NLS-1$
+ assertNotNull(stateAttribute1used);
+ assertNotNull(requesteeused);
+ assertEquals("?", stateAttribute1used.getValue());
+ assertEquals("guest@mylyn.eclipse.org", requesteeused.getValue());
+ stateAttribute1used.setValue(" ");
+ client.postUpdateAttachment(attachmentAttribute, "update", null);
+ taskData = BugzillaFixture.current().getTask(taskData.getTaskId(), client);
+ assertNotNull(taskData);
+ attachmentAttribute = taskData.getAttributeMapper()
+ .getAttributesByType(taskData, TaskAttribute.TYPE_ATTACHMENT)
+ .get(0);
+ assertNotNull(attachmentAttribute);
+ flagCount = 0;
+ flagCountUnused = 0;
+ attachmentFlag1 = null;
+ attachmentFlag2 = null;
+ attachmentFlag1used = null;
+ attachmentFlag2used = null;
+
+ for (TaskAttribute attribute : attachmentAttribute.getAttributes().values()) {
+ if (!attribute.getId().startsWith("task.common.kind.flag")) { //$NON-NLS-1$
+ continue;
+ }
+ flagCount++;
+ if (attribute.getId().startsWith("task.common.kind.flag_type")) { //$NON-NLS-1$
+ flagCountUnused++;
+ TaskAttribute stateAttribute = taskData.getAttributeMapper().getAssoctiatedAttribute(attribute);
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag1")) {
+ attachmentFlag1 = attribute;
+ }
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag2")) {
+ attachmentFlag2 = attribute;
+ }
+ } else {
+ TaskAttribute stateAttribute = taskData.getAttributeMapper().getAssoctiatedAttribute(attribute);
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag1")) {
+ attachmentFlag1used = attribute;
+ }
+ if (stateAttribute.getMetaData().getLabel().equals("AttachmentFlag2")) {
+ attachmentFlag2used = attribute;
+ }
+ }
+
+ }
+ assertEquals(2, flagCount);
+ assertEquals(2, flagCountUnused);
+ assertNotNull(attachmentFlag1);
+ assertNotNull(attachmentFlag2);
+ assertNull(attachmentFlag1used);
+ assertNull(attachmentFlag2used);
+ }
+
public void testAttachToExistingReport() throws Exception {
TaskData taskData = BugzillaFixture.current().createTask(PrivilegeLevel.USER, null, null);
assertNotNull(taskData);
diff --git a/org.eclipse.mylyn.bugzilla.ui/plugin.xml b/org.eclipse.mylyn.bugzilla.ui/plugin.xml
index 9aa048672..bd24e1b05 100644
--- a/org.eclipse.mylyn.bugzilla.ui/plugin.xml
+++ b/org.eclipse.mylyn.bugzilla.ui/plugin.xml
@@ -96,7 +96,7 @@
menubarPath="org.eclipse.mylyn.bugzilla.ui.attachments.mark/markadditions"
tooltip="Mark attachment as not obsolete">
</action>
- <action
+ <action
class="org.eclipse.mylyn.internal.bugzilla.ui.action.BugzillaObsoleteAttachmentAction"
enablesFor="*"
id="org.eclipse.mylyn.bugzilla.ui.contribution.attachment.obsolete"
@@ -104,6 +104,14 @@
menubarPath="org.eclipse.mylyn.bugzilla.ui.attachments.mark/markadditions"
tooltip="Mark attachment as obsolete">
</action>
+ <action
+ class="org.eclipse.mylyn.internal.bugzilla.ui.action.BugzillaAttachmentUpdateAction"
+ enablesFor="*"
+ id="org.eclipse.mylyn.bugzilla.ui.contribution.attachment.update"
+ label="Detail..."
+ menubarPath="org.eclipse.mylyn.bugzilla.ui.attachments.mark"
+ tooltip="Attachment Details">
+ </action>
<menu
id="org.eclipse.mylyn.bugzilla.ui.attachments.mark"
label="Mark as"
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/BugzillaAttachmentUpdateAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/BugzillaAttachmentUpdateAction.java
new file mode 100644
index 000000000..a4b0a6e2c
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/BugzillaAttachmentUpdateAction.java
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.ui.action;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
+import org.eclipse.mylyn.internal.bugzilla.ui.dialogs.BugzillaAttachmentDialog;
+import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaTaskEditorPage;
+import org.eclipse.mylyn.internal.bugzilla.ui.editor.FlagAttributeEditor;
+import org.eclipse.mylyn.internal.tasks.core.TaskTask;
+import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.ITaskAttachment;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
+import org.eclipse.mylyn.tasks.core.data.TaskData;
+import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
+import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory;
+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+/**
+ * @author Frank Becker
+ */
+@SuppressWarnings("restriction")
+public class BugzillaAttachmentUpdateAction extends BaseSelectionListenerAction implements IViewActionDelegate {
+
+ private ISelection currentSelection;
+
+ public BugzillaAttachmentUpdateAction() {
+ super("BugzillaAttachmentDetailAction"); //$NON-NLS-1$
+ }
+
+ public void init(IViewPart view) {
+ // ignore
+ }
+
+ public void run(IAction action) {
+ IStructuredSelection selection = null;
+ if (currentSelection instanceof IStructuredSelection) {
+ selection = (IStructuredSelection) currentSelection;
+ }
+ if (selection == null || selection.isEmpty() || selection.size() != 1) {
+ return;
+ }
+ ITaskAttachment attachment = (ITaskAttachment) selection.getFirstElement();
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ IWorkbenchPage page = window.getActivePage();
+ IEditorPart activeEditor = page.getActiveEditor();
+ IWorkbenchPartSite site = activeEditor.getSite();
+ Shell shell = site.getShell();
+ if (activeEditor instanceof TaskEditor) {
+ final TaskEditor taskEditor = (TaskEditor) activeEditor;
+ IFormPage taskEditorPage = taskEditor.findPage("id"); //$NON-NLS-1$
+ if (taskEditorPage instanceof BugzillaTaskEditorPage) {
+ BugzillaTaskEditorPage bugzillaTaskEditorPage = (BugzillaTaskEditorPage) taskEditorPage;
+
+ ITask attachmentTask = attachment.getTask();
+ ITask nTask = new TaskTask(attachmentTask.getConnectorKind(), attachmentTask.getRepositoryUrl(),
+ attachmentTask.getTaskId() + "attachment"); //$NON-NLS-1$
+
+ TaskData editTaskData = new TaskData(attachment.getTaskAttribute().getTaskData().getAttributeMapper(),
+ attachment.getTaskAttribute().getTaskData().getConnectorKind(), attachment.getTaskAttribute()
+ .getTaskData()
+ .getRepositoryUrl(), attachment.getTaskAttribute().getTaskData().getTaskId());
+ editTaskData.setVersion(attachment.getTaskAttribute().getTaskData().getVersion());
+ TaskAttribute target0 = editTaskData.getRoot();
+ TaskAttribute temp = attachment.getTaskAttribute();
+ target0.setValues(temp.getValues());
+ for (TaskAttribute child : temp.getAttributes().values()) {
+ target0.deepAddCopy(child);
+ }
+
+ TaskAttribute comment = target0.createAttribute("comment"); //$NON-NLS-1$
+ TaskAttributeMetaData commentMeta = comment.getMetaData();
+ commentMeta.setType(TaskAttribute.TYPE_LONG_RICH_TEXT);
+ commentMeta.setLabel(Messages.BugzillaAttachmentUpdateAction_Comment);
+
+ ITaskDataWorkingCopy workingCopy = TasksUi.getTaskDataManager().createWorkingCopy(nTask, editTaskData);
+ TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(
+ attachment.getTaskAttribute().getTaskData().getRepositoryUrl());
+ final TaskDataModel model = new TaskDataModel(repository, nTask, workingCopy);
+ AttributeEditorFactory factory = new AttributeEditorFactory(model, repository,
+ bugzillaTaskEditorPage.getEditorSite()) {
+ @Override
+ public AbstractAttributeEditor createEditor(String type, final TaskAttribute taskAttribute) {
+ AbstractAttributeEditor editor;
+ if (IBugzillaConstants.EDITOR_TYPE_FLAG.equals(type)) {
+ editor = new FlagAttributeEditor(model, taskAttribute, 350);
+ } else {
+ editor = super.createEditor(type, taskAttribute);
+ if (TaskAttribute.TYPE_BOOLEAN.equals(type)) {
+ editor.setDecorationEnabled(false);
+ }
+ }
+ return editor;
+ }
+ };
+
+ TaskAttribute target = workingCopy.getLocalData().getRoot();
+ BugzillaAttachmentDialog dialog = new BugzillaAttachmentDialog(shell, model, factory, target, false);
+ if (dialog.open() == Window.OK) {
+ TaskAttribute attachmentAttribute = attachment.getTaskAttribute();
+ for (TaskAttribute child : target.getAttributes().values()) {
+ attachmentAttribute.deepAddCopy(child);
+ }
+ final ChangeAttachmentJob job = new ChangeAttachmentJob(attachment, taskEditor);
+ job.setUser(true);
+ job.addJobChangeListener(new JobChangeAdapter() {
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ IFormPage formPage = taskEditor.getActivePageInstance();
+ if (formPage instanceof BugzillaTaskEditorPage) {
+ final BugzillaTaskEditorPage bugzillaPage = (BugzillaTaskEditorPage) formPage;
+ if (job.getError() != null) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ bugzillaPage.getTaskEditor().setMessage(job.getError().getMessage(),
+ IMessageProvider.ERROR);
+ }
+ });
+ } else {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ bugzillaPage.refreshFormContent();
+ }
+ });
+ }
+ }
+ }
+ });
+ job.schedule();
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.currentSelection = selection;
+ IStructuredSelection sructuredSelection = null;
+ if (selection instanceof IStructuredSelection) {
+ sructuredSelection = (IStructuredSelection) currentSelection;
+ }
+ if (sructuredSelection == null || sructuredSelection.isEmpty()) {
+ return;
+ }
+ List<ITaskAttachment> attachmentList = sructuredSelection.toList();
+ if (attachmentList != null && attachmentList.size() == 1) {
+ action.setEnabled(true);
+ } else {
+ action.setEnabled(false);
+ }
+ }
+}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/ChangeAttachmentJob.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/ChangeAttachmentJob.java
new file mode 100644
index 000000000..f754da27d
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/ChangeAttachmentJob.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.ui.action;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.mylyn.commons.core.StatusHandler;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler;
+import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaTaskEditorPage;
+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonFormUtil;
+import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.ITaskAttachment;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
+import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.editor.IFormPage;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Frank Becker
+ */
+@SuppressWarnings("restriction")
+public class ChangeAttachmentJob extends Job {
+
+ private final ITaskAttachment attachment;
+
+ private final TaskEditor editor;
+
+ private IStatus error;
+
+ public ChangeAttachmentJob(ITaskAttachment attachment, TaskEditor editor) {
+ super(Messages.UpdateAttachmentJob_update_attachment);
+ this.attachment = attachment;
+ this.editor = editor;
+ }
+
+ public IStatus getError() {
+ return error;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ final ITask task;
+ task = editor.getTaskEditorInput().getTask();
+
+ if (!task.getConnectorKind().equals(BugzillaCorePlugin.CONNECTOR_KIND)) {
+ return Status.OK_STATUS;
+ }
+ AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector(
+ task.getConnectorKind());
+ monitor.beginTask(Messages.UpdateAttachmentJob_update_attachments, 20);
+ try {
+ ((BugzillaTaskDataHandler) connector.getTaskDataHandler()).postUpdateAttachment(
+ attachment.getTaskRepository(), attachment.getTaskAttribute(), "update", monitor); //$NON-NLS-1$
+ monitor.worked(10);
+
+ if (attachment != null) {
+ if (connector != null) {
+ TasksUiInternal.synchronizeTask(connector, task, true, new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ if (editor != null) {
+ editor.refreshPages();
+ editor.getEditorSite().getPage().activate(editor);
+ IFormPage formPage = editor.getActivePageInstance();
+ if (formPage instanceof BugzillaTaskEditorPage) {
+ BugzillaTaskEditorPage bugzillaPage = (BugzillaTaskEditorPage) formPage;
+ Control control = bugzillaPage.getPart(
+ AbstractTaskEditorPage.ID_PART_ATTACHMENTS).getControl();
+ if (control instanceof Section) {
+ Section section = (Section) control;
+ CommonFormUtil.setExpanded(section, true);
+ }
+ }
+
+ }
+ } finally {
+ if (editor != null) {
+ editor.showBusy(false);
+ }
+ }
+ }
+ });
+ }
+ });
+ }
+ monitor.worked(10);
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (editor != null) {
+ editor.showBusy(true);
+ }
+ }
+ });
+ }
+ } catch (OperationCanceledException e) {
+ return Status.CANCEL_STATUS;
+ } catch (CoreException e) {
+ StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN,
+ "Update of an Attachment failed", e)); //$NON-NLS-1$
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/Messages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/Messages.java
index bd777b562..37abff374 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/Messages.java
@@ -29,4 +29,5 @@ public class Messages extends NLS {
public static String UpdateAttachmentJob_update_attachment;
+ public static String BugzillaAttachmentUpdateAction_Comment;
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/messages.properties
index dcbd1c8a9..dcecf1eba 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/action/messages.properties
@@ -10,3 +10,4 @@
###############################################################################
UpdateAttachmentJob_update_attachment=Update attachment
UpdateAttachmentJob_update_attachments=Update attachments
+BugzillaAttachmentUpdateAction_Comment=Comment:
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/dialogs/BugzillaAttachmentDialog.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/dialogs/BugzillaAttachmentDialog.java
new file mode 100644
index 000000000..007d37aa8
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/dialogs/BugzillaAttachmentDialog.java
@@ -0,0 +1,289 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.ui.dialogs;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
+import org.eclipse.mylyn.internal.bugzilla.ui.tasklist.Messages;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
+import org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent;
+import org.eclipse.mylyn.tasks.core.data.TaskDataModelListener;
+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
+import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.SelectionDialog;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Frank Becker
+ */
+public class BugzillaAttachmentDialog extends SelectionDialog {
+
+ private final FormToolkit toolkit;
+
+ private Composite scrollComposite;
+
+ private ExpandableComposite flagExpandComposite = null;
+
+ private final TaskAttribute attachment;
+
+ private final Shell parentShell;
+
+ private final boolean readOnly;
+
+ private final AttributeEditorFactory attributeEditorFactory;
+
+ private static final int LABEL_WIDTH = 120;
+
+ private static final int COLUMN_GAP = 5;
+
+ private static final int MULTI_ROW_HEIGHT = 55;
+
+ private static final int COLUMN_WIDTH = 200;
+
+ private static final int MULTI_COLUMN_WIDTH = COLUMN_WIDTH + 5 + COLUMN_GAP + LABEL_WIDTH + 5 + COLUMN_WIDTH;
+
+ private AbstractAttributeEditor commentEditor;
+
+ private final TaskDataModel model;
+
+ private boolean changed = false;
+
+ public BugzillaAttachmentDialog(Shell parentShell, TaskDataModel model, AttributeEditorFactory factory,
+ TaskAttribute attachment, boolean readonly) {
+ super(parentShell);
+ this.attachment = attachment;
+ this.parentShell = parentShell;
+ this.readOnly = readonly;
+ attributeEditorFactory = factory;
+ this.model = model;
+ model.addModelListener(new TaskDataModelListener() {
+
+ @Override
+ public void attributeChanged(TaskDataModelEvent event) {
+ if (!changed) {
+ changed = true;
+ getOkButton().setEnabled(changed);
+
+ }
+ }
+
+ });
+ toolkit = new FormToolkit(Display.getCurrent());
+ this.setTitle(readonly ? Messages.BugzillaAttachmentDialog_DetailTitle
+ : Messages.BugzillaAttachmentDialog_DetailTitle);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ int currentColumn = 1;
+ int columnCount = 4;
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ initializeDialogUnits(composite);
+
+ Composite attributeArea = new Composite(composite, SWT.FLAT);
+ GridLayout layout = new GridLayout(4, false);
+ attributeArea.setLayout(layout);
+ createAttributeEditors(currentColumn, columnCount, attributeArea);
+ createCommentEditor(currentColumn, columnCount, attributeArea);
+ Composite advancedComposite = createFlagSection(attributeArea);
+ createFlagEditors(columnCount, advancedComposite);
+ createAttributeEditor(attachment.getMappedAttribute(TaskAttribute.ATTACHMENT_URL), currentColumn, columnCount,
+ advancedComposite);
+ Dialog.applyDialogFont(composite);
+ return composite;
+ }
+
+ private void createAttributeEditor(TaskAttribute attribute, int currentColumn, int columnCount,
+ Composite attributeArea) {
+ String type = attribute.getMetaData().getType();
+ if (type != null) {
+ AbstractAttributeEditor editor = attributeEditorFactory.createEditor(type, attribute);
+ if (attribute.getId().equals(BugzillaAttribute.TOKEN.getKey())
+ || attribute.getId().equals("size") || attribute.getId().equals(TaskAttribute.ATTACHMENT_URL)) { //$NON-NLS-1$
+ editor.setReadOnly(true);
+ } else {
+ editor.setReadOnly(readOnly);
+ }
+ if (editor.hasLabel()) {
+ editor.createLabelControl(attributeArea, toolkit);
+ Label label = editor.getLabelControl();
+ label.setBackground(attributeArea.getBackground());
+ String labelString = editor.getLabel();
+ if (labelString != null && !labelString.equals("")) { //$NON-NLS-1$
+ GridData gd = GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).hint(LABEL_WIDTH,
+ SWT.DEFAULT).create();
+ if (currentColumn > 1) {
+ gd.horizontalIndent = COLUMN_GAP;
+ gd.widthHint = LABEL_WIDTH + COLUMN_GAP;
+ }
+ label.setLayoutData(gd);
+ currentColumn++;
+ }
+ }
+ editor.createControl(attributeArea, toolkit);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ if (type.equals(TaskAttribute.TYPE_BOOLEAN) || type.equals(TaskAttribute.TYPE_SHORT_TEXT)
+ || type.equals(TaskAttribute.TYPE_URL)) {
+ gd.horizontalSpan = 3;
+ } else {
+ gd.horizontalSpan = 1;
+ }
+ editor.getControl().setLayoutData(gd);
+ editor.getControl().setBackground(parentShell.getBackground());
+ currentColumn += gd.horizontalSpan;
+ currentColumn %= columnCount;
+ }
+ }
+
+ private void createAttributeEditors(int currentColumn, int columnCount, Composite attributeArea) {
+ createAttributeEditor(attachment.getMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION), currentColumn,
+ columnCount, attributeArea);
+ createAttributeEditor(attachment.getMappedAttribute(TaskAttribute.ATTACHMENT_FILENAME), currentColumn,
+ columnCount, attributeArea);
+ createAttributeEditor(attachment.getMappedAttribute(TaskAttribute.ATTACHMENT_SIZE), currentColumn, columnCount,
+ attributeArea);
+ createAttributeEditor(attachment.getMappedAttribute(TaskAttribute.ATTACHMENT_CONTENT_TYPE), currentColumn,
+ columnCount, attributeArea);
+ createAttributeEditor(attachment.getMappedAttribute(TaskAttribute.ATTACHMENT_IS_PATCH), currentColumn,
+ columnCount, attributeArea);
+ createAttributeEditor(attachment.getMappedAttribute(TaskAttribute.ATTACHMENT_IS_DEPRECATED), currentColumn,
+ columnCount, attributeArea);
+ }
+
+ private void createFlagEditors(int columnCount, Composite advancedComposite) {
+ int currentFlagColumn = 1;
+
+ for (TaskAttribute attribute : attachment.getAttributes().values()) {
+ if (!attribute.getId().startsWith("task.common.kind.flag")) { //$NON-NLS-1$
+ continue;
+ }
+ String type = attribute.getMetaData().getType();
+ if (type != null) {
+ AbstractAttributeEditor editor = attributeEditorFactory.createEditor(type, attribute);
+ editor.setReadOnly(readOnly);
+
+ if (editor.hasLabel()) {
+ editor.createLabelControl(advancedComposite, toolkit);
+ Label label = editor.getLabelControl();
+ label.setBackground(advancedComposite.getBackground());
+ GridData gd = GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).hint(LABEL_WIDTH,
+ SWT.DEFAULT).create();
+ if (currentFlagColumn > 1) {
+ gd.horizontalIndent = COLUMN_GAP;
+ gd.widthHint = LABEL_WIDTH + COLUMN_GAP;
+ }
+ label.setLayoutData(gd);
+ currentFlagColumn++;
+ }
+ editor.createControl(advancedComposite, toolkit);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ gd.widthHint = 150;//COLUMN_WIDTH;
+ gd.horizontalSpan = 3;
+ editor.getControl().setLayoutData(gd);
+ currentFlagColumn += gd.horizontalSpan;
+ currentFlagColumn %= columnCount;
+ editor.getControl().setBackground(parentShell.getBackground());
+ }
+ }
+ }
+
+ private void createCommentEditor(int currentColumn, int columnCount, Composite attributeArea) {
+ TaskAttribute commentAttribute = attachment.getAttribute("comment"); //$NON-NLS-1$
+ if (commentAttribute == null || readOnly) {
+ return;
+ }
+ String type = commentAttribute.getMetaData().getType();
+ if (type != null) {
+ commentEditor = attributeEditorFactory.createEditor(type, commentAttribute);
+ String labelString = commentEditor.getLabel();
+ if (commentEditor.hasLabel()) {
+ commentEditor.createLabelControl(attributeArea, toolkit);
+ if (!labelString.equals("")) { //$NON-NLS-1$
+ Label label = commentEditor.getLabelControl();
+ label.setBackground(attributeArea.getBackground());
+ GridData gd = GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.TOP).hint(LABEL_WIDTH,
+ SWT.DEFAULT).create();
+ if (currentColumn > 1) {
+ gd.horizontalIndent = COLUMN_GAP;
+ gd.widthHint = LABEL_WIDTH + COLUMN_GAP;
+ }
+ label.setLayoutData(gd);
+ }
+ }
+ commentEditor.createControl(attributeArea, toolkit);
+ commentEditor.getControl().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ gd.heightHint = MULTI_ROW_HEIGHT;
+ gd.widthHint = MULTI_COLUMN_WIDTH;
+ gd.horizontalSpan = 2;//columnCount - currentColumn + 1;
+ commentEditor.getControl().setLayoutData(gd);
+ toolkit.paintBordersFor(attributeArea);
+ }
+ }
+
+ private Composite createFlagSection(Composite container) {
+ flagExpandComposite = toolkit.createExpandableComposite(container, ExpandableComposite.COMPACT
+ | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
+ flagExpandComposite.setFont(container.getFont());
+ flagExpandComposite.setBackground(container.getBackground());
+ flagExpandComposite.setText(Messages.BugzillaTaskAttachmentPage_Advanced);
+ GridLayout gLayout = new GridLayout(4, false);
+ gLayout.horizontalSpacing = 0;
+ gLayout.marginWidth = 0;
+ flagExpandComposite.setLayout(new GridLayout(4, false));
+ GridData g = new GridData(GridData.FILL_HORIZONTAL);
+ g.horizontalSpan = 4;
+ flagExpandComposite.setLayoutData(g);
+ flagExpandComposite.addExpansionListener(new ExpansionAdapter() {
+ @Override
+ public void expansionStateChanged(ExpansionEvent e) {
+ parentShell.getDisplay().getActiveShell().pack();
+ }
+ });
+
+ scrollComposite = new Composite(flagExpandComposite, SWT.NONE);
+ GridLayout gLayout2 = new GridLayout(4, false);
+ gLayout2.horizontalSpacing = 0;
+ scrollComposite.setLayout(gLayout2);
+ flagExpandComposite.setClient(scrollComposite);
+ return scrollComposite;
+ }
+
+ @Override
+ protected void okPressed() {
+ commentEditor.getControl().forceFocus();
+ super.okPressed();
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control control = super.createButtonBar(parent);
+ getOkButton().setText(Messages.BugzillaAttachmentDialog_OK_ButtonText);
+ getOkButton().setEnabled(changed);
+ return control;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
index 0040bff01..04a98330f 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
@@ -139,7 +139,7 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
} else if (IBugzillaConstants.EDITOR_TYPE_VOTES.equals(type)) {
editor = new BugzillaVotesEditor(getModel(), taskAttribute);
} else if (IBugzillaConstants.EDITOR_TYPE_FLAG.equals(type)) {
- editor = new FlagAttributeEditor(getModel(), taskAttribute);
+ editor = new FlagAttributeEditor(getModel(), taskAttribute, 78);
} else {
editor = super.createEditor(type, taskAttribute);
if (TaskAttribute.TYPE_BOOLEAN.equals(type)) {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/FlagAttributeEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/FlagAttributeEditor.java
index 9194663e3..241f59bf2 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/FlagAttributeEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/FlagAttributeEditor.java
@@ -20,8 +20,6 @@ import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.ColumnSpan;
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.RowSpan;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
@@ -41,17 +39,20 @@ public class FlagAttributeEditor extends AbstractAttributeEditor {
private Text requesteeText;
- public FlagAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
+ private final int requesteeTextHint;
+
+ public FlagAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute, int requesteeTextHint) {
super(manager, taskAttribute);
setLayoutHint(new LayoutHint(RowSpan.SINGLE, ColumnSpan.SINGLE));
if (taskAttribute.getAttribute("state") != null) { //$NON-NLS-1$
setReadOnly(taskAttribute.getAttribute("state").getMetaData().isReadOnly()); //$NON-NLS-1$
}
+ this.requesteeTextHint = requesteeTextHint;
}
@Override
public void createControl(Composite parent, FormToolkit toolkit) {
- Composite composite = toolkit.createComposite(parent);
+ final Composite composite = toolkit.createComposite(parent);
GridLayout layout = new GridLayout(3, false);
layout.marginWidth = 1;
composite.setLayout(layout);
@@ -60,10 +61,21 @@ public class FlagAttributeEditor extends AbstractAttributeEditor {
toolkit.adapt(text, false, false);
text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
text.setText(getValueLabel());
+ text.setBackground(parent.getBackground());
+ text.setEditable(false);
String tooltip = getTaskAttribute().getMetaData().getLabel();
if (tooltip != null) {
text.setToolTipText(tooltip);
}
+ TaskAttribute requestee = getTaskAttribute().getAttribute("requestee"); //$NON-NLS-1$
+ if (!"".equals(requestee.getValue())) { //$NON-NLS-1$
+ text = new Text(composite, SWT.FLAT | SWT.READ_ONLY);
+ toolkit.adapt(text, false, false);
+ text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
+ text.setText(requestee.getValue());
+ text.setBackground(parent.getBackground());
+ text.setEditable(false);
+ }
} else {
combo = new CCombo(composite, SWT.FLAT | SWT.READ_ONLY);
toolkit.adapt(combo, false, false);
@@ -106,17 +118,8 @@ public class FlagAttributeEditor extends AbstractAttributeEditor {
requesteeText = toolkit.createText(composite, requestee.getValue());
requesteeText.setEnabled("?".equals(getValueLabel())); //$NON-NLS-1$
GridData requesteeData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- requesteeData.widthHint = 78;
+ requesteeData.widthHint = requesteeTextHint;
requesteeText.setLayoutData(requesteeData);
- requesteeText.addFocusListener(new FocusListener() {
-
- public void focusGained(FocusEvent e) {
- }
-
- public void focusLost(FocusEvent e) {
- setRequestee(requesteeText.getText());
- }
- });
}
}
toolkit.paintBordersFor(composite);
@@ -149,8 +152,10 @@ public class FlagAttributeEditor extends AbstractAttributeEditor {
public void setRequestee(String value) {
TaskAttribute requestee = getTaskAttribute().getAttribute("requestee"); //$NON-NLS-1$
if (requestee != null) {
- getAttributeMapper().setValue(getTaskAttribute().getAttribute("requestee"), value); //$NON-NLS-1$
- attributeChanged();
+ if (!requestee.getValue().equals(value)) {
+ getAttributeMapper().setValue(requestee, value);
+ attributeChanged();
+ }
}
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
index 755394231..9aa73c0a0 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskAttachmentPage.java
@@ -160,7 +160,7 @@ public class BugzillaTaskAttachmentPage extends TaskAttachmentPage {
| ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
flagExpandComposite.setFont(container.getFont());
flagExpandComposite.setBackground(container.getBackground());
- flagExpandComposite.setText(Messages.BugzillaTaskAttachmentPage_flags);
+ flagExpandComposite.setText(Messages.BugzillaTaskAttachmentPage_Advanced);
flagExpandComposite.setLayout(new GridLayout(3, false));
GridData g = new GridData(GridData.FILL_HORIZONTAL);
g.horizontalSpan = 3;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java
index d21e2e8c5..e31a16418 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/Messages.java
@@ -79,5 +79,10 @@ public class Messages extends NLS {
public static String BugzillaRepositorySettingsPage_Validating_server_settings;
- public static String BugzillaTaskAttachmentPage_flags;
+ public static String BugzillaTaskAttachmentPage_Advanced;
+
+ public static String BugzillaAttachmentDialog_DetailTitle;
+
+ public static String BugzillaAttachmentDialog_OK_ButtonText;
+
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties
index d4bb37498..801f60e9a 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/messages.properties
@@ -38,4 +38,6 @@ BugzillaRepositorySettingsPage_Retrieving_repository_configuration=Retrieving re
BugzillaRepositorySettingsPage_Server_URL_is_invalid=Server URL is invalid.
BugzillaRepositorySettingsPage_supports_bugzilla_X=Supports Bugzilla {0}
BugzillaRepositorySettingsPage_Validating_server_settings=Validating server settings
-BugzillaTaskAttachmentPage_flags=Flags
+BugzillaTaskAttachmentPage_Advanced=Advanced
+BugzillaAttachmentDialog_DetailTitle=Attachment Details
+BugzillaAttachmentDialog_OK_ButtonText=Update

Back to the top