Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Green2012-02-08 22:37:34 +0000
committerDavid Green2012-02-08 22:37:34 +0000
commitcfcb5a504b3a6422cf53c8a8a4d46615e1af9a6d (patch)
tree92d2376a16fe372b2fbe470b4bc05e87e982aefe
parent829aa2877b332f9547a816e91b3fdf899304b497 (diff)
parent4e6761cb77b94173165f8e1a3d3766e354982e3a (diff)
downloadorg.eclipse.mylyn.tasks-cfcb5a504b3a6422cf53c8a8a4d46615e1af9a6d.tar.gz
org.eclipse.mylyn.tasks-cfcb5a504b3a6422cf53c8a8a4d46615e1af9a6d.tar.xz
org.eclipse.mylyn.tasks-cfcb5a504b3a6422cf53c8a8a4d46615e1af9a6d.zip
191522: provide full text search functionality over task comments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=191522 Change-Id: I93be38a91d657ea1df488dd56cad43c4c5505e3e
-rw-r--r--org.eclipse.mylyn-feature/feature.properties2
-rw-r--r--org.eclipse.mylyn.bugzilla-feature/feature.properties2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java3
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java3
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java46
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java61
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java14
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.8/Custom_Workflow_and_StatusTransition.txt (renamed from org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.6/Custom_Workflow_and_StatusTransition.txt)0
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaPeoplePart.java1
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java35
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java206
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java40
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties24
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java1
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties3
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java1
-rw-r--r--org.eclipse.mylyn.sdk-feature/feature.properties2
-rw-r--r--org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectSupportElementPage.java1
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties1
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java3
-rw-r--r--org.eclipse.mylyn.tasks.index-feature/.cvsignore2
-rw-r--r--org.eclipse.mylyn.tasks.index-feature/feature.properties2
-rw-r--r--org.eclipse.mylyn.tasks.index-feature/pom.xml4
-rw-r--r--org.eclipse.mylyn.tasks.index.core/pom.xml4
-rw-r--r--org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java2
-rw-r--r--org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TasksIndexCore.java2
-rw-r--r--org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/messages.properties2
-rw-r--r--org.eclipse.mylyn.tasks.index.tests/pom.xml4
-rw-r--r--org.eclipse.mylyn.tasks.index.ui/pom.xml4
-rw-r--r--org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java2
-rw-r--r--org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexedSubstringPatternFilter.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java5
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java15
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/RegionComparatorTest.java67
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/TaskUrlHyperlinkDetectorTest.java18
-rw-r--r--org.eclipse.mylyn.tasks.ui/.settings/.api_filters9
-rw-r--r--org.eclipse.mylyn.tasks.ui/plugin.xml7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/messages.properties1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java43
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskUrlHandler.java63
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/Messages.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/messages.properties2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextAttachWizard.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizard.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizardPage.java1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractHyperlinkTextPresentationManager.java9
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractTaskEditorAttributeSection.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BrowserPreviewViewer.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PersonAttributeEditor.java15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart.java11
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotification.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotificationReminder.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard.java18
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java25
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java21
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkit.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage2.java2
-rw-r--r--org.eclipse.mylyn.test-feature/feature.properties2
-rw-r--r--org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java8
-rw-r--r--org.eclipse.mylyn.trac-feature/feature.properties2
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskMapper.java12
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/AbstractTracClient.java16
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java6
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracTicketAttribute.java34
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java26
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryQueryTest.java2
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java2
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java8
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties4
83 files changed, 729 insertions, 267 deletions
diff --git a/org.eclipse.mylyn-feature/feature.properties b/org.eclipse.mylyn-feature/feature.properties
index 4007e3a12..a97a67b48 100644
--- a/org.eclipse.mylyn-feature/feature.properties
+++ b/org.eclipse.mylyn-feature/feature.properties
@@ -11,7 +11,7 @@
featureName=Mylyn Task List
description=Provides the Task List for task and time management.
providerName=Eclipse Mylyn
-copyright=Copyright (c) 2004, 2011 Tasktop Technologies and others. All rights reserved.
+copyright=Copyright (c) 2004, 2012 Tasktop Technologies and others. All rights reserved.
discovery_Mylyn_Extras=Mylyn Extras
discovery_Mylyn=Mylyn
diff --git a/org.eclipse.mylyn.bugzilla-feature/feature.properties b/org.eclipse.mylyn.bugzilla-feature/feature.properties
index 56873d25a..654a99a45 100644
--- a/org.eclipse.mylyn.bugzilla-feature/feature.properties
+++ b/org.eclipse.mylyn.bugzilla-feature/feature.properties
@@ -11,7 +11,7 @@
featureName=Mylyn Tasks Connector: Bugzilla
description=Provides Task List integration, offline support and rich editing for the open source Bugzilla bug tracker.
providerName=Eclipse Mylyn
-copyright=Copyright (c) 2004, 2011 Tasktop Technologies and others. All rights reserved.
+copyright=Copyright (c) 2004, 2012 Tasktop Technologies and others. All rights reserved.
license=\
Eclipse Foundation Software User Agreement\n\
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 08c5a4c97..200d3cc70 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
@@ -596,7 +596,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
for (String option : optionValues) {
attributeTargetMilestone.putOption(option, option);
}
- if (repositoryConfiguration != null && product != null && !product.equals("")) { //$NON-NLS-1$
+ if (product != null && !product.equals("")) { //$NON-NLS-1$
String defaultMilestone = repositoryConfiguration.getDefaultMilestones(product);
if (defaultMilestone != null) {
attributeTargetMilestone.setValue(defaultMilestone);
@@ -737,7 +737,6 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
}
}
}
-
return true;
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java
index e35eb2dde..0e7a49511 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaUserMatchResponse.java
@@ -94,6 +94,7 @@ public class BugzillaUserMatchResponse {
&& divClass.equals("user_match")) { //$NON-NLS-1$
value = ((HtmlTag) (token.getValue())).getAttribute("value"); //$NON-NLS-1$
name = ((HtmlTag) (token.getValue())).getAttribute("name"); //$NON-NLS-1$
+ value = value.replace("@", "@"); //$NON-NLS-1$ //$NON-NLS-2$
if (name.equals("newcc")) { //$NON-NLS-1$
newCCProposals.add(value);
} else if (name.equals("assigned_to")) { //$NON-NLS-1$
@@ -110,6 +111,7 @@ public class BugzillaUserMatchResponse {
&& !((HtmlTag) (token.getValue())).isEndTag() && divClass != null
&& divClass.equals("user_match")) { //$NON-NLS-1$
value = ((HtmlTag) (token.getValue())).getAttribute("value"); //$NON-NLS-1$
+ value = value.replace("@", "@"); //$NON-NLS-1$ //$NON-NLS-2$
if (name.equals("newcc")) { //$NON-NLS-1$
newCCProposals.add(value);
} else if (name.equals("assigned_to")) { //$NON-NLS-1$
@@ -257,6 +259,7 @@ public class BugzillaUserMatchResponse {
int endText = divString.indexOf("<", startText + 1); //$NON-NLS-1$
String temp = divString.substring(startText, endText);
value = divString.substring(5, start) + temp;
+ value = value.replace("&#64;", "@"); //$NON-NLS-1$ //$NON-NLS-2$
if (lastDTValue.equals("newcc")) { //$NON-NLS-1$
newCCMsg = value;
} else if (lastDTValue.equals("assigned_to")) { //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
index 240040dc5..712eb626f 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
@@ -501,6 +501,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
}).execute();
}
+ @SuppressWarnings("unchecked")
private HashMap<String, HashMap<String, Object[]>> response2HashMapHashMap(HashMap<?, ?> response, String name)
throws XmlRpcException {
HashMap<String, HashMap<String, Object[]>> result;
@@ -516,6 +517,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
return result;
}
+ @SuppressWarnings("unchecked")
private HashMap<String, Object[]> response2HashMap(HashMap<?, ?> response, String name) throws XmlRpcException {
HashMap<String, Object[]> result;
if (response == null) {
@@ -724,6 +726,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
}
}
+ @SuppressWarnings("unchecked")
private void updateTaskDataFromMap(final TaskAttributeMapper mapper, List<BugzillaCustomField> customFields,
Map<?, ?> taskDataResultMap, TaskData taskData) {
for (String attrib : (Set<String>) taskDataResultMap.keySet()) {
@@ -823,20 +826,22 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
Object[] attachments) {
if (attachments != null) {
for (Object attachmentTemp : attachments) {
+ // We have the following information which are not used:
+ // (Date) attachment.get("last_change_time");
+ // (Integer) attachment.get("bug_id");
+ // (Integer) attachment.get("is_private");
+ // (Integer) attachment.get("is_url");
+
HashMap<?, ?> attachment = (HashMap<?, ?>) attachmentTemp;
- Date creation_time = (Date) attachment.get("creation_time");
- Date last_change_time = (Date) attachment.get("last_change_time");
- Integer id = (Integer) attachment.get("id");
- Integer bug_id = (Integer) attachment.get("bug_id");
- String file_name = (String) attachment.get("file_name");
- String summary = (String) attachment.get("summary");
- String content_type = (String) attachment.get("content_type");
-
- Integer is_private = (Integer) attachment.get("is_private");
- Integer is_obsolete = (Integer) attachment.get("is_obsolete");
- Integer is_url = (Integer) attachment.get("is_url");
- Integer is_patch = (Integer) attachment.get("is_patch");
- String creator = (String) attachment.get("creator");
+ Date creation_time = (Date) attachment.get("creation_time"); //$NON-NLS-1$
+ Integer id = (Integer) attachment.get("id"); //$NON-NLS-1$
+ String file_name = (String) attachment.get("file_name"); //$NON-NLS-1$
+ String summary = (String) attachment.get("summary"); //$NON-NLS-1$
+ String content_type = (String) attachment.get("content_type"); //$NON-NLS-1$
+
+ Integer is_obsolete = (Integer) attachment.get("is_obsolete"); //$NON-NLS-1$
+ Integer is_patch = (Integer) attachment.get("is_patch"); //$NON-NLS-1$
+ String creator = (String) attachment.get("creator"); //$NON-NLS-1$
TaskAttribute attachmentAttribute = taskData.getRoot().createAttribute(
TaskAttribute.PREFIX_ATTACHMENT + id);
BugzillaAttachmentMapper attachmentMapper = BugzillaAttachmentMapper.createFrom(attachmentAttribute);
@@ -847,15 +852,12 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
// attachmentMapper.setComment(summary);
attachmentMapper.setContentType(content_type);
attachmentMapper.setCreationDate(creation_time);
- attachmentMapper.setDeprecated(is_obsolete.equals("1"));
+ attachmentMapper.setDeprecated(is_obsolete.equals("1")); //$NON-NLS-1$
attachmentMapper.setDescription(summary);
attachmentMapper.setFileName(file_name);
attachmentMapper.setLength(-1L);
- attachmentMapper.setPatch(is_patch.equals("1"));
+ attachmentMapper.setPatch(is_patch.equals("1")); //$NON-NLS-1$
attachmentMapper.applyTo(attachmentAttribute);
- int z = 9;
- z++;
-
}
}
}
@@ -867,6 +869,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
if (commentArray != null) {
int commentNum = 0;
for (Object object2 : commentArray) {
+ @SuppressWarnings("unchecked")
HashMap<String, Object> commentHash = (HashMap<String, Object>) object2;
String text = (String) commentHash.get("text"); //$NON-NLS-1$
if (commentNum == 0) {
@@ -881,6 +884,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
Date time = (Date) commentHash.get("time"); //$NON-NLS-1$
String creator = (String) commentHash.get("creator"); //$NON-NLS-1$
Boolean is_private = (Boolean) commentHash.get("is_private"); //$NON-NLS-1$
+ @SuppressWarnings("unused")
Integer attachment_id = (Integer) commentHash.get("attachment_id"); //$NON-NLS-1$
taskComment.setCommentId(commentID.toString());
@@ -980,17 +984,11 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
if (object instanceof String || object instanceof Boolean || object instanceof Integer
|| object instanceof Date) {
attribute.addValue(getValueStringFromObject(object, true));
- } else {
- int ii1 = 9;
- ii1++;
}
}
}
return attribute;
- } else {
- int ii1 = 9;
- ii1++;
}
return null;
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
index 3251cda7b..439cb45f6 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java
@@ -15,6 +15,7 @@ import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
@@ -1192,8 +1193,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
public void testErrorMatchFailedToShort() throws Exception {
try {
doUserMatch("st", null);
+ fail("CoreException expected but not found");
} catch (CoreException e) {
- assertNotNull(e.getStatus());
assertEquals(BugzillaStatus.ERROR_MATCH_FAILED, e.getStatus().getCode());
BugzillaStatus status = (BugzillaStatus) e.getStatus();
assertNotNull(status);
@@ -1220,8 +1221,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
public void testErrorMatchConfirmMatch() throws Exception {
try {
doUserMatch("est", null);
+ fail("CoreException expected but not found");
} catch (CoreException e) {
- assertNotNull(e.getStatus());
if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_6) < 0) {
assertEquals(BugzillaStatus.ERROR_MATCH_FAILED, e.getStatus().getCode());
BugzillaStatus status = (BugzillaStatus) e.getStatus();
@@ -1231,9 +1232,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getNewCCProposals());
assertNotNull(matchUserResponse.getAssignedToProposals());
assertNotNull(matchUserResponse.getQaContactProposals());
- assertEquals(0, matchUserResponse.getNewCCProposals().size());
- assertEquals(0, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getNewCCProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getAssignedToProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertNotNull(matchUserResponse.getNewCCMsg());
assertNull(matchUserResponse.getAssignedToMsg());
assertNull(matchUserResponse.getQaContactMsg());
@@ -1248,8 +1249,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getAssignedToProposals());
assertNotNull(matchUserResponse.getQaContactProposals());
assertEquals(2, matchUserResponse.getNewCCProposals().size());
- assertEquals(0, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getAssignedToProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertTrue(matchUserResponse.getNewCCProposals().contains("tests@mylyn.eclipse.org"));
assertTrue(matchUserResponse.getNewCCProposals().contains("guest@mylyn.eclipse.org"));
assertNull(matchUserResponse.getNewCCMsg());
@@ -1262,8 +1263,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
public void testErrorMatchConfirmMatch2() throws Exception {
try {
doUserMatch(null, "est");
+ fail("CoreException expected but not found");
} catch (CoreException e) {
- assertNotNull(e.getStatus());
if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_6) < 0) {
assertEquals(BugzillaStatus.ERROR_MATCH_FAILED, e.getStatus().getCode());
BugzillaStatus status = (BugzillaStatus) e.getStatus();
@@ -1273,9 +1274,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getNewCCProposals());
assertNotNull(matchUserResponse.getAssignedToProposals());
assertNotNull(matchUserResponse.getQaContactProposals());
- assertEquals(0, matchUserResponse.getNewCCProposals().size());
- assertEquals(0, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getNewCCProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getAssignedToProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertNull(matchUserResponse.getNewCCMsg());
assertNotNull(matchUserResponse.getAssignedToMsg());
assertNull(matchUserResponse.getQaContactMsg());
@@ -1289,9 +1290,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getNewCCProposals());
assertNotNull(matchUserResponse.getAssignedToProposals());
assertNotNull(matchUserResponse.getQaContactProposals());
- assertEquals(0, matchUserResponse.getNewCCProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getNewCCProposals());
assertEquals(2, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertTrue(matchUserResponse.getAssignedToProposals().contains("tests@mylyn.eclipse.org"));
assertTrue(matchUserResponse.getAssignedToProposals().contains("guest@mylyn.eclipse.org"));
assertNull(matchUserResponse.getNewCCMsg());
@@ -1304,8 +1305,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
public void testErrorMatchConfirmMatch3() throws Exception {
try {
doUserMatch("test", "est");
+ fail("CoreException expected but not found");
} catch (CoreException e) {
- assertNotNull(e.getStatus());
if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_6) < 0) {
assertEquals(BugzillaStatus.ERROR_MATCH_FAILED, e.getStatus().getCode());
BugzillaStatus status = (BugzillaStatus) e.getStatus();
@@ -1315,9 +1316,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getNewCCProposals());
assertNotNull(matchUserResponse.getAssignedToProposals());
assertNotNull(matchUserResponse.getQaContactProposals());
- assertEquals(0, matchUserResponse.getNewCCProposals().size());
- assertEquals(0, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getNewCCProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getAssignedToProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertNotNull(matchUserResponse.getNewCCMsg());
assertNotNull(matchUserResponse.getAssignedToMsg());
assertNull(matchUserResponse.getQaContactMsg());
@@ -1334,7 +1335,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getQaContactProposals());
assertEquals(1, matchUserResponse.getNewCCProposals().size());
assertEquals(2, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertTrue(matchUserResponse.getNewCCProposals().contains("tests@mylyn.eclipse.org"));
assertTrue(matchUserResponse.getAssignedToProposals().contains("tests@mylyn.eclipse.org"));
assertTrue(matchUserResponse.getAssignedToProposals().contains("guest@mylyn.eclipse.org"));
@@ -1347,9 +1348,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
public void testErrorMatchFailed() throws Exception {
try {
- doUserMatch("teste", null);
+ doUserMatch("tests1@mylyn.eclipse.org", null);
+ fail("CoreException expected but not found");
} catch (CoreException e) {
- assertNotNull(e.getStatus());
assertEquals(BugzillaStatus.ERROR_MATCH_FAILED, e.getStatus().getCode());
BugzillaStatus status = (BugzillaStatus) e.getStatus();
assertNotNull(status);
@@ -1358,21 +1359,21 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getNewCCProposals());
assertNotNull(matchUserResponse.getAssignedToProposals());
assertNotNull(matchUserResponse.getQaContactProposals());
- assertEquals(0, matchUserResponse.getNewCCProposals().size());
- assertEquals(0, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getNewCCProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getAssignedToProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertNotNull(matchUserResponse.getNewCCMsg());
assertNull(matchUserResponse.getAssignedToMsg());
assertNull(matchUserResponse.getQaContactMsg());
- assertTrue(matchUserResponse.getNewCCMsg().equals("teste did not match anything "));
+ assertTrue(matchUserResponse.getNewCCMsg().equals("tests1@mylyn.eclipse.org did not match anything "));
}
}
public void testErrorMatchFailed2() throws Exception {
try {
doUserMatch("est", "test1");
+ fail("CoreException expected but not found");
} catch (CoreException e) {
- assertNotNull(e.getStatus());
if (BugzillaFixture.current().getBugzillaVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_6) < 0) {
assertEquals(BugzillaStatus.ERROR_MATCH_FAILED, e.getStatus().getCode());
BugzillaStatus status = (BugzillaStatus) e.getStatus();
@@ -1382,9 +1383,9 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getNewCCProposals());
assertNotNull(matchUserResponse.getAssignedToProposals());
assertNotNull(matchUserResponse.getQaContactProposals());
- assertEquals(0, matchUserResponse.getNewCCProposals().size());
- assertEquals(0, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getNewCCProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getAssignedToProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertNotNull(matchUserResponse.getNewCCMsg());
assertNotNull(matchUserResponse.getAssignedToMsg());
assertNull(matchUserResponse.getQaContactMsg());
@@ -1400,8 +1401,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest {
assertNotNull(matchUserResponse.getAssignedToProposals());
assertNotNull(matchUserResponse.getQaContactProposals());
assertEquals(2, matchUserResponse.getNewCCProposals().size());
- assertEquals(0, matchUserResponse.getAssignedToProposals().size());
- assertEquals(0, matchUserResponse.getQaContactProposals().size());
+ assertEquals(Collections.emptyList(), matchUserResponse.getAssignedToProposals());
+ assertEquals(Collections.emptyList(), matchUserResponse.getQaContactProposals());
assertTrue(matchUserResponse.getNewCCProposals().contains("tests@mylyn.eclipse.org"));
assertTrue(matchUserResponse.getNewCCProposals().contains("guest@mylyn.eclipse.org"));
assertNull(matchUserResponse.getNewCCMsg());
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
index d5e66e80a..860eb7f17 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
@@ -77,25 +77,25 @@ public class BugzillaFixture extends TestFixture {
*/
@Deprecated
public static BugzillaFixture BUGS_3_4 = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_34_URL, //
- "3.4.13", "");
+ "3.4.14", "");
public static BugzillaFixture BUGS_3_6 = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_36_URL, //
- "3.6.7", "");
+ "3.6.8", "");
public static BugzillaFixture BUGS_3_6_CUSTOM_WF = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_36_URL
- + "-custom-wf", "3.6.7", CUSTOM_WF);
+ + "-custom-wf", "3.6.8", CUSTOM_WF);
public static BugzillaFixture BUGS_3_6_CUSTOM_WF_AND_STATUS = new BugzillaFixture(
- BugzillaFixture.TEST_BUGZILLA_36_URL + "-custom-wf-and-status", "3.6.7", CUSTOM_WF_AND_STATUS);
+ BugzillaFixture.TEST_BUGZILLA_36_URL + "-custom-wf-and-status", "3.6.8", CUSTOM_WF_AND_STATUS);
public static BugzillaFixture BUGS_3_6_XML_RPC_DISABLED = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_36_URL
- + "-xml-rpc-disabled", "3.6.7", XML_RPC_DISABLED);
+ + "-xml-rpc-disabled", "3.6.8", XML_RPC_DISABLED);
public static BugzillaFixture BUGS_4_0 = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_40_URL, //
- "4.0.3", "");
+ "4.0.4", "");
public static BugzillaFixture BUGS_4_2 = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_42_URL, //
- "4.2RC1+", "");
+ "4.2RC2+", "");
public static BugzillaFixture BUGS_HEAD = new BugzillaFixture(BugzillaFixture.TEST_BUGZILLA_HEAD_URL, //
"4.3", "");
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.6/Custom_Workflow_and_StatusTransition.txt b/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.8/Custom_Workflow_and_StatusTransition.txt
index bdbd77b37..bdbd77b37 100644
--- a/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.6/Custom_Workflow_and_StatusTransition.txt
+++ b/org.eclipse.mylyn.bugzilla.tests/testdata/descriptor/Bugzilla_3.6.8/Custom_Workflow_and_StatusTransition.txt
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 d488f5177..7a1cbe0ca 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
@@ -68,6 +68,7 @@ public class BugzillaPeoplePart extends AbstractTaskEditorPart {
Composite peopleComposite = toolkit.createComposite(section);
GridLayout layout = new GridLayout(2, false);
layout.marginWidth = 5;
+ layout.horizontalSpacing = 10;
peopleComposite.setLayout(layout);
addAttribute(peopleComposite, toolkit, getTaskData().getRoot().getMappedAttribute(TaskAttribute.USER_ASSIGNED));
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java
index 1ddeb9cb6..2ba291289 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaResponseDetailDialog.java
@@ -11,12 +11,7 @@
package org.eclipse.mylyn.internal.bugzilla.ui.editor;
-import java.util.List;
-import java.util.Map;
-
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryResponse;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -27,17 +22,20 @@ import org.eclipse.swt.widgets.Text;
public class BugzillaResponseDetailDialog extends Dialog {
- private final BugzillaRepositoryResponse response;
+ private final String titleText;
+
+ private final String messageText;
- public BugzillaResponseDetailDialog(Shell parentShell, BugzillaRepositoryResponse response) {
+ public BugzillaResponseDetailDialog(Shell parentShell, String titleText, String messageText) {
super(parentShell);
setShellStyle(getShellStyle() | SWT.RESIZE);
- this.response = response;
+ this.titleText = titleText;
+ this.messageText = messageText;
}
@Override
protected Control createDialogArea(Composite parent) {
- getShell().setText(Messages.BugzillaResponseDetailDialog_Titel);
+ getShell().setText(titleText);
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout());
@@ -50,24 +48,7 @@ public class BugzillaResponseDetailDialog extends Dialog {
gd.widthHint = 300;
text.setLayoutData(gd);
text.setEditable(false);
-
- String mes = ""; //$NON-NLS-1$
- for (String iterable_map : response.getResponseData().keySet()) {
- if (mes.length() > 0) {
- mes += "\n"; //$NON-NLS-1$
- }
- mes += NLS.bind(Messages.BugzillaResponseDetailDialog_Bug_Line, iterable_map);
- Map<String, List<String>> responseMap = response.getResponseData().get(iterable_map);
- for (String iterable_list : responseMap.keySet()) {
- mes += NLS.bind(Messages.BugzillaResponseDetailDialog_Action_Line, iterable_list);
- List<String> responseList = responseMap.get(iterable_list);
- for (String string : responseList) {
- mes += NLS.bind(Messages.BugzillaResponseDetailDialog_Email_Line, string);
- }
- }
-
- }
- text.setText(mes);
+ text.setText(messageText);
parent.pack();
applyDialogFont(composite);
return composite;
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 cdfd33f4c..9385adb09 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
@@ -11,6 +11,8 @@
package org.eclipse.mylyn.internal.bugzilla.ui.editor;
+import java.text.MessageFormat;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -21,6 +23,9 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
@@ -31,11 +36,15 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaOperation;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryResponse;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaStatus;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaUserMatchResponse;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
+import org.eclipse.mylyn.internal.tasks.ui.PersonProposalProvider;
+import org.eclipse.mylyn.internal.tasks.ui.editors.PersonAttributeEditor;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorActionPart;
import org.eclipse.mylyn.tasks.core.RepositoryResponse;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
@@ -57,12 +66,20 @@ import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.keys.IBindingService;
/**
* @author Rob Elves
+ * @author Frank Becker
* @since 3.0
*/
public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
@@ -77,6 +94,10 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
private TaskDataModelListener productListener;
+ private final List<ControlDecoration> errorDecorations = new ArrayList<ControlDecoration>();
+
+ private final List<PersonAttributeEditor> editorsWithError = new ArrayList<PersonAttributeEditor>(3);
+
public BugzillaTaskEditorPage(TaskEditor editor) {
this(editor, BugzillaCorePlugin.CONNECTOR_KIND);
}
@@ -328,6 +349,12 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
attrToken.setValue(tokenString);
}
}
+ for (ControlDecoration decoration : errorDecorations) {
+ decoration.hide();
+ decoration.dispose();
+ }
+ errorDecorations.clear();
+ editorsWithError.clear();
if (!checkCanSubmit(IMessageProvider.ERROR)) {
return;
}
@@ -497,7 +524,15 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
@Override
protected void handleTaskSubmitted(SubmitJobEvent event) {
- if (event.getJob().getResponse() != null && event.getJob().getResponse() instanceof BugzillaRepositoryResponse) {
+ if (event.getJob().getStatus() != null) {
+ switch (event.getJob().getStatus().getCode()) {
+ case BugzillaStatus.ERROR_CONFIRM_MATCH:
+ case BugzillaStatus.ERROR_MATCH_FAILED:
+ showError((BugzillaStatus) event.getJob().getStatus());
+ break;
+ }
+ } else if (event.getJob().getResponse() != null
+ && event.getJob().getResponse() instanceof BugzillaRepositoryResponse) {
final RepositoryResponse response = event.getJob().getResponse();
if (response instanceof BugzillaRepositoryResponse) {
final BugzillaRepositoryResponse bugzillaResponse = (BugzillaRepositoryResponse) response;
@@ -506,10 +541,9 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
IMessageProvider.INFORMATION, new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent event) {
- BugzillaResponseDetailDialog dialog = new BugzillaResponseDetailDialog(
- WorkbenchUtil.getShell(), bugzillaResponse);
- dialog.open();
+ showSubmitResponse(bugzillaResponse);
}
+
});
} else {
getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_Changes_Submitted_Message,
@@ -567,4 +601,168 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
}
return true;
}
+
+ private void showError(BugzillaStatus bugzillaStatus) {
+ int count = 0;
+ BugzillaUserMatchResponse response = bugzillaStatus.getUserMatchResponse();
+ FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
+ FieldDecoration fieldDecoration = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
+ StringBuilder fields = new StringBuilder();
+ StringBuilder detail = new StringBuilder();
+
+ count += decorateControlsAndUpdateMessages(response.getAssignedToMsg(), response.getAssignedToProposals(),
+ getModel().getTaskData().getRoot().getAttribute(BugzillaAttribute.ASSIGNED_TO.getKey()), fields,
+ detail, fieldDecoration);
+ count += decorateControlsAndUpdateMessages(response.getQaContactMsg(), response.getQaContactProposals(),
+ getModel().getTaskData().getRoot().getAttribute(BugzillaAttribute.QA_CONTACT.getKey()), fields, detail,
+ fieldDecoration);
+ count += decorateControlsAndUpdateMessages(response.getNewCCMsg(), response.getNewCCProposals(),
+ getModel().getTaskData().getRoot().getAttribute(BugzillaAttribute.NEWCC.getKey()), fields, detail,
+ fieldDecoration);
+ updateTaskEditorPageMessageWithError(bugzillaStatus, detail.toString(), count == 1, fields.toString());
+ }
+
+ private int decorateControlsAndUpdateMessages(String message, List<String> proposals, TaskAttribute attribute,
+ StringBuilder fields, StringBuilder detail, FieldDecoration fieldDecoration) {
+ if (attribute == null || (message == null && proposals.size() == 0)) {
+ return 0;
+ }
+ Map<String, String> newPersonProposalMap = new HashMap<String, String>();
+ if (fields.length() > 0) {
+ fields.append(MessageFormat.format(Messages.BugzillaTaskEditorPage_Error_Label_N, attribute.getMetaData()
+ .getLabel()));
+ } else {
+ fields.append(MessageFormat.format(Messages.BugzillaTaskEditorPage_Error_Label_1, attribute.getMetaData()
+ .getLabel()));
+ }
+ detail.append(attribute.getMetaData().getLabel() + "\n"); //$NON-NLS-1$
+ if (message != null && !message.equals("")) { //$NON-NLS-1$
+ detail.append(MessageFormat.format(Messages.BugzillaTaskEditorPage_DetailLine, message));
+ } else {
+ for (String proposalValue : proposals) {
+ detail.append(MessageFormat.format(Messages.BugzillaTaskEditorPage_DetailLine, proposalValue));
+ newPersonProposalMap.put(proposalValue, proposalValue);
+ }
+ }
+ AbstractAttributeEditor editor = getEditorForAttribute(attribute);
+ if (editor != null) {
+ decorateEditorWithError(fieldDecoration, message, newPersonProposalMap, editor);
+ }
+ return 1;
+ }
+
+ /**
+ * @param bugzillaStatus
+ * @param resultDetail
+ * @param oneError
+ * @param fieldString
+ */
+ private void updateTaskEditorPageMessageWithError(BugzillaStatus bugzillaStatus, String resultDetail,
+ boolean oneError, String fieldString) {
+ String resultString;
+ final String titleString;
+ switch (bugzillaStatus.getCode()) {
+ case BugzillaStatus.ERROR_CONFIRM_MATCH:
+ if (oneError) {
+ resultString = MessageFormat.format(Messages.BugzillaTaskEditorPage_Message_one,
+ Messages.BugzillaTaskEditorPage_Confirm, fieldString);
+ } else {
+ resultString = MessageFormat.format(Messages.BugzillaTaskEditorPage_Message_more,
+ Messages.BugzillaTaskEditorPage_Confirm, fieldString);
+ }
+ titleString = Messages.BugzillaTaskEditorPage_ConfirmDetailTitle;
+ break;
+ case BugzillaStatus.ERROR_MATCH_FAILED:
+ if (oneError) {
+ resultString = MessageFormat.format(Messages.BugzillaTaskEditorPage_Message_one,
+ Messages.BugzillaTaskEditorPage_Error, fieldString);
+ } else {
+ resultString = MessageFormat.format(Messages.BugzillaTaskEditorPage_Message_more,
+ Messages.BugzillaTaskEditorPage_Error, fieldString);
+ }
+ titleString = Messages.BugzillaTaskEditorPage_ErrorDetailTitle;
+ break;
+ default:
+ throw new RuntimeException("unexpected BugzillaStatus: " + bugzillaStatus.getCode()); //$NON-NLS-1$
+ }
+
+ final String resultDetailString = resultDetail;
+ getTaskEditor().setMessage(resultString, IMessageProvider.ERROR, new HyperlinkAdapter() {
+ @Override
+ public void linkActivated(HyperlinkEvent event) {
+ BugzillaResponseDetailDialog dialog = new BugzillaResponseDetailDialog(WorkbenchUtil.getShell(),
+ titleString, resultDetailString);
+ dialog.open();
+ }
+ });
+ }
+
+ /**
+ * @param fieldDecoration
+ * @param message
+ * @param newPersonProposalMap
+ * @param editor
+ */
+ private void decorateEditorWithError(FieldDecoration fieldDecoration, String message,
+ Map<String, String> newPersonProposalMap, AbstractAttributeEditor editor) {
+ final Control control = editor.getControl();
+
+ final ControlDecoration decoration = new ControlDecoration(control, SWT.LEFT | SWT.DOWN);
+ decoration.setImage(fieldDecoration.getImage());
+ IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
+ if (message != null && !message.equals("")) { //$NON-NLS-1$
+ decoration.setDescriptionText(message);
+ errorDecorations.add(decoration);
+ } else {
+ decoration.setDescriptionText(NLS.bind(
+ Messages.BugzillaTaskEditorPage_Content_Assist_for_Error_Available,
+ bindingService.getBestActiveBindingFormattedFor(ContentAssistCommandAdapter.CONTENT_PROPOSAL_COMMAND)));
+ errorDecorations.add(decoration);
+
+ PersonAttributeEditor personEditor = ((PersonAttributeEditor) editor);
+ final PersonProposalProvider personProposalProvider = (PersonProposalProvider) personEditor.getContentAssistCommandAdapter()
+ .getContentProposalProvider();
+ personProposalProvider.setErrorProposals(newPersonProposalMap);
+
+ editorsWithError.add(personEditor);
+ if (newPersonProposalMap.size() == 1) {
+ personEditor.setValue(newPersonProposalMap.keySet().iterator().next());
+
+ }
+ personEditor.getText().addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ decoration.hide();
+ errorDecorations.remove(decoration);
+ decoration.dispose();
+ personProposalProvider.setErrorProposals(null);
+ }
+ });
+ }
+ }
+
+ /**
+ * @param bugzillaResponse
+ */
+ private void showSubmitResponse(final BugzillaRepositoryResponse bugzillaResponse) {
+ StringBuilder message = new StringBuilder();
+ for (String iterable_map : bugzillaResponse.getResponseData().keySet()) {
+ if (message.length() > 0) {
+ message.append("\n"); //$NON-NLS-1$
+ }
+ message.append(NLS.bind(Messages.BugzillaTaskEditorPage_Bug_Line, iterable_map));
+ Map<String, List<String>> responseMap = bugzillaResponse.getResponseData().get(iterable_map);
+ for (String iterable_list : responseMap.keySet()) {
+ message.append(NLS.bind(Messages.BugzillaTaskEditorPage_Action_Line, iterable_list));
+ List<String> responseList = responseMap.get(iterable_list);
+ for (String string : responseList) {
+ message.append(NLS.bind(Messages.BugzillaTaskEditorPage_Email_Line, string));
+ }
+ }
+ }
+ BugzillaResponseDetailDialog dialog = new BugzillaResponseDetailDialog(WorkbenchUtil.getShell(),
+ Messages.BugzillaTaskEditorPage_submitted_Changes_Details, message.toString());
+ dialog.open();
+ }
+
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java
index c4264c7f8..3ca6ddef1 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java
@@ -51,13 +51,11 @@ public class Messages extends NLS {
public static String BugzillaPlanningEditorPart_Team_Planning;
- public static String BugzillaResponseDetailDialog_Titel;
+ public static String BugzillaTaskEditorPage_Bug_Line;
- public static String BugzillaResponseDetailDialog_Bug_Line;
+ public static String BugzillaTaskEditorPage_Action_Line;
- public static String BugzillaResponseDetailDialog_Action_Line;
-
- public static String BugzillaResponseDetailDialog_Email_Line;
+ public static String BugzillaTaskEditorPage_Email_Line;
public static String BugzillaTaskEditorCommentPart_privateComment;
@@ -71,6 +69,36 @@ public class Messages extends NLS {
public static String BugzillaTaskEditorPage_Changes_Submitted_Message;
+ public static String BugzillaTaskEditorPage_Confirm;
+
+ public static String BugzillaTaskEditorPage_ConfirmDetailTitle;
+
+ public static String BugzillaTaskEditorPage_Content_Assist_for_Error_Available;
+
+ public static String BugzillaTaskEditorPage_DetailLine;
+
+ public static String BugzillaTaskEditorPage_Error;
+
+ public static String BugzillaTaskEditorPage_Error_Label_1;
+
+ public static String BugzillaTaskEditorPage_Error_Label_N;
+
+ public static String BugzillaTaskEditorPage_ErrorDetailTitle;
+
+ public static String BugzillaTaskEditorPage_Legal_Value_1;
+
+ public static String BugzillaTaskEditorPage_Legal_Value_N;
+
+ public static String BugzillaTaskEditorPage_Legal_Values_More;
+
+ public static String BugzillaTaskEditorPage_Legal_Values_One;
+
+ public static String BugzillaTaskEditorPage_match_Detail;
+
+ public static String BugzillaTaskEditorPage_Message_more;
+
+ public static String BugzillaTaskEditorPage_Message_one;
+
public static String BugzillaTaskEditorPage_Please_enter_a_description_before_submitting;
public static String BugzillaTaskEditorPage_Please_enter_a_short_summary_before_submitting;
@@ -81,6 +109,8 @@ public class Messages extends NLS {
public static String BugzillaTaskEditorPage_submit_disabled_please_refresh;
+ public static String BugzillaTaskEditorPage_submitted_Changes_Details;
+
public static String BugzillaVotesEditor_Show_votes;
public static String BugzillaVotesEditor_Vote;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
index ec01b9b96..a65175a89 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
@@ -23,21 +23,37 @@ BugzillaPeoplePart__Select_to_remove_=(Select to remove)
BugzillaPlanningEditorPart_Current_Estimate=Current Estimate:
BugzillaPlanningEditorPart_Team_Planning=Team Planning
-BugzillaResponseDetailDialog_Titel=submitted Changes Details
-BugzillaResponseDetailDialog_Bug_Line={0}\n
-BugzillaResponseDetailDialog_Action_Line=\ \ \ \ \ \ \ \ {0}\n
-BugzillaResponseDetailDialog_Email_Line=\ \ \ \ \ \ \ \ \ \ \ \ {0}\n
+BugzillaTaskEditorPage_Bug_Line={0}\n
+BugzillaTaskEditorPage_Action_Line=\ \ \ \ \ \ \ \ {0}\n
+BugzillaTaskEditorPage_Email_Line=\ \ \ \ \ \ \ \ \ \ \ \ {0}\n
BugzillaTaskEditorCommentPart_privateComment=private Comment
BugzillaTaskEditorCommentPart_publicComment=public Comment
BugzillaTaskEditorNewCommentPart_privateComment=private Comment
BugzillaTaskEditorNewCommentPart_publicComment=public Comment
BugzillaTaskEditorPage_Anonymous_can_not_submit_Tasks=Anonymous can not submit Tasks\!
BugzillaTaskEditorPage_Changes_Submitted_Message=Changes submitted
+BugzillaTaskEditorPage_Confirm=Confirm
+BugzillaTaskEditorPage_ConfirmDetailTitle=Confirm match Detail
+BugzillaTaskEditorPage_Content_Assist_for_Error_Available=Content Assist for Error Available ({0})
+BugzillaTaskEditorPage_DetailLine=\t\t{0}\n
+BugzillaTaskEditorPage_Error=Error
+BugzillaTaskEditorPage_Error_Label_1="{0}"
+BugzillaTaskEditorPage_Error_Label_N=, "{0}"
+BugzillaTaskEditorPage_ErrorDetailTitle=Error match Detail
+BugzillaTaskEditorPage_Legal_Value_1={0}
+BugzillaTaskEditorPage_Legal_Value_N=, \n{0}
+BugzillaTaskEditorPage_Legal_Values_More=legal values are:\n{0}
+BugzillaTaskEditorPage_Legal_Values_One=legal value is\n{0}
+BugzillaTaskEditorPage_match_Detail=\ match Detail
+BugzillaTaskEditorPage_Message_more={0} match for fields {1}
+BugzillaTaskEditorPage_Message_one={0} match for field {1}
+
BugzillaTaskEditorPage_Please_enter_a_description_before_submitting=Please enter a description before submitting
BugzillaTaskEditorPage_Please_enter_a_short_summary_before_submitting=Please enter a short summary before submitting
BugzillaTaskEditorPage_Please_select_a_component_before_submitting=Please select a component before submitting
BugzillaTaskEditorPage_Please_enter_a_bugid_for_duplicate_of_before_submitting=Please enter a bugid for \"duplicate of\" before submitting
BugzillaTaskEditorPage_submit_disabled_please_refresh=submit disabled, please check Credentials and refresh
+BugzillaTaskEditorPage_submitted_Changes_Details=submitted Changes Details
BugzillaVotesEditor_Show_votes=Show votes
BugzillaVotesEditor_Vote=Vote
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
index d2d8b2780..0450ab6b2 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
@@ -83,7 +83,6 @@ import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
* @author Mik Kersten (hardening of prototype)
* @author Frank Becker
*/
-@SuppressWarnings("restriction")
public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements Listener {
private static final int HEIGHT_ATTRIBUTE_COMBO = 30;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java
index dad7d56f0..86b5df9f3 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/Messages.java
@@ -63,10 +63,6 @@ public class Messages extends NLS {
public static String BugzillaSearchPage_Enter_search_option;
- public static String BugzillaSearchPage_Error_updating_search_options;
-
- public static String BugzillaSearchPage_Error_was_X;
-
public static String BugzillaSearchPage_Hardware;
public static String BugzillaSearchPage_Keywords;
@@ -171,8 +167,6 @@ public class Messages extends NLS {
public static String BugzillaSearchPage_Summary;
- public static String BugzillaSearchPage_Updating_search_options_;
-
public static String BugzillaSearchPage_ValidationMessage;
public static String BugzillaSearchPage_ValidationMessage1;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties
index 999859373..96a279d2c 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/messages.properties
@@ -27,8 +27,6 @@ BugzillaSearchPage_EmailOperation_notregexp=doesn't match regexp
BugzillaSearchPage_EmailOperation_regexp=matches regexp
BugzillaSearchPage_EmailOperation_substring=contains
BugzillaSearchPage_Enter_search_option=Enter or select a search option
-BugzillaSearchPage_Error_updating_search_options=Error updating search options
-BugzillaSearchPage_Error_was_X=Error was: {0}
BugzillaSearchPage_Hardware=Hard&ware:
BugzillaSearchPage_Keywords=&Keywords:
BugzillaSearchPage_Milestone=&Milestone:
@@ -81,7 +79,6 @@ BugzillaSearchPage_Select_the_Bugzilla_query_parameters=Select the Bugzilla quer
BugzillaSearchPage_Severity=Se&verity:
BugzillaSearchPage_Status=Stat&us:
BugzillaSearchPage_Summary=Summar&y:
-BugzillaSearchPage_Updating_search_options_=Updating search options...
BugzillaSearchPage_ValidationMessage=Please select one off the following email type ({1},{2},{3},{4},{5}) for {0}
BugzillaSearchPage_ValidationMessage1=Can not use value {1} from field {0}
BugzillaSearchPage_ValidationReason=You must select at least on of the type checkboxes\n\t{0}\n\t{1}\n\t{2}\n\t{3}\n\t{4}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
index 1bd517e63..49c8b55e3 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
@@ -529,7 +529,6 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
defaultPlatformCombo.setEnabled(!autodetectPlatformOS.getSelection());
}
- @SuppressWarnings({ "restriction" })
@Override
public void applyTo(final TaskRepository repository) {
AuthenticationCredentials repositoryAuth = repository.getCredentials(AuthenticationType.REPOSITORY);
diff --git a/org.eclipse.mylyn.sdk-feature/feature.properties b/org.eclipse.mylyn.sdk-feature/feature.properties
index 7c29f95df..b4f7e165d 100644
--- a/org.eclipse.mylyn.sdk-feature/feature.properties
+++ b/org.eclipse.mylyn.sdk-feature/feature.properties
@@ -11,7 +11,7 @@
featureName=Mylyn Tasks SDK
description=Provides sources for the Mylyn Task List and Tasks Connector features.
providerName=Eclipse Mylyn
-copyright=Copyright (c) 2004, 2011 Tasktop Technologies and others. All rights reserved.
+copyright=Copyright (c) 2004, 2012 Tasktop Technologies and others. All rights reserved.
license=\
Eclipse Foundation Software User Agreement\n\
diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectSupportElementPage.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectSupportElementPage.java
index fe323533d..1a29d9049 100644
--- a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectSupportElementPage.java
+++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/wizards/SelectSupportElementPage.java
@@ -58,7 +58,6 @@ import org.eclipse.ui.themes.IThemeManager;
/**
* @author Steffen Pingel
*/
-@SuppressWarnings("restriction")
public class SelectSupportElementPage extends WizardPage {
private class SupportElementItem extends ControlListItem {
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java
index 69806866c..d23fb723b 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/Messages.java
@@ -61,8 +61,6 @@ public class Messages extends NLS {
public static String PriorityLevel_Very_Low;
- public static String ScheduledTaskContainer_Dash_Pattern;
-
public static String ScheduledTaskContainer_Next_Day;
public static String TaskJobFactory_Refreshing_repository_configuration;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java
index 66dd96a81..20ec91a39 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java
@@ -136,7 +136,8 @@ public class TaskDataStore {
return readStateInternal(file, false);
} catch (SAXException e) {
// bug 268456: if reading fails, try again using a different XML version
- if (e.getMessage() != null && e.getMessage().contains("invalid XML character")) { //$NON-NLS-1$
+ if (e.getMessage() != null
+ && (e.getMessage().contains("invalid XML character") || e.getMessage().contains("Character reference \"&#"))) { //$NON-NLS-1$ //$NON-NLS-2$
return readStateInternal(file, true);
} else {
throw e;
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties
index d64e1e329..57899bcd5 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/messages.properties
@@ -34,7 +34,6 @@ PriorityLevel_Low=Low
PriorityLevel_Normal=Normal
PriorityLevel_Very_High=Very High
PriorityLevel_Very_Low=Very Low
-ScheduledTaskContainer_Dash_Pattern={0} - {1}
ScheduledTaskContainer_Next_Day=Next {0}
TaskJobFactory_Refreshing_repository_configuration=Refreshing repository configuration
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java
index 3121b763e..2ea0dce26 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskMapper.java
@@ -86,7 +86,8 @@ public class TaskMapper implements ITaskMapping {
}
private String getPriorityLevelString() {
- return (getPriorityLevel() != null) ? getPriorityLevel().toString() : PriorityLevel.getDefault().toString();
+ PriorityLevel priorityLevel = getPriorityLevel();
+ return (priorityLevel != null) ? priorityLevel.toString() : PriorityLevel.getDefault().toString();
}
private boolean hasChanges(Object existingValue, Object newValue, String attributeId) {
diff --git a/org.eclipse.mylyn.tasks.index-feature/.cvsignore b/org.eclipse.mylyn.tasks.index-feature/.cvsignore
deleted file mode 100644
index d567ba01e..000000000
--- a/org.eclipse.mylyn.tasks.index-feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-target
diff --git a/org.eclipse.mylyn.tasks.index-feature/feature.properties b/org.eclipse.mylyn.tasks.index-feature/feature.properties
index 2eeefa63c..ad13f0bc6 100644
--- a/org.eclipse.mylyn.tasks.index-feature/feature.properties
+++ b/org.eclipse.mylyn.tasks.index-feature/feature.properties
@@ -8,7 +8,7 @@
# Contributors:
# Tasktop Technologies - initial API and implementation
###############################################################################
-featureName=Mylyn Task List Index (Incubation)
+featureName=Mylyn Task List Index
description=Provides richer search capabilities within the task list.\n\
For details: https://bugs.eclipse.org/bugs/show_bug.cgi?id=191522
providerName=Eclipse Mylyn
diff --git a/org.eclipse.mylyn.tasks.index-feature/pom.xml b/org.eclipse.mylyn.tasks.index-feature/pom.xml
index 3f78a22c5..2139bd183 100644
--- a/org.eclipse.mylyn.tasks.index-feature/pom.xml
+++ b/org.eclipse.mylyn.tasks.index-feature/pom.xml
@@ -5,8 +5,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.mylyn.incubator-parent</artifactId>
- <groupId>org.eclipse.mylyn.incubator</groupId>
+ <artifactId>org.eclipse.mylyn.tasks-parent</artifactId>
+ <groupId>org.eclipse.mylyn.tasks</groupId>
<version>3.7.0-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.mylyn.tasks.index</artifactId>
diff --git a/org.eclipse.mylyn.tasks.index.core/pom.xml b/org.eclipse.mylyn.tasks.index.core/pom.xml
index 8af521a08..71246d467 100644
--- a/org.eclipse.mylyn.tasks.index.core/pom.xml
+++ b/org.eclipse.mylyn.tasks.index.core/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.mylyn.incubator-parent</artifactId>
- <groupId>org.eclipse.mylyn.incubator</groupId>
+ <artifactId>org.eclipse.mylyn.tasks-parent</artifactId>
+ <groupId>org.eclipse.mylyn.tasks</groupId>
<version>3.7.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.mylyn.tasks</groupId>
diff --git a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/Messages.java b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/Messages.java
index e93057ce8..2e26a4b3e 100644
--- a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/Messages.java
+++ b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Tasktop Technologies and others.
+ * Copyright (c) 2011, 2012 Tasktop Technologies 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
diff --git a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java
index 297bca42b..d435ec6cc 100644
--- a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java
+++ b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Tasktop Technologies.
+ * Copyright (c) 2011, 2012 Tasktop Technologies.
* 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
diff --git a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TasksIndexCore.java b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TasksIndexCore.java
index 9d3823a18..5826b8eeb 100644
--- a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TasksIndexCore.java
+++ b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TasksIndexCore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Tasktop Technologies.
+ * Copyright (c) 2011, 2012 Tasktop Technologies.
* 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
diff --git a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/messages.properties b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/messages.properties
index beabf8c1d..93b80fdc7 100644
--- a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/messages.properties
+++ b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2011 Tasktop Technologies and others.
+# Copyright (c) 2011, 2012 Tasktop Technologies 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
diff --git a/org.eclipse.mylyn.tasks.index.tests/pom.xml b/org.eclipse.mylyn.tasks.index.tests/pom.xml
index 4b70acfe5..fe598dd75 100644
--- a/org.eclipse.mylyn.tasks.index.tests/pom.xml
+++ b/org.eclipse.mylyn.tasks.index.tests/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.mylyn.incubator-parent</artifactId>
- <groupId>org.eclipse.mylyn.incubator</groupId>
+ <artifactId>org.eclipse.mylyn.tasks-parent</artifactId>
+ <groupId>org.eclipse.mylyn.tasks</groupId>
<version>3.7.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.mylyn.tasks</groupId>
diff --git a/org.eclipse.mylyn.tasks.index.ui/pom.xml b/org.eclipse.mylyn.tasks.index.ui/pom.xml
index 5bf36ddf2..89ae3a41d 100644
--- a/org.eclipse.mylyn.tasks.index.ui/pom.xml
+++ b/org.eclipse.mylyn.tasks.index.ui/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.mylyn.incubator-parent</artifactId>
- <groupId>org.eclipse.mylyn.incubator</groupId>
+ <artifactId>org.eclipse.mylyn.tasks-parent</artifactId>
+ <groupId>org.eclipse.mylyn.tasks</groupId>
<version>3.7.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.mylyn.tasks</groupId>
diff --git a/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java b/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java
index 0045e4b7a..b84387678 100644
--- a/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java
+++ b/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Tasktop Technologies and others.
+ * Copyright (c) 2011, 2012 Tasktop Technologies 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
diff --git a/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexedSubstringPatternFilter.java b/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexedSubstringPatternFilter.java
index ab0379efc..9ff7ede86 100644
--- a/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexedSubstringPatternFilter.java
+++ b/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexedSubstringPatternFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Tasktop Technologies.
+ * Copyright (c) 2011, 2012 Tasktop Technologies.
* 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
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
index 5586fe667..7f36e0835 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
@@ -30,6 +30,7 @@ import org.eclipse.mylyn.tasks.tests.ui.TaskRelationHyperlinkDetectorTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.AttachmentTableLabelProviderTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.EditorUtilTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.PlanningPartTest;
+import org.eclipse.mylyn.tasks.tests.ui.editor.RegionComparatorTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.RepositoryCompletionProcessorTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.TaskEditorPartDescriptorTest;
import org.eclipse.mylyn.tasks.tests.ui.editor.TaskMigratorTest;
@@ -38,11 +39,12 @@ import org.eclipse.mylyn.tasks.tests.ui.editor.TaskUrlHyperlinkDetectorTest;
/**
* @author Mik Kersten
* @author Shawn Minto
+ * @author Steffen Pingel
*/
public class AllTasksTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.tasks.tests");
+ TestSuite suite = new TestSuite(AllTasksTests.class.getName());
suite.addTestSuite(TasksUiUtilTest.class);
suite.addTestSuite(TaskListUiTest.class);
suite.addTestSuite(TaskRepositoryTest.class);
@@ -115,6 +117,7 @@ public class AllTasksTests {
//suite.addTestSuite(QueryExportImportTest.class);
//suite.addTestSuite(BackgroundSaveTest.class);
suite.addTestSuite(MultipleTaskHyperlinkDetectorTest.class);
+ suite.addTestSuite(RegionComparatorTest.class);
return suite;
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
index 33b059131..f29dad897 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
@@ -17,6 +17,7 @@ import org.eclipse.mylyn.commons.ui.ClipboardCopier;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction.Mode;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
import org.eclipse.mylyn.tasks.tests.connector.MockTask;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -75,9 +76,17 @@ public class CopyDetailsActionTest extends TestCase {
return "http://321.com";
}
};
- ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(connector);
- assertEquals("321: s321" + ClipboardCopier.LINE_SEPARATOR + "http://321.com",
- CopyTaskDetailsAction.getTextForTask(task, Mode.SUMMARY_URL));
+ AbstractRepositoryConnector oldConnector = TasksUi.getRepositoryManager().getRepositoryConnector(
+ MockRepositoryConnector.CONNECTOR_KIND);
+ try {
+ ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(connector);
+ assertEquals("321: s321" + ClipboardCopier.LINE_SEPARATOR + "http://321.com",
+ CopyTaskDetailsAction.getTextForTask(task, Mode.SUMMARY_URL));
+ } finally {
+ if (oldConnector != null) {
+ ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(oldConnector);
+ }
+ }
}
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java
index 0336b2a98..0e92a640b 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java
@@ -30,6 +30,7 @@ import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetUpdater;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryQuery;
+import org.eclipse.mylyn.tests.util.TestFixture;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
@@ -52,6 +53,7 @@ public class TaskWorkingSetTest extends TestCase {
protected void setUp() throws Exception {
workingSetManager = Workbench.getInstance().getWorkingSetManager();
root = ResourcesPlugin.getWorkspace().getRoot();
+ TestFixture.resetTaskList();
}
@Override
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/RegionComparatorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/RegionComparatorTest.java
new file mode 100644
index 000000000..970de1b49
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/RegionComparatorTest.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Tasktop Technologies.
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylyn.tasks.tests.ui.editor;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.text.Region;
+import org.eclipse.mylyn.internal.tasks.ui.editors.AbstractHyperlinkTextPresentationManager.RegionComparator;
+
+/**
+ * @author Steffen Pingel
+ */
+public class RegionComparatorTest extends TestCase {
+
+ RegionComparator comparator = new RegionComparator();
+
+ public void testCompareToEquals() {
+ Region r1 = new Region(0, 10);
+ Region r2 = new Region(0, 10);
+ assertEquals(r1, r2);
+ assertEquals(0, comparator.compare(r1, r2));
+ }
+
+ public void testCompareToSameLength() {
+ Region r1 = new Region(0, 10);
+ Region r2 = new Region(1, 10);
+ assertFalse(r1.equals(r2));
+ assertEquals(-1, comparator.compare(r1, r2));
+ assertEquals(1, comparator.compare(r2, r1));
+ }
+
+ public void testCompareToNested() {
+ Region r1 = new Region(0, 10);
+ Region r2 = new Region(1, 8);
+ assertEquals(-1, comparator.compare(r1, r2));
+ assertEquals(1, comparator.compare(r2, r1));
+ }
+
+ public void testCompareToOverlapping() {
+ Region r1 = new Region(0, 10);
+ Region r2 = new Region(1, 12);
+ assertEquals(-1, comparator.compare(r1, r2));
+ assertEquals(1, comparator.compare(r2, r1));
+
+ r2 = new Region(1, 9);
+ assertEquals(-1, comparator.compare(r1, r2));
+ assertEquals(1, comparator.compare(r2, r1));
+ }
+
+ public void testCompareToSameOffset() {
+ Region r1 = new Region(5, 8);
+ Region r2 = new Region(5, 10);
+ assertFalse(r1.equals(r2));
+ assertEquals(-1, comparator.compare(r1, r2));
+ assertEquals(1, comparator.compare(r2, r1));
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/TaskUrlHyperlinkDetectorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/TaskUrlHyperlinkDetectorTest.java
index d043987f3..6fa275a02 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/TaskUrlHyperlinkDetectorTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/editor/TaskUrlHyperlinkDetectorTest.java
@@ -22,8 +22,8 @@ import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextViewer;
import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.mylyn.commons.workbench.browser.UrlHyperlink;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.internal.tasks.ui.editors.TaskUrlHyperlink;
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskUrlHyperlinkDetector;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.tests.TaskTestUtil;
@@ -63,7 +63,7 @@ public class TaskUrlHyperlinkDetectorTest extends TestCase {
IHyperlink[] links = detect("http://foo", 0, 0);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://foo", ((TaskUrlHyperlink) links[0]).getURLString());
+ assertEquals("http://foo", ((UrlHyperlink) links[0]).getURLString());
}
public void testInvalidUrl() {
@@ -81,39 +81,39 @@ public class TaskUrlHyperlinkDetectorTest extends TestCase {
IHyperlink[] links = detect("(http://foo)", 2, 0);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://foo", ((TaskUrlHyperlink) links[0]).getURLString());
+ assertEquals("http://foo", ((UrlHyperlink) links[0]).getURLString());
links = detect("( http://foo)", 2, 0);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://foo", ((TaskUrlHyperlink) links[0]).getURLString());
+ assertEquals("http://foo", ((UrlHyperlink) links[0]).getURLString());
links = detect("( http://foo).", 2, 0);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://foo", ((TaskUrlHyperlink) links[0]).getURLString());
+ assertEquals("http://foo", ((UrlHyperlink) links[0]).getURLString());
}
public void testClosingParenthesis() {
IHyperlink[] links = detect("http://foo?(bar)", 0, 0);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://foo?(bar)", ((TaskUrlHyperlink) links[0]).getURLString());
+ assertEquals("http://foo?(bar)", ((UrlHyperlink) links[0]).getURLString());
links = detect("(http://foo?(bar))", 0, 18);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://foo?(bar)", ((TaskUrlHyperlink) links[0]).getURLString());
+ assertEquals("http://foo?(bar)", ((UrlHyperlink) links[0]).getURLString());
links = detect("http://foo?((((bar).", 0, 0);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://foo?((((bar)", ((TaskUrlHyperlink) links[0]).getURLString());
+ assertEquals("http://foo?((((bar)", ((UrlHyperlink) links[0]).getURLString());
links = detect("http://foo?(bar))))))))", 0, 0);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://foo?(bar)", ((TaskUrlHyperlink) links[0]).getURLString());
+ assertEquals("http://foo?(bar)", ((UrlHyperlink) links[0]).getURLString());
}
public void testDetectionUsingExtent() {
diff --git a/org.eclipse.mylyn.tasks.ui/.settings/.api_filters b/org.eclipse.mylyn.tasks.ui/.settings/.api_filters
index 33f67ce81..52f6c823b 100644
--- a/org.eclipse.mylyn.tasks.ui/.settings/.api_filters
+++ b/org.eclipse.mylyn.tasks.ui/.settings/.api_filters
@@ -24,13 +24,4 @@
</message_arguments>
</filter>
</resource>
- <resource path="src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage2.java" type="org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositoryQueryPage2">
- <filter id="643846161">
- <message_arguments>
- <message_argument value="SectionComposite"/>
- <message_argument value="AbstractRepositoryQueryPage2"/>
- <message_argument value="createPageContent(SectionComposite)"/>
- </message_arguments>
- </filter>
- </resource>
</component>
diff --git a/org.eclipse.mylyn.tasks.ui/plugin.xml b/org.eclipse.mylyn.tasks.ui/plugin.xml
index 754afadb8..2f9ac4248 100644
--- a/org.eclipse.mylyn.tasks.ui/plugin.xml
+++ b/org.eclipse.mylyn.tasks.ui/plugin.xml
@@ -2357,5 +2357,12 @@
</enabledWhen>
</handler>
</extension>
+ <extension
+ point="org.eclipse.mylyn.commons.workbench.urlHandlers">
+ <handler
+ class="org.eclipse.mylyn.internal.tasks.ui.TaskUrlHandler"
+ id="org.eclipse.mylyn.tasks.ui.urlHandler.TaskUrlHandler">
+ </handler>
+ </extension>
</plugin>
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/Messages.java
index e9e7f5ee5..0075bcbf8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/Messages.java
@@ -29,8 +29,6 @@ public class Messages extends NLS {
public static String AbstractRepositoryQueryPage2__Title_;
- public static String AbstractRepositoryQueryPage2_Clear_Fields;
-
public static String AbstractRepositoryQueryPage2_Create_a_Query_Page_Description;
public static String AbstractRepositoryQueryPage2_Enter_a_title;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/messages.properties
index 0c63aab6f..8042cbc4b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/messages.properties
@@ -10,7 +10,6 @@
###############################################################################
AbstractRepositoryQueryPage2__Refresh_From_Repository=&Refresh
AbstractRepositoryQueryPage2__Title_=&Title:
-AbstractRepositoryQueryPage2_Clear_Fields=Clear Fields
AbstractRepositoryQueryPage2_Create_a_Query_Page_Description=Create a query.
AbstractRepositoryQueryPage2_Enter_a_title=Enter a title
AbstractRepositoryQueryPage2_Enter_query_parameters=Enter query parameters
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java
index 1b6e430d1..ca2dc11fd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalProvider.java
@@ -64,6 +64,8 @@ public class PersonProposalProvider implements IContentProposalProvider {
private final Map<String, String> proposals;
+ private Map<String, String> errorProposals;
+
public PersonProposalProvider(AbstractTask task, TaskData taskData) {
this(task, taskData, new HashMap<String, String>(0));
}
@@ -117,19 +119,21 @@ public class PersonProposalProvider implements IContentProposalProvider {
// retrieve subset of the tree set using key range
SortedSet<String> addressSet = getAddressSet();
- if (!searchText.equals("")) { //$NON-NLS-1$
- // lower bounds
- searchText = searchText.toLowerCase();
+ if (errorProposals == null || errorProposals.isEmpty()) {
+ if (!searchText.equals("")) { //$NON-NLS-1$
+ // lower bounds
+ searchText = searchText.toLowerCase();
- // compute the upper bound
- char[] nextWord = searchText.toCharArray();
- nextWord[searchText.length() - 1]++;
+ // compute the upper bound
+ char[] nextWord = searchText.toCharArray();
+ nextWord[searchText.length() - 1]++;
- // filter matching keys
- addressSet = new TreeSet<String>(addressSet.subSet(searchText, new String(nextWord)));
+ // filter matching keys
+ addressSet = new TreeSet<String>(addressSet.subSet(searchText, new String(nextWord)));
- // add matching keys based on pretty names
- addMatchingProposalsByPrettyName(addressSet, searchText);
+ // add matching keys based on pretty names
+ addMatchingProposalsByPrettyName(addressSet, searchText);
+ }
}
IContentProposal[] result = new IContentProposal[addressSet.size()];
@@ -207,6 +211,13 @@ public class PersonProposalProvider implements IContentProposalProvider {
}
});
+ if (errorProposals != null && !errorProposals.isEmpty()) {
+ for (String proposal : errorProposals.keySet()) {
+ addAddress(addressSet, proposal);
+ }
+ return addressSet;
+ }
+
if (proposals.size() > 0) {
if (repositoryUrl != null && connectorKind != null) {
currentUser = getCurrentUser(repositoryUrl, connectorKind);
@@ -322,4 +333,16 @@ public class PersonProposalProvider implements IContentProposalProvider {
}
}
+ public Map<String, String> getProposals() {
+ return proposals;
+ }
+
+ public Map<String, String> getErrorProposals() {
+ return errorProposals;
+ }
+
+ public void setErrorProposals(Map<String, String> errorProposals) {
+ this.errorProposals = errorProposals;
+ addressSet = null;
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskUrlHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskUrlHandler.java
new file mode 100644
index 000000000..6f619c845
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskUrlHandler.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Tasktop Technologies 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
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.ui;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.mylyn.commons.workbench.EditorHandle;
+import org.eclipse.mylyn.commons.workbench.browser.AbstractUrlHandler;
+import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
+import org.eclipse.mylyn.internal.tasks.core.LocalTask;
+import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * @author Steffen Pingel
+ */
+public class TaskUrlHandler extends AbstractUrlHandler {
+
+ public TaskUrlHandler() {
+ // ignore
+ }
+
+ @Override
+ public EditorHandle openUrl(IWorkbenchPage page, String url, int customFlags) {
+ Assert.isNotNull(url);
+ AbstractTask task = TasksUiInternal.getTaskByUrl(url);
+ if (task != null && !(task instanceof LocalTask)) {
+ TaskRepository repository = TasksUi.getRepositoryManager().getRepository(task.getConnectorKind(),
+ task.getRepositoryUrl());
+ return TasksUiUtil.openTaskWithResult(repository, task.getTaskId());
+ } else {
+ AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager()
+ .getConnectorForRepositoryTaskUrl(url);
+ if (connector != null) {
+ String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(url);
+ if (repositoryUrl != null) {
+ String id = connector.getTaskIdFromTaskUrl(url);
+ if (id != null) {
+ TaskRepository repository = TasksUi.getRepositoryManager().getRepository(
+ connector.getConnectorKind(), repositoryUrl);
+ if (repository != null) {
+ return TasksUiUtil.openTaskWithResult(repository, id);
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
index 06eef5ea0..b3a80b4f8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
@@ -1002,8 +1002,6 @@ public class TasksUiPlugin extends AbstractUIPlugin {
private final Map<String, List<IDynamicSubMenuContributor>> menuContributors = new HashMap<String, List<IDynamicSubMenuContributor>>();
- private IIdentityService identityService;
-
private ServiceTracker identityServiceTracker;
public Map<String, List<IDynamicSubMenuContributor>> getDynamicMenuMap() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/Messages.java
index 97c3c4b29..f46901050 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/Messages.java
@@ -25,8 +25,6 @@ public class Messages extends NLS {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
- public static String AddTaskRepositoryHandler_Add_Task_Repository;
-
public static String NewLocalTaskHandler_Could_not_create_local_task;
public static String OpenTaskAttachmentHandler_failedToOpenViewer;
@@ -49,8 +47,6 @@ public class Messages extends NLS {
public static String ShowTasksConnectorDiscoveryWizardCommandHandler_Install_Connectors;
- public static String ShowTasksConnectorDiscoveryWizardCommandHandler_Notify_when_new_connectors_are_available;
-
public static String ShowTasksConnectorDiscoveryWizardCommandHandler_Notify_when_updates_are_available_Text;
public static String ShowTasksConnectorDiscoveryWizardCommandHandler_Unable_to_launch_connector_install;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/messages.properties
index 1a39885f4..20be4be2e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/messages.properties
@@ -8,7 +8,6 @@
# Contributors:
# Tasktop Technologies - initial API and implementation
###############################################################################
-AddTaskRepositoryHandler_Add_Task_Repository=Add Task Repository
NewLocalTaskHandler_Could_not_create_local_task=Could not create local task
@@ -23,6 +22,5 @@ RemoteTaskSelectionDialog_Matching_tasks=&Matching tasks:
RemoteTaskSelectionDialog_Select_a_task_or_repository=Select a task or repository
RemoteTaskSelectionDialog_Select_a_task_repository=&Select a task repository\:
ShowTasksConnectorDiscoveryWizardCommandHandler_Install_Connectors=Install Connectors
-ShowTasksConnectorDiscoveryWizardCommandHandler_Notify_when_new_connectors_are_available=Notify when new connectors are available
ShowTasksConnectorDiscoveryWizardCommandHandler_Notify_when_updates_are_available_Text=Notify when updates are available
ShowTasksConnectorDiscoveryWizardCommandHandler_Unable_to_launch_connector_install=Unable to launch connector install since the required platform support is not available.
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextAttachWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextAttachWizard.java
index e64fdc822..0da517375 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextAttachWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextAttachWizard.java
@@ -22,7 +22,6 @@ import org.eclipse.mylyn.tasks.ui.TasksUiImages;
* @author Rob Elves
* @author Steffen Pingel
*/
-@SuppressWarnings({ "restriction" })
public class ContextAttachWizard extends Wizard {
private final TaskRepository repository;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizard.java
index 6549b6482..ed0f201cc 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizard.java
@@ -24,7 +24,6 @@ import org.eclipse.mylyn.tasks.ui.TasksUiImages;
* @author Mik Kersten
* @author Steffen Pingel
*/
-@SuppressWarnings({ "restriction" })
public class ContextRetrieveWizard extends Wizard {
private final TaskRepository repository;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizardPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizardPage.java
index 535be4748..b8593b260 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizardPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/context/ContextRetrieveWizardPage.java
@@ -43,7 +43,6 @@ import com.ibm.icu.text.DateFormat;
* @author Rob Elves
* @author Mik Kersten
*/
-@SuppressWarnings({ "restriction" })
public class ContextRetrieveWizardPage extends WizardPage {
private final TaskRepository repository;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java
index 58127b488..7ec9fdaf6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java
@@ -47,8 +47,6 @@ public class Messages extends NLS {
public static String TaskRepositoryCredentialsDialog_Enter_Credentials;
- public static String TaskRepositoryCredentialsDialog_Enter_repository_certificate;
-
public static String TaskRepositoryCredentialsDialog_Enter_repository_credentials;
public static String TaskRepositoryCredentialsDialog_HTML_Open_Repository_Properties;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties
index 49c06ea12..dc33ef9d4 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties
@@ -21,7 +21,6 @@ TaskListSortDialog_Title=Task List Sorting
TaskRepositoryCredentialsDialog_ChooseCertificateFile=Browse...
TaskRepositoryCredentialsDialog_Enter_Credentials=Enter Credentials
TaskRepositoryCredentialsDialog_Enter_repository_credentials=Enter repository credentials
-TaskRepositoryCredentialsDialog_Enter_repository_certificate=Enter certificate details
TaskRepositoryCredentialsDialog_HTML_Open_Repository_Properties=<a href="properties">Open Repository Properties</a> to disable background synchronization by disconnecting the repository.
TaskRepositoryCredentialsDialog_Password=&Password:
TaskRepositoryCredentialsDialog_Repository_Authentication=Repository Authentication
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractHyperlinkTextPresentationManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractHyperlinkTextPresentationManager.java
index b8960cc74..00e4e7303 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractHyperlinkTextPresentationManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractHyperlinkTextPresentationManager.java
@@ -35,7 +35,10 @@ import org.eclipse.swt.custom.StyleRange;
*/
public abstract class AbstractHyperlinkTextPresentationManager {
- private static class RegionComparator implements Comparator<IRegion> {
+ /**
+ * Regions with a lower offset and a shorter length are ordered before other regions.
+ */
+ public static class RegionComparator implements Comparator<IRegion> {
public int compare(IRegion o1, IRegion o2) {
if (o1 == o2) {
@@ -47,8 +50,10 @@ public abstract class AbstractHyperlinkTextPresentationManager {
return 1;
} else if (o1.getLength() < o2.getLength()) {
return -1;
- } else {
+ } else if (o1.getLength() > o2.getLength()) {
return 1;
+ } else {
+ return 0;
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractTaskEditorAttributeSection.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractTaskEditorAttributeSection.java
index 6e6a3db21..eb630127e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractTaskEditorAttributeSection.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AbstractTaskEditorAttributeSection.java
@@ -332,7 +332,7 @@ public abstract class AbstractTaskEditorAttributeSection extends AbstractTaskEdi
String label = getModel().getTaskData().getAttributeMapper().getValueLabel(attribute);
if (label != null) {
if (sb.length() > 0) {
- sb.append(" / ");
+ sb.append(" / "); //$NON-NLS-1$
}
}
sb.append(label);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BrowserPreviewViewer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BrowserPreviewViewer.java
index 39320ea49..cba02b546 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BrowserPreviewViewer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/BrowserPreviewViewer.java
@@ -20,8 +20,7 @@ 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.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.mylyn.commons.workbench.browser.BrowserUtil;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
@@ -68,9 +67,7 @@ public class BrowserPreviewViewer {
if (event.location != null && !event.location.startsWith("about")) { //$NON-NLS-1$
event.doit = false;
- IHyperlink link = new TaskUrlHyperlink(
- new Region(0, 0)/* a fake region just to make constructor happy */, event.location);
- link.open();
+ BrowserUtil.openUrl(event.location);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PersonAttributeEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PersonAttributeEditor.java
index 42fb23043..40ee93f0c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PersonAttributeEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PersonAttributeEditor.java
@@ -26,6 +26,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -36,6 +37,8 @@ import org.eclipse.ui.forms.widgets.ImageHyperlink;
*/
public class PersonAttributeEditor extends TextAttributeEditor {
+ private ContentAssistCommandAdapter contentAssistCommandAdapter = null;
+
public PersonAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
super(manager, taskAttribute);
}
@@ -65,6 +68,8 @@ public class PersonAttributeEditor extends TextAttributeEditor {
final ImageHyperlink selfLink = new ImageHyperlink(composite, SWT.NO_FOCUS);
selfLink.setToolTipText(Messages.PersonAttributeEditor_Insert_My_User_Id_Tooltip);
+ //this is inserted to not get org.eclipse.swt.SWTException: Graphic is disposed on Mac OS Lion
+ selfLink.setImage(CommonImages.getImage(CommonImages.PERSON_ME_SMALL));
selfLink.setActiveImage(CommonImages.getImage(CommonImages.PERSON_ME_SMALL));
selfLink.setHoverImage(CommonImages.getImage(CommonImages.PERSON_ME_SMALL));
selfLink.addHyperlinkListener(new HyperlinkAdapter() {
@@ -85,7 +90,6 @@ public class PersonAttributeEditor extends TextAttributeEditor {
public void mouseEnter(MouseEvent e) {
((GridData) selfLink.getLayoutData()).exclude = false;
composite.layout();
- selfLink.setImage(CommonImages.getImage(CommonImages.PERSON_ME_SMALL));
selfLink.redraw();
version++;
}
@@ -98,7 +102,6 @@ public class PersonAttributeEditor extends TextAttributeEditor {
if (version != lastVersion || selfLink.isDisposed()) {
return;
}
- selfLink.setImage(null);
selfLink.redraw();
((GridData) selfLink.getLayoutData()).exclude = true;
composite.layout();
@@ -140,4 +143,12 @@ public class PersonAttributeEditor extends TextAttributeEditor {
getText().setBackground(color);
}
}
+
+ public ContentAssistCommandAdapter getContentAssistCommandAdapter() {
+ return contentAssistCommandAdapter;
+ }
+
+ public void setContentAssistCommandAdapter(ContentAssistCommandAdapter contentAssistCommandAdapter) {
+ this.contentAssistCommandAdapter = contentAssistCommandAdapter;
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart.java
index 8c12d03c2..e8bf8a836 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorRichTextPart.java
@@ -237,4 +237,15 @@ public class TaskEditorRichTextPart extends AbstractTaskEditorPart {
return (getEditor() != null) ? getEditor().getControl() : null;
}
+ @Override
+ public boolean setFormInput(Object input) {
+ if (input instanceof String && getAttribute() != null) {
+ if (input.equals(getAttribute().getId())) {
+ EditorUtil.focusOn(getTaskEditorPage().getManagedForm().getForm(), getControl());
+ return true;
+ }
+ }
+ return false;
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java
index 16a3849e5..30fabedc3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java
@@ -13,12 +13,15 @@ package org.eclipse.mylyn.internal.tasks.ui.editors;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.hyperlink.URLHyperlink;
+import org.eclipse.mylyn.commons.workbench.browser.UrlHyperlink;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.osgi.util.NLS;
/**
* @author Rob Elves
+ * @deprecated use {@link UrlHyperlink} instead
*/
+@Deprecated
public class TaskUrlHyperlink extends URLHyperlink {
private final String hyperlinkText;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java
index 59dd7da1d..b76048848 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java
@@ -23,6 +23,7 @@ import java.util.regex.Pattern;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.mylyn.commons.workbench.browser.UrlHyperlink;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.AbstractTaskHyperlinkDetector;
@@ -56,7 +57,7 @@ public class TaskUrlHyperlinkDetector extends AbstractTaskHyperlinkDetector {
while (m.find()) {
if (isInRegion(indexInContent, m)) {
String urlString = getUrlString(content, m);
- TaskUrlHyperlink link = null;
+ IHyperlink link = null;
if (getAdapter(TaskRepository.class) != null) {
try {
new URL(urlString);
@@ -104,8 +105,8 @@ public class TaskUrlHyperlinkDetector extends AbstractTaskHyperlinkDetector {
return (offsetInText == -1) || (offsetInText >= m.start() && offsetInText <= m.end());
}
- private static TaskUrlHyperlink createTaskUrlHyperlink(int textOffset, Matcher m, String urlString) {
- return new TaskUrlHyperlink(new Region(textOffset + m.start(), urlString.length()), urlString);
+ private static IHyperlink createTaskUrlHyperlink(int textOffset, Matcher m, String urlString) {
+ return new UrlHyperlink(new Region(textOffset + m.start(), urlString.length()), urlString);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotification.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotification.java
index c768ce4e3..727bc8f26 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotification.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotification.java
@@ -33,7 +33,7 @@ import org.eclipse.ui.PlatformUI;
*/
public class TaskListNotification extends AbstractUiNotification {
- private final static String ID_EVENT_TASK_CHANGED = "org.eclipse.mylyn.tasks.ui.events.TaskChanged";
+ private final static String ID_EVENT_TASK_CHANGED = "org.eclipse.mylyn.tasks.ui.events.TaskChanged"; //$NON-NLS-1$
private static DecoratingLabelProvider labelProvider;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotificationReminder.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotificationReminder.java
index 7624adbdb..e567287d5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotificationReminder.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotificationReminder.java
@@ -21,7 +21,7 @@ import org.eclipse.swt.graphics.Image;
*/
public class TaskListNotificationReminder extends TaskListNotification {
- private final static String ID_EVENT_TASK_DUE = "org.eclipse.mylyn.tasks.ui.events.TaskDue";
+ private final static String ID_EVENT_TASK_DUE = "org.eclipse.mylyn.tasks.ui.events.TaskDue"; //$NON-NLS-1$
public TaskListNotificationReminder(AbstractTask task) {
super(ID_EVENT_TASK_DUE, task);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index 9f19810b2..8e708cc91 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -1015,7 +1015,7 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener, I
.getString(ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_ID);
if (showMessage && lastClosedId.equals("")) { //$NON-NLS-1$
- ServiceMessage message = new ServiceMessage("welcome");
+ ServiceMessage message = new ServiceMessage("welcome"); //$NON-NLS-1$
message.setDescription(Messages.TaskListView_Welcome_Message);
message.setTitle(Messages.TaskListView_Welcome_Message_Title);
message.setImage(Dialog.DLG_IMG_MESSAGE_INFO);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard.java
index 5fa6f029f..1fc047bed 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/TaskDataImportWizard.java
@@ -45,7 +45,6 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.UIJob;
import com.ibm.icu.text.SimpleDateFormat;
@@ -116,32 +115,23 @@ public class TaskDataImportWizard extends Wizard implements IImportWizard {
public static boolean performFinish(final File sourceZipFile, final IWizardContainer container) {
TasksUi.getTaskActivityManager().deactivateTask(TasksUi.getTaskActivityManager().getActiveTask());
- TasksUiInternal.getTaskList().removeChangeListener(TaskWorkingSetUpdater.getInstance());
-
try {
+ TaskWorkingSetUpdater.setEnabled(false);
+
if (container != null) {
CommonUiUtil.run(container, new FileCopyJob(sourceZipFile));
} else {
WorkbenchUtil.busyCursorWhile(new FileCopyJob(sourceZipFile));
}
-
} catch (CoreException e) {
Status status = new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, NLS.bind(
"Problems encountered importing task data: {0}", e.getMessage()), e); //$NON-NLS-1$
TasksUiInternal.logAndDisplayStatus(Messages.TaskDataImportWizard_task_data_import_failed, status);
} catch (OperationCanceledException e) {
// canceled
+ } finally {
+ TaskWorkingSetUpdater.setEnabled(true);
}
-
- new UIJob("") { //$NON-NLS-1$
-
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- TasksUiInternal.getTaskList().addChangeListener(TaskWorkingSetUpdater.getInstance());
- return Status.OK_STATUS;
- }
- }.schedule();
-
return true;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java
index 49e664f75..74db4c51f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java
@@ -67,8 +67,9 @@ public class TaskWorkingSetElementFactory implements IElementFactory {
return project;
}
} catch (Throwable t) {
- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
- "Could not not determine project for handle: " + taskHandle, t)); //$NON-NLS-1$
+ // ignore, happens when a restoring a query handle from a URL for instance
+// StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+// "Could not not determine project for handle: " + taskHandle, t)); //$NON-NLS-1$
}
}
return null;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java
index d9b7966da..07e85b4dc 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetUpdater.java
@@ -57,8 +57,6 @@ public class TaskWorkingSetUpdater implements IWorkingSetUpdater, ITaskListChang
private final List<IWorkingSet> workingSets = new CopyOnWriteArrayList<IWorkingSet>();
- private static TaskWorkingSetUpdater INSTANCE;
-
private static class TaskWorkingSetDelta {
private final IWorkingSet workingSet;
@@ -94,12 +92,26 @@ public class TaskWorkingSetUpdater implements IWorkingSetUpdater, ITaskListChang
}
}
+ private static boolean enabled = true;
+
public TaskWorkingSetUpdater() {
- INSTANCE = this;
TasksUiInternal.getTaskList().addChangeListener(this);
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
+ /**
+ * Set <code>enabled</code> to false to disable processing of task list changes, e.g. during import operations.
+ *
+ * @param enabled
+ */
+ public static void setEnabled(boolean enabled) {
+ TaskWorkingSetUpdater.enabled = enabled;
+ }
+
+ public static boolean isEnabled() {
+ return enabled;
+ }
+
public void dispose() {
TasksUiInternal.getTaskList().removeChangeListener(this);
}
@@ -157,6 +169,9 @@ public class TaskWorkingSetUpdater implements IWorkingSetUpdater, ITaskListChang
}
public void containersChanged(Set<TaskContainerDelta> delta) {
+ if (!isEnabled()) {
+ return;
+ }
for (TaskContainerDelta taskContainerDelta : delta) {
if (taskContainerDelta.getElement() instanceof TaskCategory
|| taskContainerDelta.getElement() instanceof IRepositoryQuery) {
@@ -360,8 +375,4 @@ public class TaskWorkingSetUpdater implements IWorkingSetUpdater, ITaskListChang
}
}
- public static TaskWorkingSetUpdater getInstance() {
- return INSTANCE;
- }
-
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
index 3876fa2e8..fd30b8f8f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
@@ -23,6 +23,7 @@ import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.mylyn.commons.core.StatusHandler;
+import org.eclipse.mylyn.commons.workbench.EditorHandle;
import org.eclipse.mylyn.commons.workbench.browser.BrowserUtil;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
@@ -30,6 +31,8 @@ import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.internal.tasks.ui.util.TaskOpenEvent;
+import org.eclipse.mylyn.internal.tasks.ui.util.TaskOpenListener;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesView;
import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard;
@@ -369,6 +372,24 @@ public class TasksUiUtil {
}
/**
+ * @since 3.7
+ */
+ public static EditorHandle openTaskWithResult(TaskRepository repository, String taskId) {
+ Assert.isNotNull(repository);
+ Assert.isNotNull(taskId);
+ final EditorHandle handle = new EditorHandle();
+ boolean opened = TasksUiInternal.openTask(repository, taskId, new TaskOpenListener() {
+ @Override
+ public void taskOpened(TaskOpenEvent event) {
+ handle.setPart(event.getEditor());
+ handle.setItem(event.getTask());
+ handle.setStatus(Status.OK_STATUS);
+ }
+ });
+ return (opened) ? handle : null;
+ }
+
+ /**
* @since 3.0
*/
public static void openUrl(String location) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
index 568f59838..965d6f075 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java
@@ -1328,6 +1328,8 @@ public abstract class AbstractTaskEditorPage extends TaskFormPage implements ISe
// for outline
if (ID_PART_COMMENTS.equals(part.getPartId())) {
EditorUtil.setMarker(part.getControl(), TaskEditorOutlineNode.LABEL_COMMENTS);
+ } else if (ID_PART_ATTACHMENTS.equals(part.getPartId())) {
+ EditorUtil.setMarker(part.getControl(), TaskEditorOutlineNode.LABEL_ATTACHMENTS);
}
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkit.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkit.java
index 811e48eac..e9c0a44d7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkit.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AttributeEditorToolkit.java
@@ -99,6 +99,9 @@ public class AttributeEditorToolkit {
ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0], true);
adapter.setLabelProvider(labelPropsalProvider);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
+ if (editor instanceof PersonAttributeEditor) {
+ ((PersonAttributeEditor) editor).setContentAssistCommandAdapter(adapter);
+ }
}
}
} else if (editor instanceof RichTextAttributeEditor) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage2.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage2.java
index 1af171e34..da1b20e0d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage2.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage2.java
@@ -62,7 +62,6 @@ public abstract class AbstractRepositoryQueryPage2 extends AbstractRepositoryQue
private boolean firstTime = true;
- @SuppressWarnings("restriction")
private SectionComposite innerComposite;
/**
@@ -407,7 +406,6 @@ public abstract class AbstractRepositoryQueryPage2 extends AbstractRepositoryQue
progressContainer.setCancelButton(cancelButton);
}
- @SuppressWarnings("restriction")
protected abstract void createPageContent(SectionComposite parent);
protected void doClearControls() {
diff --git a/org.eclipse.mylyn.test-feature/feature.properties b/org.eclipse.mylyn.test-feature/feature.properties
index 87e90f827..007ef6ae0 100644
--- a/org.eclipse.mylyn.test-feature/feature.properties
+++ b/org.eclipse.mylyn.test-feature/feature.properties
@@ -11,7 +11,7 @@
featureName=Mylyn Tasks Tests SDK
description=Provides tests for the Mylyn Tasks project.
providerName=Eclipse Mylyn
-copyright=Copyright (c) 2007, 2011 Tasktop Technologies and others. All rights reserved.
+copyright=Copyright (c) 2007, 2012 Tasktop Technologies and others. All rights reserved.
license=\
Eclipse Foundation Software User Agreement\n\
diff --git a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java
index 7c023474c..54ae16bb2 100644
--- a/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java
+++ b/org.eclipse.mylyn.tests.util/src/org/eclipse/mylyn/tests/util/TestUtil.java
@@ -47,6 +47,14 @@ public class TestUtil {
public String toString() {
return getClass().getSimpleName() + " [username=" + username + ",password=" + password + "]";
}
+
+ public String getShortUserName() {
+ if (username.contains("@")) {
+ return username.substring(0, username.indexOf("@"));
+ }
+ return username;
+ }
+
}
public static Credentials readCredentials() {
diff --git a/org.eclipse.mylyn.trac-feature/feature.properties b/org.eclipse.mylyn.trac-feature/feature.properties
index 20917abcd..bd0f8ccdc 100644
--- a/org.eclipse.mylyn.trac-feature/feature.properties
+++ b/org.eclipse.mylyn.trac-feature/feature.properties
@@ -11,7 +11,7 @@
featureName=Mylyn Tasks Connector: Trac
description=Provides Task List integration, offline support and rich editing for the open source Trac issue tracker.
providerName=Eclipse Mylyn
-copyright=Copyright (c) 2006, 2011 Steffen Pingel and others. All rights reserved.
+copyright=Copyright (c) 2006, 2012 Steffen Pingel and others. All rights reserved.
license=\
Eclipse Foundation Software User Agreement\n\
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskMapper.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskMapper.java
index 3bdb5af14..85da05feb 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskMapper.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskMapper.java
@@ -124,10 +124,14 @@ public class TracTaskMapper extends TaskMapper {
@Override
public PriorityLevel getPriorityLevel() {
- if (client != null) {
- String priority = getPriority();
- TracPriority[] tracPriorities = client.getPriorities();
- return TracRepositoryConnector.getTaskPriority(priority, tracPriorities);
+ String priority = getPriority();
+ if (priority != null) {
+ if (client != null) {
+ TracPriority[] tracPriorities = client.getPriorities();
+ return TracRepositoryConnector.getTaskPriority(priority, tracPriorities);
+ } else {
+ return TracRepositoryConnector.getTaskPriority(priority);
+ }
}
return null;
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/AbstractTracClient.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/AbstractTracClient.java
index c9246a9c5..a33495b56 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/AbstractTracClient.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/AbstractTracClient.java
@@ -176,18 +176,16 @@ public abstract class AbstractTracClient implements ITracClient {
public TracTicketField getTicketFieldByName(String name) {
if (data.ticketFields != null) {
- // lazily fill fieldByName map
- if (data.ticketFieldByName == null) {
- synchronized (data) {
- if (data.ticketFieldByName == null) {
- data.ticketFieldByName = new HashMap<String, TracTicketField>();
- for (TracTicketField field : data.ticketFields) {
- data.ticketFieldByName.put(field.getName(), field);
- }
+ synchronized (this) {
+ // lazily fill fieldByName map
+ if (data.ticketFieldByName == null) {
+ data.ticketFieldByName = new HashMap<String, TracTicketField>();
+ for (TracTicketField field : data.ticketFields) {
+ data.ticketFieldByName.put(field.getName(), field);
}
}
+ return data.ticketFieldByName.get(name);
}
- return data.ticketFieldByName.get(name);
}
return null;
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java
index 21dc8dafc..307a254f8 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java
@@ -678,6 +678,7 @@ public class TracWebClient extends AbstractTracClient {
while ((tokenType = t.nextToken()) != StreamTokenizer.TT_EOF) {
switch (tokenType) {
case StreamTokenizer.TT_WORD:
+ case '"':
if (state == AttributeState.IN_LIST) {
attributeFactory = configuration.getFactoryByField(t.sval);
if (attributeFactory != null) {
@@ -685,10 +686,7 @@ public class TracWebClient extends AbstractTracClient {
}
} else if (state == AttributeState.IN_ATTRIBUTE_KEY) {
attributeType = t.sval;
- }
- break;
- case '"':
- if (state == AttributeState.IN_ATTRIBUTE_VALUE_LIST && "options".equals(attributeType)) { //$NON-NLS-1$
+ } else if (state == AttributeState.IN_ATTRIBUTE_VALUE_LIST && "options".equals(attributeType)) { //$NON-NLS-1$
if (attributeFactory != null) {
attributeFactory.addAttribute(t.sval);
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracTicketAttribute.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracTicketAttribute.java
index 090851b00..2b842db2b 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracTicketAttribute.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracTicketAttribute.java
@@ -33,6 +33,31 @@ public class TracTicketAttribute implements Comparable<TracTicketAttribute>, Ser
return value - o.value;
}
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ TracTicketAttribute other = (TracTicketAttribute) obj;
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ if (value != other.value) {
+ return false;
+ }
+ return true;
+ }
+
public String getName() {
return name;
}
@@ -42,6 +67,15 @@ public class TracTicketAttribute implements Comparable<TracTicketAttribute>, Ser
}
@Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + value;
+ return result;
+ }
+
+ @Override
public String toString() {
return name;
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
index 0a654b3b2..91ecaf15f 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
@@ -46,6 +46,7 @@ import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
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.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -246,6 +247,7 @@ public class TracRepositoryConnectorTest extends TestCase {
TracTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
ITracClient client = connector.getClientManager().getTracClient(repository);
+ client.updateAttributes(new NullProgressMonitor(), false);
TaskData taskData = taskDataHandler.createTaskDataFromTicket(client, repository, ticket, null);
ITask task = TasksUi.getRepositoryModel().createTask(repository, taskData.getTaskId());
@@ -258,25 +260,39 @@ public class TracRepositoryConnectorTest extends TestCase {
}
public void testUpdateTaskFromTaskDataSummaryOnly() throws Exception {
- TracTicket ticket = new TracTicket(456);
- ticket.putBuiltinValue(Key.SUMMARY, "mysummary");
-
TracTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
ITracClient client = connector.getClientManager().getTracClient(repository);
+ // ensure that client has the correct field configuration
+ client.updateAttributes(new NullProgressMonitor(), true);
assertEquals(client.getAccessMode().name(), repository.getVersion());
+
+ // prepare task data
+ TracTicket ticket = new TracTicket(456);
+ ticket.putBuiltinValue(Key.SUMMARY, "mysummary");
TaskData taskData = taskDataHandler.createTaskDataFromTicket(client, repository, ticket, null);
+ TaskAttribute attribute = taskData.getRoot().getMappedAttribute(TaskAttribute.PRIORITY);
+ System.err.println(taskData.getRoot());
+ if (attribute != null) {
+ assertEquals("major", attribute.getValue());
+ }
+
ITask task = TasksUi.getRepositoryModel().createTask(repository, taskData.getTaskId());
+ task.setPriority("P2");
+ // create task from task data
+ System.err.println(Arrays.asList(client.getPriorities()));
+ System.err.println(client.getTicketFieldByName("priority"));
connector.updateTaskFromTaskData(repository, task, taskData);
assertEquals(repository.getRepositoryUrl() + ITracClient.TICKET_URL + "456", task.getUrl());
assertEquals("456", task.getTaskKey());
assertEquals("mysummary", task.getSummary());
- assertEquals("P3", task.getPriority());
// depending on the access mode createTaskDataFromTicket() creates different default attributes
if (client.getAccessMode() == Version.TRAC_0_9) {
assertEquals(AbstractTask.DEFAULT_TASK_KIND, task.getTaskKind());
+ assertEquals("P2", task.getPriority());
} else {
assertEquals("Defect", task.getTaskKind());
+ assertEquals("P3", task.getPriority());
}
}
@@ -303,4 +319,4 @@ public class TracRepositoryConnectorTest extends TestCase {
assertEquals(new Date(123 * 1000), task.getCompletionDate());
}
-} \ No newline at end of file
+}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryQueryTest.java
index 75de15692..41570ef54 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryQueryTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryQueryTest.java
@@ -32,7 +32,7 @@ import org.eclipse.mylyn.trac.tests.support.TracTestConstants;
public class TracRepositoryQueryTest extends TestCase {
public void testChangeRepositoryUrl() throws Exception {
- TaskRepository repository = TracFixture.DEFAULT.singleRepository();
+ TaskRepository repository = TracFixture.TRAC_0_12_XML_RPC.singleRepository();
TracSearch search = new TracSearch();
String queryUrl = repository.getRepositoryUrl() + ITracClient.QUERY_URL + search.toUrl();
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
index e4c75bf1a..fa430809e 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
@@ -93,6 +93,8 @@ public class TracTaskDataHandlerXmlRpcTest extends TestCase {
public void testMarkStaleTasks() throws Exception {
SynchronizationSession session;
+ // sleep for one second to ensure that the created ticket has a unique time stamp
+ Thread.sleep(1000);
TracTicket ticket = TracTestUtil.createTicket(client, "markStaleTasks");
ITask task = TracTestUtil.createTask(repository, ticket.getId() + "");
long lastModified = TracUtil.toTracTime(task.getModificationDate());
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java
index e6c9afe86..dc74dc68c 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/Messages.java
@@ -73,14 +73,10 @@ public class Messages extends NLS {
public static String TracQueryPage_Milestone;
- public static String TracQueryPage_No_repository_available;
-
public static String TracQueryPage_Owner;
public static String TracQueryPage_Priority;
- public static String TracQueryPage_Query_Title;
-
public static String TracQueryPage_Reporter;
public static String TracQueryPage_Resolution;
@@ -91,10 +87,6 @@ public class Messages extends NLS {
public static String TracQueryPage_Type;
- public static String TracQueryPage_Update_Attributes_Failed;
-
- public static String TracQueryPage_Update_Attributes_from_Repository;
-
public static String TracQueryPage_Version;
public static String TracRepositorySettingsPage_Access_Type_;
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties
index aadda7252..4f168a184 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/messages.properties
@@ -33,17 +33,13 @@ TracQueryPage_Enter_query_parameters=Enter query parameters
TracQueryPage_If_attributes_are_blank_or_stale_press_the_Update_button=If attributes are blank or stale press the Update button.
TracQueryPage_Keywords=Keywords
TracQueryPage_Milestone=Milestone
-TracQueryPage_No_repository_available=No repository available, please add one using the Task Repositories view.
TracQueryPage_Owner=Owner
TracQueryPage_Priority=Priority
-TracQueryPage_Query_Title=Query Title:
TracQueryPage_Reporter=Reporter
TracQueryPage_Resolution=Resolution
TracQueryPage_Status=Status
TracQueryPage_Summary=Summary
TracQueryPage_Type=Type
-TracQueryPage_Update_Attributes_Failed=Update Attributes Failed
-TracQueryPage_Update_Attributes_from_Repository=Update Attributes from Repository
TracQueryPage_Version=Version
TracRepositorySettingsPage_Access_Type_=Access Type:

Back to the top