Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331571

Summary: [api] tasks framework should invoke updateTaskFromTaskData() for new tasks
Product: z_Archived Reporter: Shawn Minto <shawn.minto>
Component: MylynAssignee: Sam Davis <sam.davis>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: steffen.pingel
Version: unspecifiedKeywords: contributed, noteworthy
Target Milestone: 3.5   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch
none
mylyn/context/zip
none
clipboard.txt
none
clipboard.txt steffen.pingel: iplog+

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.