Integrate GMF runtime with Mylyn task focused UI
Mylyn is a task management framework. By using it, the workspace can have different "snapshots" for different tasks. When one task is selected, only the related objects (files, opened windows, etc.) are shown in the workspace. That is so called "task focused UI". On the other hand, the GMF runtime provides a common graphical notation model for every Eclipse Modeler. By combining the two techniques together, a mylyn bridge can be developed, showing the graphical elements in editor depending on the relevance of the current task. This project can also be an example to show how to integrate GMF techniques to a real project.
The generated GMF editor used in this project is EcoreTools Editor. The development procedure is divided into two parts:
- A mylyn bridge that fits for the generated GMF editor
- A context listener that listens to the context and changes the representation of the diagrams in the editor
Context Listener listens to the changes of the current context and do actions according to it. This blog post I wrote includes an example of implementing a mylyn context listener and showing the context by zest framework. The idea is to extend the AbstractContextListener class, while all the events are passed through contextChanged() method. In my implementation, the context listener is added to the workspace when the plug-in is started (EcoreToolsUIBridgePlugin.start()), and removed when the plug-in is stopped. Whenever there is an event, the editor will be refreshed and all the diagrams in the editor will change their representations if it's needed (EcoreToolsUtil.refreshEditor()).