ProjectView selection listener

Hi, I would like to change context/data in my plugin window according to the file selected in project view. Something like structure view that is sensitive for file selection in project/package...etc view. I have searched on this site, on google and I could not find any solution. If you have any idea I would be grateful.

1
3 comments
Avatar
Permanently deleted user

Actually, ProjectView contains several panes (Project, Packages and other scopes).

ProjectView.getInstance(project).getCurrentProjectViewPane()

Every pane contains own JTree. And it is a bad idea to add a listener to each of them, but you can request a selected object at any time:

ProjectView.getInstance(project).getCurrentProjectViewPane().getSelectedElements()

For example, NavBarUpdateQueue updates a state of Navigation Bar every 100ms.

0

Thanks a lot it helped.

0

SelectionListener is for editor

what's the project select listener

0

Please sign in to leave a comment.