私が話していることをもっとよく説明してみましょう。
メインGUIには、クリックするとダイアログAを開くボタンがあります。ダイアログAの[OK]ボタンは、メインGUIのメソッドを実行します。
public void widgetSelected(SelectionEvent e) {
baseDialog.startPrintOperation();
}
メソッドが終了したら、baseDialog.startPrintOperation()
ダイアログAを閉じます。
別のクラスのメソッドからダイアログAを閉じるにはどうすればよいですか?
編集
これがダイアログAのokButtonです
okButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
getPlotterSelection();
getSpinnerValue();
Runnable r = new Runnable() {
public void run() {
baseDialog.startPrintOperation();
}
};
if(Display.getCurrent() != null) {
r.run();
}
else {
Display.getDefault().asyncExec(r);
}
}
});
ダイアログAを閉じる必要があるprintOperationメソッドのセクションは次のとおりです。このメソッドはMAINGUIクラスにあります
finally {
plotOp.removeOperationListener(this);
plotOp = null;
Display.getDefault().asyncExec(new Runnable() {
public void run() {
removeAllTableRows();
plotRequestCompleted = true;
THIS is where I want to close Dialog A;
}
});
}
}
});
session.queueOperation(plotOp);
} // startPrintOperation()を終了します