Bug 255588 - [api][context] clearing context does not clear editor memento
Summary: [api][context] clearing context does not clear editor memento
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 minor (vote)
Target Milestone: 3.2   Edit
Assignee: Shawn Minto CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on: 265688
Blocks:
  Show dependency tree
 
Reported: 2008-11-17 22:46 EST by Steffen Pingel CLA
Modified: 2009-05-21 16:59 EDT (History)
1 user (show)

See Also:


Attachments
patch (62.10 KB, patch)
2009-05-01 18:57 EDT, Shawn Minto CLA
no flags Details | Diff
mylyn/context/zip (9.96 KB, application/octet-stream)
2009-05-01 18:57 EDT, Shawn Minto CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2008-11-17 22:46:41 EST
Steps:
1. Activate task and open editors
2. Deactivate task
3. Clear Context
4. Reactivate context

The editors are restored since step 3 does not remove the editor memento if the task is not active when clearing the context.
Comment 1 Steffen Pingel CLA 2009-01-20 01:30:12 EST
The underlying problem is that context is null in the delete event if a context other than the active context is deleted.
Comment 2 Steffen Pingel CLA 2009-02-19 16:03:14 EST
Shawn, let's touch base how to change AbstractContextListener to support this case better.
Comment 3 Shawn Minto CLA 2009-04-30 13:24:44 EDT
Initial thoughts on new API so we can fix this bug:

enum Kind{

	CLEARED, LANDMARK_ADDED;

}

ContextChangeEvent{

	String contextHandle;
	Context context;
	Kind eventKind;
	List<IInteractionElement> elements;

}

add AbstractContextListener.contextUpdated(ContextChangeEvent event){

	// switch and call the old listeners by default

}

Steffen, what do you think?
Comment 4 Steffen Pingel CLA 2009-04-30 13:59:54 EDT
Looks good to me.
Comment 5 Shawn Minto CLA 2009-05-01 18:57:21 EDT
Created attachment 134129 [details]
patch

I updated the AbstractContextListener API as per comment #3 which has allowed me to be able to recognize the context that is cleared to clear the memento.
Comment 6 Shawn Minto CLA 2009-05-01 18:57:24 EDT
Created attachment 134130 [details]
mylyn/context/zip
Comment 7 Shawn Minto CLA 2009-05-01 18:57:48 EDT
committed.