Skip to content

Commit

Permalink
Fix generate being disabled when navigating back
Browse files Browse the repository at this point in the history
  • Loading branch information
krissrex committed Nov 11, 2020
1 parent 79d4a23 commit 60d036c
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ public void initialize(URL location, ResourceBundle resources) {

leftList.setCellFactory(fileListView -> new FileNameCell());

this.fileListChangeListener = change -> this.toggleGenerateButton();
fm.getSelectedFilesList().addListener(fileListChangeListener);
this.fileListChangeListener = change -> {
btnGenerate.setDisable(change.getList().isEmpty());
};
fm.getSelectedFilesList().addListener(this.fileListChangeListener);
btnGenerate.setDisable(fm.getSelectedFilesList().isEmpty());
}

@Override
Expand Down Expand Up @@ -206,15 +209,6 @@ public void nextMode(Event e) {
//UTILITY



public void toggleGenerateButton() {
if (rightList.getItems().size() == 0) {
btnGenerate.setDisable(true);
} else {
btnGenerate.setDisable(false);
}
}

/**
* Loads strings from <code>resources</code> and saves it to private strings.
* If a value can't be loaded from <code>resources</code>, the private string keeps the default value.
Expand Down

0 comments on commit 60d036c

Please sign in to comment.