diff options
author | Leo Dos Santos | 2014-01-15 01:56:27 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2014-02-12 01:27:20 +0000 |
commit | ff4c0c3bb2acad4dd614680a7228aa4c3f3ab025 (patch) | |
tree | 638e3592d8e16fecc09365283f8fe9a082007e32 /org.eclipse.mylyn.tasks.tests/src/org | |
parent | b8fcbca33a9b308885ffb1f8ff7f2b137907758e (diff) | |
download | org.eclipse.mylyn.tasks-ff4c0c3bb2acad4dd614680a7228aa4c3f3ab025.tar.gz org.eclipse.mylyn.tasks-ff4c0c3bb2acad4dd614680a7228aa4c3f3ab025.tar.xz org.eclipse.mylyn.tasks-ff4c0c3bb2acad4dd614680a7228aa4c3f3ab025.zip |
378032: fix for boolean attribute editors that show required decorator
Change-Id: Ie343ba26b972fe1327d2fce0e57ab07e78184de9
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=378032
Signed-off-by: Leo Dos Santos <leo.dos.santos@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests/src/org')
-rw-r--r-- | org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java index d328f79b9..17e46b94b 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/AttributeEditorTest.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.mylyn.commons.workbench.WorkbenchUtil; import org.eclipse.mylyn.internal.tasks.core.data.TaskDataState; import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; +import org.eclipse.mylyn.internal.tasks.ui.editors.BooleanAttributeEditor; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.core.data.TaskAttribute; import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; @@ -70,6 +71,19 @@ public class AttributeEditorTest extends TestCase { } } + private class MockBooleanAttributeEditor extends BooleanAttributeEditor { + + public MockBooleanAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) { + super(manager, taskAttribute); + } + + @Override + public boolean needsValue() { + return super.needsValue(); + } + + } + private TaskRepository repository; private TaskData taskData; @@ -197,6 +211,15 @@ public class AttributeEditorTest extends TestCase { manager.attributeChanged(attribute); } + public void testBooleanAttribute() throws Exception { + TaskAttribute attribute = new TaskAttribute(taskData.getRoot(), "a.required.boolean"); + attribute.getMetaData().setType(TaskAttribute.TYPE_BOOLEAN); + attribute.getMetaData().setRequired(true); + + MockBooleanAttributeEditor editor = new MockBooleanAttributeEditor(manager, attribute); + assertFalse(editor.needsValue()); + } + private TaskDataModel createManager() throws Exception { MockTask task = new MockTask("taskId"); TaskDataState state = new TaskDataState("kind", "url", "taskId"); |