hooking into project view right-click menu; obtaining selected directory/file

I want to enhance the Rearranger plugin so it can be invoked from the project view by right-clicking on a file or directory, like Reformat Code or Optimize Imports does. Is there an example of a plugin that does this, or does somebody know how it is done?

The application plugins I've seen extend EditorWriteActionHandler and are passed an Editor and a DataContext. They work on the file currently being edited. Is there an example of how to write a plugin that modifies an unopened (not being edited) file?

Thanks for any help or suggestions.

-Dave

1 comment
Comment actions Permalink

You can add the action to the DefaultActionGroup registered as
"ProjectViewPopupMenu", and then your data context will contain
the virtual file you clicked on.

Dave Kriewall wrote:

I want to enhance the Rearranger plugin so it can be invoked from the project view by right-clicking on a file or directory, like Reformat Code or Optimize Imports does. Is there an example of a plugin that does this, or does somebody know how it is done?

The application plugins I've seen extend EditorWriteActionHandler and are passed an Editor and a DataContext. They work on the file currently being edited. Is there an example of how to write a plugin that modifies an unopened (not being edited) file?

Thanks for any help or suggestions.

-Dave


--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0

Please sign in to leave a comment.