Posts Tagged ‘Mylyn’

Eclipse IDE 3.7 Book available for the Kindle

Tuesday, December 20th, 2011

Today I released my new Eclipse IDE 3.7 book for the Kindle device.


Eclipse IDE 3.7
Fundamentals of Java Programming, Debugging, JUnit Testing and Mylyn Tasks with Eclipse

This book demonstrates how you can develop Java applications, how you can debug them and how to write JUnit tests for your applications. It also explains how you can work with local Mylyn tasks to organize your work efficiently.

It also includes important Eclipse configuration tips which make programming with Eclipse more effective.

After finishing this book you should feel comfortable with using the Eclipse IDE for standard Java development tasks and you should be equipped to explore Eclipse further.

You find the book in all Amazon stores:

Eclipse IDE 3.7 in Amazon USA
Eclipse IDE 3.7in Amazon Germany
Eclipse IDE 3.7 in Amazon UK
Eclipse IDE 3.7 in Amazon France
Eclipse IDE 3.7 in Amazon IT
Eclipse IDE 3.7 in Amazon ES

This book summerizes several tutorials I publish on my website. It includes the Eclipse IDE introduction tutorial, the JUnit tutorial, Debugging with Eclipse, my Mylyn Tutorial and my favorite Eclipse shortcuts. The full content of the book is still available online on my website.

I would especially thank Elias Volanakis for his thorough spell checking and feedback on the content.

I also am very grateful to Wayne Beaton for writing the foreword and providing feedback on the content.

In addition I would like to thank the Eclipse Foundation and Ian Skerrett for the permission to use the Eclipse logo and Matthew Nuzum for the permission to use his svg version of the Eclipse logo.

I got many suggestions or corrections from countless readers of my website and I would like to express my deepest gratitude for their contributions.

I have plans to add an EGit chapter over the next months. If you buy this book now you will get the update with EGit for free. I have confirmed twice with the Amazon customer support that if I publish an update to this book that buyers of the book will get notified and that they can download the updated book with EGit for free.

I’m again surprised how much work it is to convert my website content into a book format. I hope you like this book and if you new to Eclipse I hope you enjoy your learning experience.

Mylyn Github Connector

Tuesday, May 10th, 2011

Just in case you missed it, there is a prototype for a Mylyn and Github connector available. Please see https://github.com/blog/852-github-mylyn-connector-for-eclipse for the official announcement.

Installing the connector is pretty straight forward you can directly install it from the Eclipse Marketplace client. The only pre-requisite is that you add the Orbit repository http://download.eclipse.org/tools/orbit/downloads/drops/S20110422041657/repository/ and install “Gson” from the com.google.* category (thanks to Christian Trutz for the tip on twitter).

Importing your issues is as easy as File -> Import -> Tasks -> Github Task Repositories and then you can define new queries for this repository.

The first test unfortunately failed. During a submit of a new issue with the error “Submit failed: Unexpected error: Unprocessable Entry”.

Still the connector looks very promissing. Git is my favorite version control system and I love Github. Its great that soon Mylyn will also to share issues and ther context via GitHub.

I suggest you give it a test run. If you find issues you can report them in bugzilla: Mylyn EGit Connector.

Update: The bug is already fixed, looks like testing will get your bugs solved fast. :-)

Local Mylyn tasks distributed via git

Thursday, August 26th, 2010

I learned from Steffen Pingel and Ekkehard Gentz that Mylyn has the ability to save local tasks outside the workspace. This is hidden under advanced in the Preferences.

This allows you to put your local tasks outside your workspace and versionize them with git. This way you can use git to move your local tasks between machines. I really like this as I frequently use different machines and now I can not only share source code betwee them but also my mylyn taslks.

As Steffen told me, simultanous access to the Mylyn tasks might cause task corruption but I don’t think that is an issue for me as Git takes care of conflicts and I do not have two machines writing to the same local file.

Fun times with Git and Mylyn!

Save your local Mylyn tasks

Tuesday, August 24th, 2010

If you are using Eclipse you properly using Mylyn. I recently got a new machine and wanted to migrate my local Mylyn tasks from one computer to another.

Local tasks stored in your workspace in .metadata/mylyn/tasks.xml.zip. The context for local tasks stored in .metadata/.mylyn/contexts… look for files labeled local-X.xml.zip, these have the context. You can back up the entire Mylyn data directory and put it into the same place on your new computer.

Worked well for me!

Thanks to David Shepherd for the tip via twitter.

Eclipse Papercut #6 – Modifying Mylyn Context

Monday, October 5th, 2009

In this episode of Eclipse Papercuts I will demonstrate how to modify the Mylyn tasks context. Many thanks to David Green for providing sample code to access the Mylyn context.

Mylyn makes certain assumptions how the developer works. If you start a new task the Mylyn context is empty and fills up based on the selected files.

Which is not always the way I work. Frequently I know that for my task a whole package (or project) is relevant. I would like to include all classes in this package / project in my Mylyn task.

Ok, lets see how we can solve this papercut. I describe how to add Java classes from a package to an active task.

Create an command which extends the package explorer with a new popup commands as described here Extend the package explorer.

Create the command handler with the following coding:


package de.vogella.mylyn.tasksmodify.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IInteractionContext;
import org.eclipse.mylyn.internal.context.core.ContextCorePlugin;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.mylyn.monitor.core.InteractionEvent.Kind;
import org.eclipse.ui.handlers.HandlerUtil;

public class SampleHandler extends AbstractHandler {
	public Object execute(ExecutionEvent event) throws ExecutionException {

		IStructuredSelection selection = (IStructuredSelection) HandlerUtil
				.getActiveMenuSelection(event);
		if (selection ==null){
			return null;
		}

		Object firstElement = selection.getFirstElement();

		if (firstElement instanceof IPackageFragment) {
			IPackageFragment mypackage = (IPackageFragment) firstElement;
			try {
				if (mypackage.getKind() == IPackageFragmentRoot.K_SOURCE){
					 ICompilationUnit[] compilationUnits = mypackage.getCompilationUnits();
					 for (ICompilationUnit iCompilationUnit : compilationUnits) {
						 IInteractionContext activeContext = ContextCore.getContextManager()
							.getActiveContext();
						 ContextCorePlugin.getContextManager().processInteractionEvent(iCompilationUnit,
									Kind.PROPAGATION, InteractionEvent.ID_UNKNOWN, activeContext);
					}
				}
			} catch (JavaModelException e) {
				e.printStackTrace();
			}
		}

		return null;
	}
}

Launch your plugin. Create a Mylyn task and select a package in the package explorer. Select your commands and all files of this package will be added to the task.

Further reading: If you want to access other Java Elements, e.g. Project and add them to the Mylyn task this tutorial might help you: Eclipse JDT.

Please note that ContextCorePlugin is supposed to be internal API but I did not find another way of accessing the Mylyn tasks.


Switch to our mobile site