Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Trying to execute the disabled command
Trying to execute the disabled command [message #524221] Wed, 31 March 2010 08:34 Go to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Hi All,

I am using keyboard shortcuts in my appliocation.
I am providing handlers for the paste action.
For some reason the paste does not work initially but after doing some other operations it works.
I enabled the tracing in the debug config and found the command is not enabled and hence the NotEnabledException.

I am creating the action in my code.
Then assigning the action handler to the action bar of the UI and then regirstering the action with the KeyBindingService.
I know KeyBindingService way is not the preffered way to go ahead.But that code i can not change much.

Below is the error i am getting in the console
COMMANDS >>> execute >>> not enabled: id=org.eclipse.ui.edit.paste; exception=org.eclipse.core.commands.NotEnabledException: Trying to execute the disabled command org.eclipse.ui.edit.paste



Any help would be hugely appreciated.

Thanks and Regards,
Saurav


[Updated on: Wed, 31 March 2010 08:35]

Report message to a moderator

Re: Trying to execute the disabled command [message #524335 is a reply to message #524221] Wed, 31 March 2010 14:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You're mixing actions and commands and a deprecated service ... all bets
are off.

Are you in a view? Then in your createPartControl(*) you can do
something like:

getViewSite().getActionBars().setGlobalActionHandler(ActionF actory.PASTE.getId(),
myPasteAction);

If you are dealing with actions, that's enough to provide your paste
action to the system. You don't have to deal with the IKeyBindingService.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Trying to execute the disabled command [message #524469 is a reply to message #524221] Thu, 01 April 2010 05:53 Go to previous message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Thanks Paul for the reply.

I could find out the solution to the problem.The problem was there in the logic of the enablement of my action.I corrected that one and it works now.

cheers,
Saurav



Previous Topic:How to extend eclipse code analysis strategy?
Next Topic:Cannot open input element
Goto Forum:
  


Current Time: Sat Dec 07 14:55:08 GMT 2024

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

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

Back to the top