2
벨로우즈 스 니펫을 시도했지만 호출 된 명령은 빈 매개 변수 맵을 사용하여 실행됩니다.프로그래밍 방식으로 매개 변수를 전달하는 명령을 호출하는 방법은 무엇입니까?
ICommandService service = (ICommandService) ((IServiceLocator) PlatformUI.getWorkbench())
.getService(ICommandService.class);
Command command = service.getCommand(Constants.COMMAND_ID);
ExecutionEvent eventWithParam = new ExecutionEvent(command,
Collections.singletonMap(Constants.COMMAND_PARAM, "true"), null, null);
command.execute(eventWithParam);
문제는 호환성 계층에 갈 때입니다 HandlerServiceHanlder.execute
방법에 PARM_MAP
을 잃어 버릴 것 같다.
해결 방법이 있습니까?
'(지원되지 않습니다) Command.execute'는'ExecutionEvent' 접촉하지 않습니다 - 단지 바로 현재의 핸들러에 전달합니다. 귀하의 처리기 코드를 보여주십시오. –
호출 핸들러 : 공용 클래스 RunHandler는 AbstractHandler가 IHandler를 구현 확장 { \t @Override \t 공공 객체 실행 (ExecutionEvent 이벤트가) ExecutionException을 던졌습니다 { \t \t 문자열 sIsCleanup = event.getParameter (Constants.COMMAND_PARAM); \t \t if (sIsCleanup! = null) { \t \t \t isCleanup = Boolean.parseBoolean (sIsCleanup); \t \t} – kmaziarz