Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to use Standard commands
How to use Standard commands [message #488528] Tue, 29 September 2009 07:23 Go to next message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
Hello,

how could i use standard commands?
I have a own handler for the delete command, but the command is always disable.
    <handler
            class="ui.command.DeleteHandler"
            commandId="org.eclipse.ui.edit.delete">
      </handler>
Re: How to use Standard commands [message #488538 is a reply to message #488528] Tue, 29 September 2009 07:37 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
SirWayne wrote:
> how could i use standard commands?
> I have a own handler for the delete command, but the command is always
> disable.

http://blog.eclipse-tips.com/2009/05/commands-part-7-adding- standard.html

- Prakash

Platform UI Team, IBM
http://blog.eclipse-tips.com
Re: How to use Standard commands [message #488566 is a reply to message #488538] Tue, 29 September 2009 09:30 Go to previous messageGo to next message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
ok got it =).
My mistake was i register the standard command in the ActionBarAdvisor in the methode makeActions(IWorkbenchWindow window)
Re: How to use Standard commands [message #488586 is a reply to message #488528] Tue, 29 September 2009 11:20 Go to previous message
Debabrata Pati is currently offline Debabrata PatiFriend
Messages: 1
Registered: July 2009
Junior Member
Step1:
<handler
    class="<custom handler>"
    commandId="<standard / existing command id>">
 <activeWhen>
    <with
	  variable="activeContexts">
       <iterate
	     ifEmpty="false"
	     operator="or">
	  <equals
		value="<custom context name>">
	  </equals>
       </iterate>
    </with>
 </activeWhen>
</handler>


Step2:

Activate the custom context in start up of the application.


like

IContextService contextService = (IContextService) PlatformUI.getWorkbench().getService(IContextService.class);
contextService.activateContext( <custom context> );


Now the custom handler will be enabled.

-Debabrata
Previous Topic:how to refresh Common Navigator after workspace modifications?
Next Topic:TextCellEditor+ICellModifier+ContentProposalAdapter+IControlContentAdapter
Goto Forum:
  


Current Time: Tue Mar 19 07:16:29 GMT 2024

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

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

Back to the top