FlashCardsProject/build/build/src/jf/flashcards/address/view/DeleteStackDialogController.java
/**
     * handles when Ok button is pressed
     * gives the user an alert before deleting the table and removing the table name from 
     * the flash_card_list
     * 
     */
handles when Ok button is pressed
gives the user an alert before deleting the table and removing the table name from
the flash_card_list
handles when Ok button is pressed gives the user an alert before deleting the table and removing the table name from the flash_card_list
@FXML
    private void handleOk() {
    	if(selectedTable.equals("")) {
    		errorMsg.setText("No Stack Selected to Delete");
    	}
    	else {
    		errorMsg.setText("");
       		Alert alert = new Alert(AlertType.CONFIRMATION);
    		alert.setTitle("Confirmation");
    		alert.setHeaderText("Are you sure you want to delete this stack");
    		alert.setContentText("Once you delete this stack, all the cards within will be lost");
    		Optional<ButtonType> result = alert.showAndWait();
    		if(result.get() == ButtonType.OK)
    		{
    			FlashCardDatabase.removeFlashCardStackFromList(selectedTable);
    			FlashCardDatabase.dropFlashCardStack(selectedTable);
    			setComboBox();
    			dialogStage.close();
    		}
    	}
    }
@ FXML private void handleOk ( ) { if ( selectedTable . equals ( "" ) ) { errorMsg . setText ( "No Stack Selected to Delete" ) ; } else { errorMsg . setText ( "" ) ; Alert alert = new Alert ( AlertType . CONFIRMATION ) ; alert . setTitle ( "Confirmation" ) ; alert . setHeaderText ( "Are you sure you want to delete this stack" ) ; alert . setContentText ( "Once you delete this stack, all the cards within will be lost" ) ; Optional < ButtonType > result = alert . showAndWait ( ) ; if ( result . get ( ) == ButtonType . OK ) { FlashCardDatabase . removeFlashCardStackFromList ( selectedTable ) ; FlashCardDatabase . dropFlashCardStack ( selectedTable ) ; setComboBox ( ) ; dialogStage . close ( ) ; } } }
handles when Ok button is pressed
 gives the user an alert before deleting the table and removing the table name from
 the flash_card_list
handles when Ok button is pressed gives the user an alert before deleting the table and removing the table name from the flash_card_list
//confirmation alert for the user  //removes the name from the flash_card_list //drops the actual table  //there is an msg label that will tell the user which table has been removed, currently not in use  //String msgText = selectedTable + " has been successfully removed"; //errorMsg.setText(msgText);