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

Bug 331154

Summary: [api] extend TaskOperation to support tooltip and enablement
Product: z_Archived Reporter: Frank Becker <eclipse>
Component: MylynAssignee: Frank Becker <eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P1 CC: robert.elves, steffen.pingel
Version: unspecifiedKeywords: noteworthy
Target Milestone: 3.5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 331626    
Bug Blocks: 329164    
Attachments:
Description Flags
API change
none
mylyn/context/zip
none
patch V2
none
mylyn/context/zip
none
patch V3
eclipse: review?
mylyn/context/zip
none
adds TaskAttribute.META_DISABLED none

Description Frank Becker CLA 2010-11-25 15:52:51 EST
I want to add the following two new features.

1) enable/disable of an TaskOperation
2) add Tooltip support

Patch is coming soon.
Comment 1 Frank Becker CLA 2010-11-25 16:42:00 EST
Created attachment 183891 [details]
API change

Here is the patch.

Should I wait with commit this to HEAD until the review is completed?
Comment 2 Frank Becker CLA 2010-11-25 16:42:02 EST
Created attachment 183892 [details]
mylyn/context/zip
Comment 3 Steffen Pingel CLA 2010-11-25 17:20:46 EST
Let's wait with committing until we have converged on the implementation. Can you describe the purpose of the tooltip and enablement attribute? From the patch I can't see how they would be used, e.g. in the editor.
Comment 4 Frank Becker CLA 2010-11-26 17:50:16 EST
(In reply to comment #3)
> Let's wait with committing until we have converged on the implementation. Can
> you describe the purpose of the tooltip and enablement attribute? From the
> patch I can't see how they would be used, e.g. in the editor.

OK I do this over the weekend and post an updated patch with the editor stuff.

In Bugzilla 4.0 the workflow has state UNCONFIRMED and this can be turn on and of per product base. This is why I add the Enable/Disable.

Tooltips are used tho show details like: CONFIRMED operation on new bugs tell yo that you should select the default operation if you did not know that you can set this state.
Comment 5 Frank Becker CLA 2010-11-27 16:54:24 EST
Created attachment 183987 [details]
patch V2

Now I found a way to only change TaskAttribute and TaskEditorActionPart.
Comment 6 Frank Becker CLA 2010-11-27 16:54:26 EST
Created attachment 183988 [details]
mylyn/context/zip
Comment 7 Frank Becker CLA 2010-12-02 15:44:30 EST
Created attachment 184400 [details]
patch V3

now I use the readonly meta for enable/disable the operation.
Comment 8 Frank Becker CLA 2010-12-02 15:44:33 EST
Created attachment 184401 [details]
mylyn/context/zip
Comment 9 Steffen Pingel CLA 2010-12-10 15:30:31 EST
Please feel free to apply. Only change I would like to request is renaming META_TOOLTIP to META_DESCRIPTION. My sense is that the data model should not reference specific UI elements but provide a generic model of a task.
Comment 10 Frank Becker CLA 2010-12-10 15:37:06 EST
(In reply to comment #9)
> Please feel free to apply. Only change I would like to request is renaming
> META_TOOLTIP to META_DESCRIPTION. My sense is that the data model should not
> reference specific UI elements but provide a generic model of a task.

Patch is now in HEAD with your requested change.
Comment 11 Shawn Minto CLA 2010-12-13 15:43:50 EST
Whenever I open a bug, the operations are disabled until i refresh it.  Reopening
Comment 12 Frank Becker CLA 2010-12-14 15:06:40 EST
(In reply to comment #11)
> Whenever I open a bug, the operations are disabled until i refresh it. 
> Reopening

This is because the Task Meta has change, so we need one refresh to have the  Task Meta up to date.
Comment 13 Steffen Pingel CLA 2010-12-14 15:40:15 EST
We need to do this in a backwards compatible way, i.e. the default should be to enable operations.
Comment 14 Frank Becker CLA 2010-12-14 16:05:38 EST
(In reply to comment #13)
> We need to do this in a backwards compatible way, i.e. the default should be to
> enable operations.

Steffen,

the problem is that during open of a Task we create the Controls but the background synchronize of the Task set the readonly to the correct value but did not force an redraw of the open Editor.

Thoughts?
Comment 15 Steffen Pingel CLA 2010-12-14 16:46:33 EST
I'll take a look. The framework basically needs to behave in backwards compatible way, i.e. enable the controls if the state is not known.
Comment 16 Steffen Pingel CLA 2010-12-15 14:47:35 EST
I have commented the enablement out for now. We'll have to revisit this and potentially introduce a new flag for enabling and disabling of actions to maintain backwards compatibility. I'll look into this in more detail next week.
Comment 17 Steffen Pingel CLA 2011-02-02 01:33:37 EST
Created attachment 188117 [details]
adds TaskAttribute.META_DISABLED
Comment 18 Steffen Pingel CLA 2011-02-02 01:35:16 EST
I have reviewed this and added a new attribute TaskAttribute.META_DISABLED which is null/false by default and hence should not have any side effects as controls will be enabled by default. Frank, can you make the necessary changes in Bugzilla to make use of the new flag?
Comment 19 Steffen Pingel CLA 2011-02-02 01:46:22 EST
Looks like we are done here.