0
Dialog
을 SelectionListener
으로 닫는 방법은 무엇입니까? 현재 내 SelectionListener
은 다음과 같습니다SelectionListener의 JFace 닫기 대화 상자
public void widgetSelected(SelectionEvent e) {
ICommandService commandService = (ICommandService) PlatformUI.getWorkbench()
.getService(ICommandService.class);
IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench()
.getService(IHandlerService.class);
Command command = commandService
.getCommand("com.mainfirst.backoffice.gui.accounting.command.createBookingReversal");
Map<String, String> params = new HashMap<String, String>();
params.put("com.mainfirst.backoffice.gui.accounting.reversalCodeParameter",
String.valueOf(model.getVal().getCode()));
ParameterizedCommand paraCommand = ParameterizedCommand.generateCommand(command, params);
try {
handlerService.executeCommand(paraCommand, null);
} catch (Exception ex) {
Status status = new Status(IStatus.ERROR, AccountingActivator.PLUGIN_ID,
"Error opening reversal wizard", ex);
StatusManager.getManager().handle(status, StatusManager.SHOW);
throw new RuntimeException(ex);
}
close();
}
당신은 내가 close();
부르지 볼 수 있지만, Dialog
은 결국 계속 열려있게 않기 때문에. 전화를 finally
블록으로 이동해도 도움이되지 않습니다. 내 명령은 Dialog
앞에 새 Wizard
을 엽니 다. Wizard
이 열리기 전에 Dialog
을 종료해야합니까?
@ greg-449이 (가) 질문을 편집했습니다. [여기] (https://stackoverflow.com/questions/46113246/jface-disable-finish-button-in-wizard) 내 두 번째 질문입니다 – XtremeBaumer
명령은 무엇을합니까? 명령이 끝나기 전에 대화 상자가 닫히기를 기대하십니까? –
명령이 핸들러를 호출하면 마법사가 열립니다. 단추를 클릭하자마자 대화 상자가 닫히지 만 명령은 여전히 실행되어야합니다. – XtremeBaumer