@Override
protected void doExecuteCommand() {
String title = SpringSupport.INSTANCE.getMessage( DELETE_COMMAND_ID + ".title" );
String message = SpringSupport.INSTANCE.getMessage( DELETE_COMMAND_ID + ".message" );
ConfirmationDialog dlg = new ConfirmationDialog( title, message ) {
@Override
protected void onConfirm() {
final List<? extends T> objectsToDelete = objectAccess.getElements();
new BlockingBackgroundActionRunner( SpringSupport.INSTANCE.getActiveApplicationWindow(), new BackgroundAction( idStrategy.getBaseId() + AddRemoveAspect.KEY_DELETE_BEAN ) {
@Override
protected boolean confirm() {
if ( callback != null ) {
return callback.confirm();
}
return true;
}
@Override
protected void executeInBackground() throws Exception {
for ( T entry : objectsToDelete ) {
objectRemove.remove( entry );
// And notify the rest of the application of the change
SpringSupport.INSTANCE.publishDeleted( entry );
}
}
} ).run();
}
};
dlg.showDialog();
}