|Retarget Actions listening to model changes [message #335679]
||Tue, 21 April 2009 10:07
Registered: July 2009
In my plugin I have a tree view which displays my own model. The objects
in the tree can change state without the user making selection changes. So
I needed to update the enablement of commands to accomodate this. After A
LOT of searching, I got my plugin contributed functionality working from
the plugin.xml, using: commands, handlers, the <enabledWhen> tag, and a
PropertyTester. It took me ages to find a good solid example of how to use
the PropertyTester. But it is now working.
However, the main issue is the use of retarget actions. As was pointed out
in another thread, 3.3 still uses retarget actions. I cannot move to 3.4.
Therefore, I need to retarget rename, refresh, delete, properties, new,
etc. But the enablement of these actions can also change (without the user
changing selection). So it's not enough for my actions just to listen to
workbench selection changes.
I guess i'm trying to somehow hook my PropertyTester into the actions, and
get the "isEnabled()" method for each action called when the File or Edit
Menu is expanded.
Any ideas? My first thought was to add a menu listener to the main menu,
but I can't get access to the instance of the main menu bar.
Powered by FUDForum
. Page generated in 0.02327 seconds