VCS context menu

I cannot for the life of me figure out how the state of the context menu for VCS plugins is managed. How do I enable (and disable) menu items on the context menu when the file's state changes?

At the moment, I can add, and then add, and then add again. Interesting, but not really very useful...

2 comments
Comment actions Permalink

Hello Gary,

I cannot for the life of me figure out how the state of the context
menu for VCS plugins is managed. How do I enable (and disable) menu
items on the context menu when the file's state changes?

At the moment, I can add, and then add, and then add again.
Interesting, but not really very useful...


You'll need to check the status of the file from the update() method of your
action and set presentation.setEnabled() accordingly. See AddAction.isEnabled()
in SVN plugin for an example.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.