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 03:23 Go to next message
Sir Wayne is currently offline Sir Wayne
Messages: 206
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 03:37 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.
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 05:30 Go to previous messageGo to next message
Sir Wayne is currently offline Sir Wayne
Messages: 206
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 07:20 Go to previous message
Debabrata Pati is currently offline Debabrata Pati
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: Sun Aug 31 04:36:29 EDT 2014

Powered by FUDForum. Page generated in 0.01643 seconds