Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-07-10 08:46:28 -0400
committerGerrit Code Review @ Eclipse.org2016-07-16 01:41:13 -0400
commit17238aa949b32aba963b883ac52012193f3c74dc (patch)
tree878d4dcc3665ad0bb81c4490d46d0bebdf32e43c
parentf294b5f653716cb490ff9b24958eac097f130617 (diff)
downloadorg.eclipse.mylyn.tasks-17238aa949b32aba963b883ac52012193f3c74dc.tar.gz
org.eclipse.mylyn.tasks-17238aa949b32aba963b883ac52012193f3c74dc.tar.xz
org.eclipse.mylyn.tasks-17238aa949b32aba963b883ac52012193f3c74dc.zip
496268: Bugzilla connector uses LabelsAttributeEditor for add CC
Change-Id: I3f710f61fe0b17946d3244fd95634c54d2d88c84 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=496268
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch43
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch43
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java18
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/schema/taskdata.txt2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaPeoplePart.java14
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java47
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LabelsAttributeEditor.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java3
10 files changed, 65 insertions, 112 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch
deleted file mode 100644
index efba6e123..000000000
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (local).launch
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.mylyn.bugzilla.rest.core.tests"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.mylyn.bugzilla.rest.core.tests"/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 8 [1.8.0_74]"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -consolelog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.mylyn.bugzilla.rest.core.tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx256m&#10;-Dorg.eclipse.mylyn.tests.all=true"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.platform.ide"/>
-<booleanAttribute key="run_in_ui_thread" value="true"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="true"/>
-</launchConfiguration>
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch
deleted file mode 100644
index 87afb9f3d..000000000
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/config/Bugzilla REST Connector Tests (mylyn.org).launch
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.mylyn.bugzilla.rest.core.tests"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.mylyn.bugzilla.rest.core.tests"/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 8 [1.8.0_65]"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -consolelog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.mylyn.bugzilla.rest.core.tests"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx256m&#10;-Dorg.eclipse.mylyn.tests.all=true&#10;-Dorg.eclipse.mylyn.tests.ignore.local.services=true"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.platform.ide"/>
-<booleanAttribute key="run_in_ui_thread" value="true"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="true"/>
-</launchConfiguration>
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
index 5f4c16fa6..823d50ae2 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
@@ -110,7 +110,7 @@ public class BugzillaRestTaskSchema extends AbstractTaskSchema {
.dependsOn(COMPONENT.getKey())
.create();
- public final Field ADD_CC = createField("addCC", "Add CC", TaskAttribute.TYPE_PERSON, Flag.PEOPLE);
+ public final Field ADD_CC = createField("addCC", "Add CC", TaskAttribute.TYPE_MULTI_LABEL, Flag.PEOPLE);
public final Field CC = createField(TaskAttribute.USER_CC, "Remove CC\n(Selet to remove)",
IBugzillaRestConstants.EDITOR_TYPE_CC, Flag.PEOPLE);
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java
index 3c1ee6e49..44965ab39 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPeoplePart.java
@@ -16,11 +16,16 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
+import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestTaskSchema;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorPeoplePart;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.RowSpan;
+import org.eclipse.swt.SWT;
public class BugzillaRestTaskEditorPeoplePart extends TaskEditorPeoplePart {
@@ -78,4 +83,17 @@ public class BugzillaRestTaskEditorPeoplePart extends TaskEditorPeoplePart {
}
+ @Override
+ protected GridDataFactory createLayoutData(AbstractAttributeEditor editor) {
+ LayoutHint layoutHint = editor.getLayoutHint();
+ GridDataFactory gridDataFactory = GridDataFactory.fillDefaults().indent(3, 0);// prevent clipping of decorators on Mac
+ if (layoutHint != null && layoutHint.rowSpan == RowSpan.MULTIPLE) {
+ gridDataFactory.grab(true, true).align(SWT.FILL, SWT.FILL).hint(130, 95);
+ } else {
+ gridDataFactory.grab(true, false).align(SWT.FILL, SWT.TOP);
+
+ }
+ return gridDataFactory;
+ }
+
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java
index 9d7806f19..c9f39afa3 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java
@@ -115,7 +115,7 @@ public enum BugzillaAttribute {
LONGDESCLENGTH(Messages.BugzillaAttribute_Number_of_comments, "longdesclength", TaskAttribute.TYPE_SHORT_TEXT), //$NON-NLS-1$
- NEWCC(Messages.BugzillaAttribute_Add_CC, "newcc", TaskAttribute.TYPE_PERSON, Flag.PEOPLE), //$NON-NLS-1$
+ NEWCC(Messages.BugzillaAttribute_Add_CC, "newcc", TaskAttribute.TYPE_MULTI_LABEL, Flag.PEOPLE), //$NON-NLS-1$
OP_SYS(Messages.BugzillaAttribute_OS, "op_sys", TaskAttribute.TYPE_SINGLE_SELECT, Flag.ATTRIBUTE), //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/schema/taskdata.txt b/org.eclipse.mylyn.bugzilla.tests/testdata/schema/taskdata.txt
index a1b72ab96..f8b5f31f9 100644
--- a/org.eclipse.mylyn.bugzilla.tests/testdata/schema/taskdata.txt
+++ b/org.eclipse.mylyn.bugzilla.tests/testdata/schema/taskdata.txt
@@ -44,7 +44,7 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=keywords,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.type=bugzilla.editor.keywords}]
TaskAttribute[id=long_desc,values=[],options=null,metaData={task.meta.readOnly=true, task.meta.type=longRichText}]
TaskAttribute[id=longdesclength,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=shortText}]
- TaskAttribute[id=newcc,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.type=person}]
+ TaskAttribute[id=newcc,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.people, task.meta.type=multiLabel}]
TaskAttribute[id=op_sys,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.type=singleSelect}]
TaskAttribute[id=priority,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.type=singleSelect}]
TaskAttribute[id=product,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.type=singleSelect}]
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaPeoplePart.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaPeoplePart.java
index 5c7854404..b5462b33d 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaPeoplePart.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaPeoplePart.java
@@ -24,6 +24,8 @@ import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorPeoplePart;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
+import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.RowSpan;
import org.eclipse.swt.SWT;
/**
@@ -108,10 +110,14 @@ public class BugzillaPeoplePart extends TaskEditorPeoplePart {
@Override
protected GridDataFactory createLayoutData(AbstractAttributeEditor editor) {
- GridDataFactory dataFactory = super.createLayoutData(editor);
- if (editor.getTaskAttribute().getId().equals(BugzillaAttribute.CC.getKey())) {
- dataFactory.grab(true, true).align(SWT.FILL, SWT.FILL).hint(130, 95);
+ LayoutHint layoutHint = editor.getLayoutHint();
+ GridDataFactory gridDataFactory = GridDataFactory.fillDefaults().indent(3, 0);// prevent clipping of decorators on Mac
+ if (layoutHint != null && layoutHint.rowSpan == RowSpan.MULTIPLE) {
+ gridDataFactory.grab(true, true).align(SWT.FILL, SWT.FILL).hint(130, 95);
+ } else {
+ gridDataFactory.grab(true, false).align(SWT.FILL, SWT.TOP);
+
}
- return dataFactory;
+ return gridDataFactory;
}
}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java
index b32d46934..13a954923 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java
@@ -23,7 +23,7 @@ import org.eclipse.mylyn.internal.tasks.core.RepositoryPerson;
/**
* Encapsulates attributes for task data.
- *
+ *
* @author Rob Elves
* @author Steffen Pingel
* @author Miles Parker
@@ -113,7 +113,7 @@ public final class TaskAttribute {
/**
* A {@link TaskAttributeMetaData#getKind() kind} used to indicate that the field is related to a description.
- *
+ *
* @since 3.11
*/
public static final String KIND_DESCRIPTION = "task.common.kind.description"; //$NON-NLS-1$
@@ -139,7 +139,7 @@ public final class TaskAttribute {
* {@link TaskAttributeMapper#setDateValue(TaskAttribute, java.util.Date) setDateValue(TaskAttribute, Date)}
* respectively return and accept dates at midnight in the local time zone when the precision is
* {@link TimeUnit#DAYS} or coarser.
- *
+ *
* @since 3.18
* @see TaskAttributeMetaData#getPrecision()
* @see TaskAttributeMetaData#setPrecision()
@@ -154,7 +154,7 @@ public final class TaskAttribute {
* <br>
* Example: In Bugzilla we have COMPONENT, VERSION, TARGET_MILESTONE as depends on the PRODUCT. We can so update the
* options of the attributes to match the definition of the PRODUCT.
- *
+ *
* @see #BugzillaRestCreateTaskSchema
* @since 3.17
*/
@@ -162,11 +162,11 @@ public final class TaskAttribute {
/**
* A key for {@link TaskAttributeMetaData} that is used for specifying the media type of a
- * {@link #TYPE_LONG_RICH_TEXT} or {@link #TYPE_SHORT_RICH_TEXT}. The media type if specified must be a valid <a
- * href="http://en.wikipedia.org/wiki/Internet_media_type">Internet Media Type</a> (also known as Content-Type,
- * mime-type) according to <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a> and <a
- * href="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</a>.
- *
+ * {@link #TYPE_LONG_RICH_TEXT} or {@link #TYPE_SHORT_RICH_TEXT}. The media type if specified must be a valid
+ * <a href="http://en.wikipedia.org/wiki/Internet_media_type">Internet Media Type</a> (also known as Content-Type,
+ * mime-type) according to <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a> and
+ * <a href="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</a>.
+ *
* @see #TYPE_LONG_RICH_TEXT
* @see #TYPE_SHORT_RICH_TEXT
* @see #META_ATTRIBUTE_TYPE
@@ -186,7 +186,7 @@ public final class TaskAttribute {
* Key for {@link TaskAttributeMetaData} used to specify that a field requires a value before it can be submitted to
* the server. This meta-data is used by the framework as a UI hint and does not guarantee that a connector will
* enforce compliance before attempting to post task data.
- *
+ *
* @since 3.11
*/
public static final String META_REQUIRED = "task.meta.required"; //$NON-NLS-1$
@@ -199,7 +199,7 @@ public final class TaskAttribute {
/**
* Key for the meta datum that determines if an attribute is disabled. This is used to indicate that an attribute
* should not be modified, e.g. due to work-flow state but it may still be generally writeable.
- *
+ *
* @since 3.5
* @see TaskAttributeMetaData#isDisabled()
*/
@@ -207,7 +207,7 @@ public final class TaskAttribute {
/**
* Key for the meta datum that provides a description of an attribute, e.g. for display in a tooltip.
- *
+ *
* @since 3.5
* @see TaskAttributeMetaData
*/
@@ -218,7 +218,7 @@ public final class TaskAttribute {
* content. Provides a way for connectors to specify non-standard attributes as plain-text indexable. By default,
* {@link #SUMMARY summary} and {@link #DESCRIPTION description} are indexed. Note that setting this meta-data is
* advisory only and will not guarantee that content is indexed.
- *
+ *
* @since 3.7
*/
public static final String META_INDEXED_AS_CONTENT = "task.meta.index.content"; //$NON-NLS-1$
@@ -235,7 +235,7 @@ public final class TaskAttribute {
/**
* Key for {@link RepositoryPerson} used to store the human-readable username used to log into the repository, if it
* is different than the ID used to identify the person in {@link TaskData}.
- *
+ *
* @since 3.18
*/
public static final String PERSON_USERNAME = "task.common.person.username"; //$NON-NLS-1$
@@ -364,6 +364,16 @@ public final class TaskAttribute {
*/
public static final String TYPE_DOUBLE = "double"; //$NON-NLS-1$
+ /**
+ * @since 3.21
+ */
+ public static final String TYPE_LABEL = "label"; //$NON-NLS-1$
+
+ /**
+ * @since 3.21
+ */
+ public static final String TYPE_MULTI_LABEL = "multiLabel"; //$NON-NLS-1$
+
public static final String USER_ASSIGNED = "task.common.user.assigned"; //$NON-NLS-1$
@Deprecated
@@ -513,8 +523,9 @@ public final class TaskAttribute {
public TaskAttribute getMappedAttribute(String attributeId) {
Assert.isNotNull(attributeId);
- return (attributeById != null) ? attributeById.get(getTaskData().getAttributeMapper().mapToRepositoryKey(this,
- attributeId)) : null;
+ return (attributeById != null)
+ ? attributeById.get(getTaskData().getAttributeMapper().mapToRepositoryKey(this, attributeId))
+ : null;
}
public TaskAttribute getMappedAttribute(String[] path) {
@@ -597,7 +608,7 @@ public final class TaskAttribute {
* testing whether or not {@link #getValue()} returns an empty string, as it is possible that an empty string value
* has been explicitly set for the attribute. Call {@link #clearValues()} to return the attribute to the unset
* state.
- *
+ *
* @return true if any value is set (may be an empty string), false if no value is set.
* @since 3.9
*/
@@ -624,7 +635,7 @@ public final class TaskAttribute {
/**
* Adds an attribute option value
- *
+ *
* @param key
* The option value used when sending the form to the server
* @param value
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LabelsAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LabelsAttributeEditor.java
index d1a58c17a..70527e667 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LabelsAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LabelsAttributeEditor.java
@@ -37,7 +37,8 @@ public class LabelsAttributeEditor extends TextAttributeEditor {
public LabelsAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
super(manager, taskAttribute);
- this.isMultiSelect = TaskAttribute.TYPE_MULTI_SELECT.equals(taskAttribute.getMetaData().getType());
+ this.isMultiSelect = TaskAttribute.TYPE_MULTI_SELECT.equals(taskAttribute.getMetaData().getType())
+ || TaskAttribute.TYPE_MULTI_LABEL.equals(taskAttribute.getMetaData().getType());
if (!isReadOnly() && isMultiSelect) {
setLayoutHint(new LayoutHint(RowSpan.MULTIPLE, ColumnSpan.SINGLE));
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java
index b47100d48..2a89ab432 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorFactory.java
@@ -18,6 +18,7 @@ import org.eclipse.mylyn.internal.tasks.ui.editors.BooleanAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.DateAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.DoubleAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.IntegerAttributeEditor;
+import org.eclipse.mylyn.internal.tasks.ui.editors.LabelsAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.LastCommentedAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.LongAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.LongTextAttributeEditor;
@@ -159,6 +160,8 @@ public class AttributeEditorFactory {
return new IntegerAttributeEditor(model, taskAttribute);
} else if (TaskAttribute.TYPE_LONG.equals(type)) {
return new LongAttributeEditor(model, taskAttribute);
+ } else if (TaskAttribute.TYPE_LABEL.equals(type) || TaskAttribute.TYPE_MULTI_LABEL.equals(type)) {
+ return new LabelsAttributeEditor(model, taskAttribute);
}
throw new IllegalArgumentException("Unsupported editor type: \"" + type + "\""); //$NON-NLS-1$ //$NON-NLS-2$

Back to the top