1

I have developed an Eclipse view in which I handle elements that are also resources in the workspace. I want to programmatically select the resource in Project Explorer, like "Navigate > Show in Project Explorer". I already have the IResource in my hand.

How can I do this ?

I have seen this thread: How to programmatically change the selection within package explorer It is exactly the same thing I want, except for Project Explorer.

Community
  • 1
  • 1
gnome
  • 11
  • 3

1 Answers1

0

ProjectExplorer extends from CommonNavigator, so there should be the method:

public void selectReveal(ISelection selection);

If not, look for "setSelection(ISelection, boolean)"
Put your IResource in a IStructuredSelection or something..

xoned
  • 2,701
  • 2
  • 31
  • 43