Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332697 - provide api for flushing editor mementos
Summary: provide api for flushing editor mementos
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.7   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 226618
  Show dependency tree
 
Reported: 2010-12-15 19:07 EST by Sam Davis CLA
Modified: 2012-02-23 20:48 EST (History)
1 user (show)

See Also:


Attachments
mylyn/context/zip (1.08 KB, application/octet-stream)
2012-02-23 20:48 EST, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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