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 Responses to “Eclipse Selection Service Tip”

  1. Benjamin CABE Says:

    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. Chris Aniszczyk Says:

    Plug-in Spy (ALT+SHIFT+F1) should tell you

  3. Eugene Kuleshov Says:

    Yes, it seem like you missed PDE Plug-in Spy. Try Alt-Shift-F1 on your selection in Eclipse 3.4

  4. Manuel Says:

    Thanks for your answers.

    In fact I am working with Eclipse 3.3.1.1, is Spy available for this release ?

    Regards

    Manu

  5. Chengdong Says:

    Eclipse Spy only available 3.4M6

  6. Manuel Says:

    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 ??

    Thanks

    Manu

Leave a Reply