Handler enablement for a view's selection [message #331565] |
Thu, 11 September 2008 14:36  |
Eclipse User |
|
|
|
I'm working on an application where I'm contributing actions to the
local toolbar/menu/popup of my views using commands/handlers/menus. I
want some of the handlers to be enabled based on there being a
selection. This seemed easy enough by building an enabledWhen
expression with a count of 1 or + on my handler definition in XML. When
my view is active, this works well, however, when my view is inactive
the handlers are not enabled because they are based on the selection of
the active view.
I'd like to apply an expression that enables/disables the buttons based
only on the selection of the view that's hosting them. This way, the
action could remain enabled in the local toolbar of one view when
another is active. Currently a toolbar button becomes disabled when the
active view is changed giving the appearance that the user has to click
the view to activate it and then click the toolbar button to invoke the
command. Before switching to commands/handlers, my actions would stay
enabled giving the appearance that only one click is needed to invoke
the action.
Is there a way, other than perhaps through a custom source provider, to
link the enablement for a command in a local menu/toolbar/popup to the
selection for the hosting view?
I'm using Eclipse 3.4
Thanks,
-Ryan Norris
|
|
|
|
Powered by
FUDForum. Page generated in 0.03588 seconds