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

Java Code:
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 !