0
Dialog
をSelectionListener
にクローズするにはどうすればよいですか?あなたは、私がclose();
を呼び出して行う見ることができますが、Dialog
が最後に開いたままんので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();
}
:現在、私のSelectionListener
は次のようになります。 finally
ブロック内でコールを移動することは役に立ちません。私のコマンドは、Dialog
の前に新しいWizard
を開きます。 Wizard
が開かれる前にDialog
を閉じなければなりませんか?
@ greg-449は質問を編集しました。 [ここ](https://stackoverflow.com/questions/46113246/jface-disable-finish-button-in-wizard)は私の2番目の質問です – XtremeBaumer
コマンドは何をしますか?コマンドが終了する前にダイアログが閉じることを期待していますか? –
このコマンドはハンドラを呼び出し、このハンドラはウィザードを開くだけです。私は、ボタンがクリックされるとすぐにダイアログが閉じることを期待しますが、コマンドはまだ実行されるべきです – XtremeBaumer