RCP 通过代码调用Commands

  1. // From a view you get the site which allow to get the service  
  2. IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);  
  3. try {  
  4.   handlerService.executeCommand("add.command"null);  
  5.   } catch (Exception ex) {  
  6.     throw new RuntimeException("add.command not found");  
  7.     // Give message  
  8.     }  将夜
  9. }   
posted @ 2013-09-13 14:39  刘俊鹏123  阅读(250)  评论(0编辑  收藏  举报
重生之大文豪