Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-07-24 14:47:09 -0400
committerSam Davis2016-07-25 16:42:16 -0400
commitacb48310b78598fc0f37ac3bf1b262bc0ee7feb5 (patch)
treeafa8f3baca6c1f2a6d984d011ac6bebfc1ea6903 /org.eclipse.mylyn.tasks.ui.tests
parent7e5534c82054fc763ae7fd51c8d4b5ed5466fe8e (diff)
downloadorg.eclipse.mylyn.tasks-acb48310b78598fc0f37ac3bf1b262bc0ee7feb5.tar.gz
org.eclipse.mylyn.tasks-acb48310b78598fc0f37ac3bf1b262bc0ee7feb5.tar.xz
org.eclipse.mylyn.tasks-acb48310b78598fc0f37ac3bf1b262bc0ee7feb5.zip
498401: fix ContentAssist for "Add CC:"
Change-Id: I6ba24b3272b4015c6976d102d7ef6b107f54c2b2 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=498401
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui.tests')
-rw-r--r--org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkitTest.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkitTest.java b/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkitTest.java
index 1ff7ac11b..44b0183f6 100644
--- a/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkitTest.java
+++ b/org.eclipse.mylyn.tasks.ui.tests/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkitTest.java
@@ -26,6 +26,7 @@ import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.commons.workbench.editors.CommonTextSupport;
import org.eclipse.mylyn.internal.tasks.ui.OptionsProposalProvider;
+import org.eclipse.mylyn.internal.tasks.ui.PersonProposalProvider;
import org.eclipse.mylyn.internal.tasks.ui.editors.LabelsAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.MultiSelectionAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.SingleSelectionAttributeEditor;
@@ -109,23 +110,30 @@ public class AttributeEditorToolkitTest {
@Test
public void testAdaptLabelsAttributeEditor() {
- assertOptionsProposalProvider(true);
- assertOptionsProposalProvider(false);
+ assertOptionsProposalProvider(true, false);
+ assertOptionsProposalProvider(false, false);
+ assertOptionsProposalProvider(true, true);
}
- private void assertOptionsProposalProvider(boolean isMultiSelect) {
- taskAttribute.getMetaData().setType(
- isMultiSelect ? TaskAttribute.TYPE_MULTI_SELECT : TaskAttribute.TYPE_SINGLE_SELECT);
+ private void assertOptionsProposalProvider(boolean isMultiSelect, boolean isPerson) {
+ taskAttribute.getMetaData().setKind(isPerson ? TaskAttribute.KIND_PEOPLE : TaskAttribute.KIND_DEFAULT);
+ taskAttribute.getMetaData()
+ .setType(isMultiSelect ? TaskAttribute.TYPE_MULTI_SELECT : TaskAttribute.TYPE_SINGLE_SELECT);
LabelsAttributeEditor editor = new LabelsAttributeEditor(taskDataModel, taskAttribute);
editor.createControl(WorkbenchUtil.getShell(), formToolkit);
toolkit.adapt(editor);
verify(toolkit).createContentProposalProvider(editor);
- ArgumentCaptor<IContentProposalProvider> providerCaptor = ArgumentCaptor.forClass(IContentProposalProvider.class);
+ ArgumentCaptor<IContentProposalProvider> providerCaptor = ArgumentCaptor
+ .forClass(IContentProposalProvider.class);
verify(toolkit).createContentAssistCommandAdapter(eq(editor.getControl()), providerCaptor.capture());
IContentProposalProvider proposalProvider = providerCaptor.getValue();
- assertTrue(proposalProvider instanceof OptionsProposalProvider);
- assertEquals(isMultiSelect, ((OptionsProposalProvider) proposalProvider).isMultiSelect());
+ if (isPerson) {
+ assertTrue(proposalProvider instanceof PersonProposalProvider);
+ } else {
+ assertTrue(proposalProvider instanceof OptionsProposalProvider);
+ assertEquals(isMultiSelect, ((OptionsProposalProvider) proposalProvider).isMultiSelect());
+ }
assertNull(toolkit.commandAdapter.getAutoActivationCharacters());
}

Back to the top