A U-Bend In The Tubes

Tuesday, July 15, 2008

Using “selection” variable for Viewers in Core Commands

I’ve just spent an hour and half on this one…

If you want the eclipse UI to know what you’ve got selected under your sticky little mouse, for the purposes of Core Command checking, then you need to include something akin to this in your View class:

getSite().setSelectionProvider(viewer);

Where viewer is the name you’ve given to the viewer class (Either TreeViewer or TableViewer in most cases), otherwise eclipse won’t register your viewer with its SelectionService, and won’t know when you’ve got something selected.

Just a little something to show that I love you. Kiss kiss.

posted by Bradshaw at 13:08  

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress