Editors updating command enablement [message #336263] |
Thu, 04 June 2009 05:18  |
Eclipse User |
|
|
|
Hi all,
I have created my own app, and I have added commands to my main menu using
CommandContributionItems in the ApplicationActionBarAdvisor. I have
configured the enablement of these commands in the plugin.xml <handlers>
tag. Everything seems to be working ok for most of the commands.
I have also created my own editor (extending TextEditor). The problem is
that I have some commands that I want to be enabled as soon as my editor
goes dirty. However, when I make my editor dirty, the enabled state of the
command is not checked, and it remains disabled in my main menu. I know
it's not being called because part of the <enabledWhen> tag is a
propertytester which is not being called.
Would anyone know how to get the editor to tell the handler to check its
enabled state when it is made dirty? I tried getting my editor to
implement IDocumentListener, so that when documentChanged() is called, I
could try to update the handler, but I don't know what sort of event to
fire in this case.
Any help would be greatly appreciated!
|
|
|
|
Powered by
FUDForum. Page generated in 0.02971 seconds