private void confirmAndForceQuitAction ( final Long actionId ) { /* Display the confirmation */ final ConfirmationDialog confirmDialog = new ConfirmationDialog ( i18n . getMessage ( "caption.forcequit.action.confirmbox" ) , i18n . getMessage ( "message.forcequit.action.confirm" ) , i18n . getMessage ( UIMessageIdProvider . BUTTON_OK ) , i18n . getMessage ( UIMessageIdProvider . BUTTON_CANCEL ) , ok -> { if ( ! ok ) { return ; } final boolean cancelResult = forceQuitActiveAction ( actionId ) ; if ( cancelResult ) { populateAndUpdateTargetDetails ( selectedTarget ) ; notification . displaySuccess ( i18n . getMessage ( "message.forcequit.action.success" ) ) ; } else { notification . displayValidationError ( i18n . getMessage ( "message.forcequit.action.failed" ) ) ; } } , FontAwesome . WARNING , UIComponentIdProvider . CONFIRMATION_POPUP_ID , null ) ; UI . getCurrent ( ) . addWindow ( confirmDialog . getWindow ( ) ) ; confirmDialog . getWindow ( ) . bringToFront ( ) ; }
Show confirmation window and if ok then only force quit action .