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

Bug 332697

Summary: provide api for flushing editor mementos
Product: z_Archived Reporter: Sam Davis <sam.davis>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: steffen.pingel
Version: unspecified   
Target Milestone: 3.7   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 226618    
Attachments:
Description Flags
mylyn/context/zip none

Description Sam Davis CLA 2010-12-15 19:07:05 EST
It would be useful to have a way to save the editor memento for a task without having to deactivate the task.
Comment 1 Steffen Pingel CLA 2010-12-26 10:35:22 EST
That functionality is part of the workbench. It's unlikely that Mylyn will provide public API to enable this outside of task activation. Can you provide a concrete use case?
Comment 2 Sam Davis CLA 2011-01-03 12:36:12 EST
I am working on a connector that shares task context and editor mementos with a server, and I don't want to have to deactivate and reactivate the task every time the user activates this functionality.
Comment 3 Steffen Pingel CLA 2011-01-03 12:45:53 EST
Task context and editor mementos are considered private to the user's workspace and are only shared explicitly. Can you provide more detail about the workflow you are implementing in your connector? What would the API that you need look like?
Comment 4 Sam Davis CLA 2011-01-03 12:55:50 EST
When the user creates a task of a particular kind, they have the option to attach the context for the active task to the new task. This is done using org.eclipse.mylyn.internal.context.ui.ContextEditorManager.copyEditorMemento(String, String). The problem is that the editor memento that gets copied is not the current one, but the one that was last saved. So I just want a way to cause the current memento to be saved without having to deactivate the active task.
Comment 5 Steffen Pingel CLA 2011-01-03 20:46:43 EST
Got you. Let's consider that as part of bug 226618.
Comment 6 Steffen Pingel CLA 2012-02-23 20:48:31 EST
This has been addressed as part of bug 332697. ContextStateHandler can now be used to persist the workbench state for a context:

 ContextStateHandler handler = new ContextStateHandler(ContextUiPlugin.getDefault().getStateManager());
 handler.save(context)
 
We could also consider saving the state when TaskContextStore.saveActiveContext() is invoked but that has not been implemented, yet.
Comment 7 Steffen Pingel CLA 2012-02-23 20:48:34 EST
Created attachment 211548 [details]
mylyn/context/zip