Accessing the Project View ToolWindow


Hello all,

Does the API expose anything from within a tool window? In particular, I'd like
to find out the package or class that was selected in the Project View when
the mouse was right-clicked (to trigger an Action).

Thanks in advance for any help.


Regards,
Corey.

1 comment
Comment actions Permalink


To answer my own question ... from the AnActionEvent which triggered the action,
get the VirtualFile data (which seems to be the file selected in the project
view), i.e:

VirtualFile selectedFileInProjectView = (VirtualFile)
event.getDataContext().getData(DataConstants.VIRTUAL_FILE);


Regards,
Corey.


Corey Yeatman wrote:


Hello all,

Does the API expose anything from within a tool window? In particular, I'd
like to find out the package or class that was selected in the Project
View when the mouse was right-clicked (to trigger an Action).

Thanks in advance for any help.


Regards, Corey.


0

Please sign in to leave a comment.