Bug 7235

Summary: [Contributions] Need dispose() for action delegates
Product: [Eclipse Project] Platform Reporter: Nick Edgar <n.a.edgar>
Component: UIAssignee: Simon Arsenault <simon_arsenault>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Darin_Swanson, hudsonr, lavinm
Version: 2.0Keywords: api, investigate
Target Milestone: 2.1 M4   
Hardware: Other   
OS: other   
Whiteboard:
Bug Depends on:    
Bug Blocks: 7012, 7122    

Description Nick Edgar CLA 2002-01-03 10:25:31 EST
Action delegates should have a dispose() method so they can unhook any 
listeners they have hooked.

See bug 7122.
Comment 1 Darin Swanson CLA 2002-01-31 17:28:18 EST
The debug team was wondering what is the milestone for this bug?
Comment 2 Nick Edgar CLA 2002-02-01 14:57:47 EST
How critical is this for you?
Is it actually preventing you from doing something, or just not elegant?
Comment 3 Darin Swanson CLA 2002-02-01 15:08:26 EST
I am currently coding the workaround. For example:IViewActionDelegates have to 
register as IPartListeners and then dispose themselves when their view closes.

So we do have a workaround but it is definately less than elegant and would 
just disappear with the dipose method added.
Comment 4 Nick Edgar CLA 2002-02-01 15:14:18 EST
I agree this is suboptimal.
Will investigate for M4.
Comment 5 Darin Swanson CLA 2002-04-04 22:02:45 EST
Is this going to make it for 2.0?
Comment 6 Nick Edgar CLA 2002-04-04 22:30:16 EST
Will do for early M6.
There are several issues in doing this:
- Contribution managers don't have dispose (should add this too).
- Can't just add dispose() to IActionDelegate since that would be a breaking 
API change.  Could add IActionDelegateWithDispose, similar to 
IActionDelegateWithEvent. This gets pretty unwieldy though.

Could add IActionDelegate2 (for lack of a better name) which extends 
IActionDelegate with run(IAction, Event) and dispose().
Would you be willing to change your existing IActionDelegateWithEvent 
implementations?

Comment 7 Darin Swanson CLA 2002-04-05 08:08:55 EST
For the code this would remove from our action delegates, I would be happy to 
update as necessary.
Comment 8 Nick Edgar CLA 2002-04-15 16:53:36 EDT
*** Bug 13833 has been marked as a duplicate of this bug. ***
Comment 9 Nick Edgar CLA 2002-04-22 10:54:38 EDT
*** Bug 14253 has been marked as a duplicate of this bug. ***
Comment 10 Nick Edgar CLA 2002-06-14 15:38:16 EDT
Was not able to do this for 2.0.
Comment 11 Simon Arsenault CLA 2002-12-02 14:57:31 EST
Added IActionDelegate2 which provides the lifecycle methods for action 
delegates. It also replaces IActionDelegateWithEvent interface which now is 
marked as deprecated. Will be in 20021203 integration build.