This code also exists in [ScalaPlugin](https://github.com/scala-ide/scala-ide/blob/master/org.scala-ide.sdt.core/src/org/scalaide/core/ScalaPlugin.scala#L178).
I think it is better here, but the one in `ScalaPlugin` has comments.