czwartek, 8 maja 2014

Eclipse PDE - all about Eclipse Commands

The goal of this site is gather most useful locationURI's one can like to attach custom command for Eclipse environment.

menu:org.eclipse.ui.views.ProblemView
menu:window?after=newEditor
popup:org.eclipse.ui.menus.showInMenu popup:#TextEditorContext?after=copy popup:#TextEditorContext?endof=group.find popup:#TextEditorContext?after=group.open popup:#TextEditorContext?after=group.edit

Useful commands

  • org.eclipse.ui.ide
    • org.eclipse.ui.edit.text.openLocalFile (Open a local file)
    • org.eclipse.ui.navigate.goToResource (Go to particulare resource in the active window)
    • org.eclipse.ui.navigate.openResource (Open an editor on a praticular resource)
      • handler: org.eclipse.ui.internal.ide.handlers.OpenResourceHandler
      • param: filePath
    • org.eclipse.ui.edit.addTask (Add a task)
      • defaultHandler:  no
    • org.eclipse.jdt.ui.edit.text.java.correction.assist.proposals (Suggest possible fixes for a problem)
      • deafultHander: no
    • org.eclipse.ui.navigate.showResourceByPath (Show a resource in the Navigator given its path)
      • defaultHandler: org.eclipse.ui.internal.ide.handlers.ShowResourceByPathHandler
      • resourcePath
    • org.eclipse.ui.ide.copyBuildIdCommand (Copies the build id to the clipboard)
      • defaultHandler: org.eclipse.ui.internal.ide.commands.CopyBuildIdToClipboardHandler
  • org.eclipse.ui
    • org.eclipse.ui.newWizard (Open wizard)
      • param: newWizardId
    • org.eclipse.ui.file.import
      • param:  importWizardId
    • org.eclipse.ui.file.export
      • param: exportWizardId

Invoke programmatically

ICommandService commandService = (ICommandService) PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getService(ICommandService.class);

IEvaluationService evaluationService = (IEvaluationService) PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getService(IEvaluationService.class);
try {
 Command c = commandService.getCommand("org.eclipse.ui.newWizard");

 Map<String, String> params = new HashMap<String, String>();
 params.put("newWizardId", "mywizard.id");

 c.executeWithChecks(new ExecutionEvent(c, params, null, evaluationService.getCurrentState()));

} catch (Exception ex) {
 throw new RuntimeException("Open new wizard command not found");
}

 Menus


   
      
         
             
             
             
             
         
      
   



   
      
         
           
         
      
      
        
      
   



   
      
      
         
            
            
         
      
   



   


Brak komentarzy:

Prześlij komentarz