Enable/Disable "foreign" command [message #333756] |
Fri, 02 January 2009 12:50  |
Eclipse User |
|
|
|
Hi,
I'm looking for a way to enable/disable a command that I'm not controlling
myself (in particular the org.eclipse.ui.edit.copy one). Should this
somehow be done in the plugin.xml of my own plugin, or do I need to get a
hand on the command object during runtime and enable/disable it that way?
In either case: How exactly should this look like (lets say I'd like to
enable it only if the focussed control's selection is not empty).
Andreas
|
|
|
Re: Enable/Disable "foreign" command [message #333757 is a reply to message #333756] |
Fri, 02 January 2009 13:45  |
Eclipse User |
|
|
|
Andreas,
Maybe there are new improved ways, but in a generated EMF editor, when
the editor's action bar contributor is initialized, we do this
copyAction = new CopyAction();
copyAction.setImageDescriptor(sharedImages.getImageDescripto r(ISharedImages.IMG_TOOL_COPY));
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId() ,
copyAction)
Andreas Pakulat wrote:
> Hi,
>
> I'm looking for a way to enable/disable a command that I'm not controlling
> myself (in particular the org.eclipse.ui.edit.copy one). Should this
> somehow be done in the plugin.xml of my own plugin, or do I need to get a
> hand on the command object during runtime and enable/disable it that way?
> In either case: How exactly should this look like (lets say I'd like to
> enable it only if the focussed control's selection is not empty).
>
> Andreas
>
|
|
|
Powered by
FUDForum. Page generated in 0.09054 seconds