I have a button in a base dialog that opens a results dialog.
private void showPlotResultsDialog() {
resultsDialog = new AplotPlotResultsDialog(getShell());
resultsDialog.setBlockOnOpen(true);
resultsDialog.open();
}
The user is allowed to leave the results dialog open as they work. But I have recently noticed that the user can click on the “Open Results Dialog” as many times they want.
With each click a new results dialog opens. There can be a few of the same dialog open, with different data in the table.
- Is it possible to check and see if the dialog is already opened when they click the button? If one is already opened, pop a message, saying it is already open and block opening a new one.
Sure. Just put a check for
nullin your method. If the instance is not null, a dialog has been opened.it would be better to update the dialog and set the focus on the dialog. Saves the user having to close the popup message, close the dialog, and open the same dialog.