txt book

Showing posts with label gsoc2010. Show all posts
Showing posts with label gsoc2010. Show all posts

Tuesday, July 20, 2010

Mylyn Bridge for EcoreTools Editor - 1

EcoreTools Diagram Editor is a GMF based editor for editing ecore files. I will implement a Mylyn Bridge for it.

After a long time of trying and testing, here are the things I've learned.
1. When implementing a bridge, it's a good idea to start with the EditingMonitor. Because the monitor does not need any other classes to support it, and you can directly see the result from the current context.

2. The next thing is to implement the StructureBridge and UIBridge. The main idea of the bridge is to create a mapping between objects and Strings(handles). When the mapping is created, Mylyn can deal with the Strings without worrying about the real objects. During implementation, it is always a good idea to learn from the existing implementations[1][2][3]. For EcoreTools Diagram Editor, there are a lot of generated files, I found org.eclipse.gmf.ecore.navigator.EcoreNavigatorContentProvider[4] useful to take a look at for the object mapping.

For now, my implementation is not complete, but it could work[5]. The next step is to make it better (mainly focus on UIBridge).

[1] http://grepcode.com/file/repository.grepcode.com/java/eclipse.org/3.5/org.eclipse.mylyn.java/ui/3.2.0/org/eclipse/mylyn/internal/java/ui/JavaStructureBridge.java
[2] http://grepcode.com/file/repository.grepcode.com/java/eclipse.org/3.5/org.eclipse.mylyn.ide/ant/3.2.0/org/eclipse/mylyn/internal/ide/ant/AntStructureBridge.java
[3] http://grepcode.com/file/repository.grepcode.com/java/eclipse.org/3.5/org.eclipse.mylyn.resources/ui/3.2.0/org/eclipse/mylyn/internal/resources/ui/ResourceStructureBridge.java
[4] http://grepcode.com/file/repository.grepcode.com/java/eclipse.org/3.5/org.eclipse.gmf.ecore/editor/2.1.0/org/eclipse/gmf/ecore/navigator/EcoreNavigatorContentProvider.java
[5] http://code.google.com/a/eclipselabs.org/p/mylyn-gmf-ui/source/browse/#svn/trunk/everyday.test/org.eclipselabs.mylyn.internal.ide.ecoretools

Friday, June 04, 2010

Say hi and the first post of GSoC: Mylyn Context + Zest test

Hi eclipse community! My name is Yongming Luo. I am from China. I am a participant for Google Summer of Code 2010. My topic is "Integrate GMF runtime with Mylyn task focused UI". So this series of blogs will share my explorations to this topic, with both success and failures. I am glad to here any comment from you.

In this post I want to show an experiment I did recently. Using eclipse zest to show the context information of the current task context.

Mylyn is a powerful tool to let the programmers focus on the things they are doing. One's focus interests are organized as tasks in workspace. For each task, there is a list which holds the related files and resources. What I want to do is to get the list and show them as a graph in a view. I by chance read something about eclipse zest toolkit[2], which is easy to use to implement the experiment, so I use zest in this post.

To get the current context in workspace, I use the following code[1]:

Context could change. To listen to this change, it's good to create a listener and add it to the context manager.
public class ContextListener extends AbstractContextListener{
 public void contextChanged(ContextChangeEvent event) {
  switch(event.getEventKind()) {
  case CLEARED:

Each task has a life-cycle, and fires several events to the listeners: PRE_ACTIVATED->ACTIVATED->DEACTIVATED. With these events we can do the modification to the graph view synchronously.

For the view, I simply use GraphNode class to present the java files in the context. Every time when there is a task switch or one task is cleared, I clear the view.

You can download the plug-in from svn:
svn checkout http://svn.codespot.com/a/eclipselabs.org/mylyn-gmf-ui/trunk/ mylyn-gmf-ui-read-only

or download it directly (org.eclipselabs.gsoc.test1.zip)

This is an eclipse plug-in project, with dependencies from both mylyn and zest. You have to install them first to run the plug-in. The screen cast of the plug-in is like the following:

Details can be found in the comments of the code.
[1] http://www.vogella.de/blog/2009/10/05/modifying-mylyn-context/
[2] http://www.vogella.de/articles/EclipseZest/article.html

Friday, April 30, 2010

Hi Eclipse Community

This is the first post for Eclipse GSoC 2010.