Thursday, 13th October 2011
Follow WikiJava on twitter now. @Wikijava

Mylyn basic tutorial

From WikiJava

Jump to: navigation, search
The author suggests:

buy this book


This tutorial will introduce you to Mylyn and it's features.

Mylyn is a task focused GUI plugin for Eclipse. It is very useful to simplify the development and management of big projects. The main concepts that Mylyn introduces to Eclipse are Task and Context. These two concepts let you manage big projects with the same simplicity of small ones.

Contents

the article

Introduction to Mylyn

Mylyn introduces in Eclipse the concept of context.

Before explaining what a context is we need to understand better the concept of task:

a task is an atomic unit of work which is part of the development of a software.

The whole process of producing a software or debugging it is then an ordered set of tasks. For example if we were creating a web application a task may be the creation of the java file containing a servlet.

When using Mylyn you can define the tasks and save them in the Mylyn's task repository. You can then activate a task and work on it.

The context of a task is the set of files, classes, methods and variables involved in the working for the task.

In the above example the context would be the file containing the servlet, its directory on the disk, it's package and all the data you need for solving the task.

Mylyn is able to deduce the context for a task by monitoring your activities in Eclipse when the task is active. When you activate a task, Mylyn opens the context for the task so in Eclipse you will only see the files and methods relevant to the task. This is very useful because it simplifies the process of finding the data you need. Especially in big projects this is a great thing since it allows you to focus on the actual task rather than spending too much time searching in the package explorer view.

Mylyn has built in a local task repository to store your tasks. You can also connect to a remote repository such as Trac, Bugzilla or Jira. This powerful feature makes it really precious when working in team, because it helps to centralize the management of the tasks. Using Mylyn you can easily view, create, edit and solve tasks within Eclipse. For some repositories Mylyn can also export contexts, so you can share them with the other developers in your team, and speedup the work.

In addition Mylyn is that it monitors the time spent on a task and you can specify when the task has to be done, a great help for the Project Manager.

Connecting to a remote repository

Mylyn supports the most common task repositories, you just need to install the specific Mylyn Connector, from the find and install Wizard (Help -> software updates -> find and install...) click on "search for new features and install" and then select the "Mylyn Extras" repository.

Once you've installed the connector open the Task Repositories view (from Window -> show view -> other -> Mylyn -> Task Repositories).

You will see two preconfigured task repositories: "Local tasks" and the "Eclipse.org" this second one is the repository for eclipse tasks, here you can submit Eclipse bugs, if you find any.

To connect to your remote repository right click on a white area in the Task Repositories view and select Add task Repository. Select the connector to use and, in the next window, insert the information required. The finish button will not be active at this time. To activate it you need to hit on the validate settings button, which basically verifies if eclipse is able to connect to the repository and activates the finish button.

Creating a query

After hitting on finish in the "Add task Repository" window, you will be prompted the new query wizard. This wizard will help you in creating a view on the repository. If you just type "all tasks" in the query title field and hit on the Finish button. Mylyn will create a query for showing you all the open tasks in the repository. You can use the other fields to narrow your query to more specific tasks.

You can also activate the new query wizard by right clicking on a white area of the Task List view, then hit on new and on query.

The next section will explain how to activate the Task List view.

Viewing the tasks

To activate the Task List view hit on

Window -> show view -> other -> Mylyn -> Task List

you will see a new view containing all the tasks and their categories. If you double click on a task you will access to the panel with the details for the task, it will look similar to the image:

Image:Mylyn task details.jpg

In the planning panel you can edit the status of the task and the time planning for it.

If you activate the task, then in the context panel you will see and edit the context for the task, as shown in the image:

Image:Mylyn task details context.jpg

Initially for a newly created task the context will be empty, you can manually add files to the context from this panel or you can use Mylyn's context engine by directly working on the task and let Mylyn automatically populate the context according to your actions.

Creating a task

To create a new task right click in a white area of the task view, the hit on new and local task. You will be prompt the panel for filling the data for the local task.

If you click on task (instead of local task), you will create a remote task stored in a remote repository.

Performing a task

When you want to perform a task you simply click on the circle on the right of it's name in the task list view. Mylyn will activate the task and show you only the files and methods in its context.

For a new task (that has never been activated before) the context initially will be empty. You can manually open the files that you need to edit and Mylyn will automatically populate the context, so the next time you will open the task its context won't be empty and you will see the pieces of the code you worked on.

When the context for the active task is empty you will basically see nothing in the "package explorer", you can switch off the context by clicking on the Mylyn's three balls icon at the top of the package explorer view.

When you are done with a task you can mark it as complete (right click on the task label -> mark as -> complete).

Conclusions

As you can see in the tutorial Mylyn is really simple to use yet very powerful because it focuses your attention on the task by removing the useless information for it.

It is also very useful when working in team because the context info can be exported.,

See Also

Comments from the users

To be notified via mail on the updates of this discussion you can login and click on watch at the top of the page


Comments on wikijava are disabled now, cause excessive spam.