Eclipse Selection Service Tip

As Eclipse’s plug-in developer I often ask my self: what is the current workbench selection ?? Developers may need such information for example when they want to update a given view according to an other view selection but don’t know what the provided selection exactly is or when creating a new custom Selection provider. It can also be useful for simple debug purpose.

To answer this question I wrote a simple plug-in adding a new view to my workbench showing the content of the current selection in a simple JFace TableViewer.

The view is added to the PDE category :

Current Selection View

Here is what it looks like when two Java methods are selected in the outline view :

Current Selection View

May be I missed something and such information is already available somewhere in the PDE … ?? If Yes, please let me know.


6 thoughts on “Eclipse Selection Service Tip

  1. Yes I’m afraid it is already available (except if the “toString()” is not available out of the box) thanks to the wonderful PDE Spy!
    Just hit ALT+SHIFT+F1 and close your eyes :-)

  2. I tried to checkout the new org.eclipse.pde.runtime source code using CVS. Sadly the plug-in doesn’t compile … seems it is using a lot of new feature from 3.4M6.

    I guess it means I can’t use Spy in 3.3.XXX … Is it right or is there any “workaround” to use spy in 3.3 ??



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s