diff options
author | fbecker | 2009-07-06 19:53:59 +0000 |
---|---|---|
committer | fbecker | 2009-07-06 19:53:59 +0000 |
commit | 2f7da9704cc37e93c2af1f4b7eae62cdaa3e98aa (patch) | |
tree | 48ede420158b937b1eace228d17ed4172664de0b /org.eclipse.mylyn.bugzilla.core | |
parent | 95190d6d22159b3c3643f2b1476937059a5e274a (diff) | |
download | org.eclipse.mylyn.tasks-2f7da9704cc37e93c2af1f4b7eae62cdaa3e98aa.tar.gz org.eclipse.mylyn.tasks-2f7da9704cc37e93c2af1f4b7eae62cdaa3e98aa.tar.xz org.eclipse.mylyn.tasks-2f7da9704cc37e93c2af1f4b7eae62cdaa3e98aa.zip |
ASSIGNED - bug 279357: [patch] add custom fields in New Task Editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=279357
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java index ccc99c28d..969424a2c 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java @@ -565,6 +565,47 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler { attrAddSelfToCc.getMetaData().setKind(null); } + List<BugzillaCustomField> customFields = new ArrayList<BugzillaCustomField>(); + if (repositoryConfiguration != null) { + customFields = repositoryConfiguration.getCustomFields(); + } + for (BugzillaCustomField bugzillaCustomField : customFields) { + if (bugzillaCustomField.isEnterBug()) { + TaskAttribute attribute = taskData.getRoot().createAttribute(bugzillaCustomField.getName()); + if (attribute != null) { + attribute.getMetaData().defaults().setLabel(bugzillaCustomField.getDescription()); + attribute.getMetaData().setKind(TaskAttribute.KIND_DEFAULT); + + switch (bugzillaCustomField.getType()) { + case 1: // Free Text + attribute.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT); + break; + case 2: // Drop Down + attribute.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT); + break; + case 3: // Multiple-Selection Box + attribute.getMetaData().setType(TaskAttribute.TYPE_MULTI_SELECT); + break; + case 4: // Large Text Box + attribute.getMetaData().setType(TaskAttribute.TYPE_LONG_TEXT); + break; + case 5: // Date/Time + attribute.getMetaData().setType(TaskAttribute.TYPE_DATETIME); + break; + + default: + List<String> options = bugzillaCustomField.getOptions(); + if (options.size() > 0) { + attribute.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT); + } else { + attribute.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT); + } + } + attribute.getMetaData().setReadOnly(false); + } + } + } + return true; } |