Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Enable/Disable "foreign" command
Enable/Disable "foreign" command [message #333756] Fri, 02 January 2009 17:50 Go to next message
Andreas Pakulat is currently offline Andreas PakulatFriend
Messages: 127
Registered: July 2009
Senior Member
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 18:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33171
Registered: July 2009
Senior Member
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
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Ignored reentrant call while viewer is busy
Next Topic:Howto EclipseApplication Launcher?
Goto Forum:
  


Current Time: Sun Jun 30 13:52:15 GMT 2024

Powered by FUDForum. Page generated in 0.03164 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top