|
Re: Conditional conext menu in fragment plugin [message #290771 is a reply to message #290770] |
Wed, 31 August 2005 19:05 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
Your action is an IActionDelegate. When you receive the
selectionChanged(IACtion, ISelection) you can get the selection, test
it, and if not valid, take the IAction passed it and setEnable(false),
if it is valid do setEnable(true).
Spike wrote:
> I'm working on a fragment plugin to extend an existing commercial plugin
> and I've run into a bit of a stumbling block.
>
> I want to add a refactor option to the right-click context menu in the
> editor so that various refactoring options can be invoked.
>
> I've got that part working fine using the org.eclipse.ui.popupMenus
> extension point.
>
> The problem is that the refactor options won't all be valid for any
> given text selection. I can easily implement the checking logic in my
> actions and tell the user that the action is invalid for the current
> selection, but it would be a much better interface if I could disable
> the invalid menu items before the user sees it.
>
> I don't have access to the source code for the existing plugin, so I'm
> wondering if there's a particular extension point that would allow me to
> do what I want. I thought maybe there would be something that could be
> added to the plugin at startup.
>
> TIA
>
> Spike
>
--
Thanks,
Rich Kulp
|
|
|
|
Powered by
FUDForum. Page generated in 0.02185 seconds