Vlad Ilie
Vlad Ilie

Reputation: 1409

Eclipse RCP - SelectionService - History?

I am building an Eclipse RCP application that contains some org.eclipse plug-ins in it as well, including the Project Explorer view plugin.

Currently in one of my plugins I've implemented a StartupHook where I add a listener on the SelectionService on the Project Explorer view. When my plugin is active, I would like to get the latest selected project

Check this tutorial for some details on the SelectionService

I would like to NOT use a StartupHook for this, because it doesn't really respect the lazy loading principle.

Does the SelectionService have a history I could refer to, and search AFTER my plugin has loaded (without prior adding of a listener?)

Upvotes: 1

Views: 60

Answers (1)

Rüdiger Herrmann
Rüdiger Herrmann

Reputation: 20985

The SelectionService has no history.

You will either have to load your plug-in early (and give up on lazy loading as you already said) or you can track the selection changes only as soon as your plug-in is activated (if ever).

Upvotes: 1

Related Questions