|Get selected project name when action is executed [message #900757]
||Wed, 08 August 2012 12:14
| Mat Mathiew
Registered: July 2012
I created a custom wizard which creates a new folder with some files insides|
when it successfully finishes.
But I want this folder to be created inside a project which the user doesn't explicitly specify but is implicitly specified depending where the user right click and fired the wizard.
I made a menu contribution for the popup menu of the navigator
that shows my action and I need to obtain information about what project is selected
when the user right click and selected the action to start the wizard in order to
create the folder in that project.
After that i will use the project name to create the folder as follows.
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
IProject project = root.getProject("myProject"); //WHICH ONE...?
Any idea how to get this information?
Edit: I tried creating a class that extends SelectionListenerAction but getSelectedResources is empty whatever is selected when the users fires the wizard.
[Updated on: Wed, 08 August 2012 12:45]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01820 seconds