Twitter github

Hunting Wabbits and Magical Identifiers

I always like to chuckle about my past Eclipse programming experiences. I remember one of my earlier tasks involved showing the error log view for something. I thought that the workbench would be responsible for that somehow… and I was right!

PlatformUI.getWorkbench().findView(...)

However, to my dismay, the parameter was a magical identifier that I didn’t know. It took me awhile to wade through Eclipse source code to find the identifier. An by awhile, I mean more time than it should have taken. There are much better ways to find magical identifiers these days… here are two ways:

(1) Plug-in Registry View

The Plug-in Registry view allows you to quickly find information regarding plug-ins and extension points. If you’re just interested in extension points, I’d set a filter to show only extension content only:

After that, you’re presented with a list of extension content only. Let’s focus on org.eclipse.ui.views as that’s our extension point of interest here:

Next, let’s try to find that pesky log view identifier:

That wasn’t so bad now, was it :)?

(2) Plug-in Spy

In Eclipse 3.4, it will be even easier to find certain types of identifiers using the Plug-in Spy. You just have to look at what you want and press ALT+SHIFT+F1:

Ok, those are all the tips today from your friendly PDE developer 🙂