Bug 331571 - [api] tasks framework should invoke updateTaskFromTaskData() for new tasks
Summary: [api] tasks framework should invoke updateTaskFromTaskData() for new tasks
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.5   Edit
Assignee: Sam Davis CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
Depends on:
Blocks:
 
Reported: 2010-12-01 12:23 EST by Shawn Minto CLA
Modified: 2011-01-13 23:31 EST (History)
1 user (show)

See Also:


Attachments
patch (3.44 KB, patch)
2011-01-10 20:49 EST, Sam Davis CLA
no flags Details | Diff
mylyn/context/zip (17.56 KB, application/octet-stream)
2011-01-10 20:49 EST, Sam Davis CLA
no flags Details
clipboard.txt (2.39 KB, text/plain)
2011-01-11 13:29 EST, Sam Davis CLA
no flags Details
clipboard.txt (2.56 KB, patch)
2011-01-11 13:56 EST, Sam Davis CLA
steffen.pingel: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Minto CLA 2010-12-01 12:23:00 EST
Some connectors use information on the ITask to determine task kind labels and other information.  When a new task is created, there is no way that this can be set to ensure that the UI has the information that it needs on the ITask.  There should be some way of being able to updateTaskFromTaskData with new task data before the new task editor is opened.
Comment 1 Steffen Pingel CLA 2010-12-01 13:30:20 EST
+1 Shawn, if you make that change please watch for backwards compatibility problems. We may need to introduce another method, e.g. updateNewTaskFromTaskData() if this breaks existing connectors.
Comment 2 Shawn Minto CLA 2010-12-07 12:40:57 EST
I think that we will need to have a new method as many that I know of assume that the task data is not new and has valid values for some task attributes.  Also, for new tasks, I would assume that less information would need to be stored on the task than for existing tasks.  I will have a look into adding this new API.
Comment 3 Sam Davis CLA 2011-01-10 20:49:02 EST
Created attachment 186453 [details]
patch

I think this should do it. Note that there could be other callers of org.eclipse.mylyn.tasks.ui.TasksUiUtil.createOutgoingNewTask(String, String) outside of Mylyn, and they may want to call updateNewTaskFromTaskData() themselves.
Comment 4 Sam Davis CLA 2011-01-10 20:49:04 EST
Created attachment 186454 [details]
mylyn/context/zip
Comment 5 Steffen Pingel CLA 2011-01-10 21:16:48 EST
Thanks Sam. Can you merge the new method into AbstractRepositoryConnector and add some documentation and an appropriate @since tag? The default implementation should simply do nothing.
Comment 6 Sam Davis CLA 2011-01-11 13:29:08 EST
Created attachment 186538 [details]
clipboard.txt

Modified patch.
Comment 7 Sam Davis CLA 2011-01-11 13:56:52 EST
Created attachment 186544 [details]
clipboard.txt

Patch that passes the correct task repository...
Comment 8 Steffen Pingel CLA 2011-01-11 14:16:25 EST
Thanks. Patch applied to head.