}
}
if (exit) {
dialog.prepareForSavingAndUpdatingLayersBeforeExit();
} else {
dialog.prepareForSavingAndUpdatingLayersBeforeDelete();
}
if (!layersWithUnmodifiedChanges.isEmpty()) {
dialog.getModel().populate(layersWithUnmodifiedChanges);
dialog.setVisible(true);
switch(dialog.getUserAction()) {