0

I have added a javascript library to my project programatically. I add different versions of library based on user preference during project creation.

I am able to achieve this but I am not able to retain the project information once the library creation is finished.

This is needed because you might have more than one project in your workspace with different library versions, so it becomes crucial to know which is the project in question when a user expands the tree node under javascript resources, where I add my library. If the user selects a project then expands the tree node I can get the Project info through

PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                    .getSelectionService();

but if the user just expands the tree node without selection of project, how can I know which project does that belong to ?...

Any help in this regard will be highly appreciated.

Thanks in advance !

Abbas
  • 3,144
  • 2
  • 25
  • 45

1 Answers1

0

If they expand the node, not the project then I assume you have a reference to the node that was expanded which will be type IResource on that instance you can call .getProject() which returns the project the selection is contained in. If that does not apply, what type of object reference do you have on the node expansion?

Duncan Krebs
  • 3,366
  • 2
  • 33
  • 53