// could go wrong, and if the user accepts, let's delete what's needed
dialog.showOkCancel(target, new GeoServerDialog.DialogDelegate() {
@Override
protected Component getContents(String id) {
// show a confirmation panel for all the objects we have to remove
return new ConfirmRemovalPanel(id, selection);
}
@Override
protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
// cascade delete the whole selection