implemented the question edit

This commit is contained in:
Jonas Hinterdorfer 2025-05-12 14:46:59 +02:00
parent af87631ff1
commit e3f033d1e5

View File

@ -77,8 +77,7 @@ public class ViewController {
@FXML @FXML
private void deleteQuestion(ActionEvent actionEvent) { private void deleteQuestion(ActionEvent actionEvent) {
if(!showConfirmationButton("Do you want to proceed with deletion of the question: \n" + currentQuestion.getQuestion())) if (!showConfirmationButton("Do you want to proceed with deletion of the question: \n" + currentQuestion.getQuestion())) {
{
return; return;
} }
@ -100,16 +99,14 @@ public class ViewController {
this.isInEditState = false; this.isInEditState = false;
this.setEditableAndSetDisabled(false); this.setEditableAndSetDisabled(false);
} } else {
else {
this.setEditableAndSetDisabled(true); this.setEditableAndSetDisabled(true);
this.editButton.setText("Save"); this.editButton.setText("Save");
this.isInEditState = true; this.isInEditState = true;
} }
} }
private void setEditableAndSetDisabled(boolean value) private void setEditableAndSetDisabled(boolean value) {
{
questionField.setEditable(value); questionField.setEditable(value);
answerField.setEditable(value); answerField.setEditable(value);
this.questionListView.setDisable(value); this.questionListView.setDisable(value);