It's not my code, I extracted the class from [here](https://github.com/scala-ide/scala-ide-play2/pull/121/files#L15L100).
But I'll be happy to tweak it if @dotta agrees.