Skip to content

Commit

Permalink
Use setSearch method instead of exposing text field
Browse files Browse the repository at this point in the history
  • Loading branch information
alanocallaghan committed Jul 24, 2024
1 parent 595dfe2 commit 4b2ae28
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ public JavadocViewer(ReadOnlyStringProperty stylesheet, URI... urisToSearch) thr
setUpListeners();
}

/**
* Set the search text field to an input query.
* @param input The search query string.
*/
public void setSearchInput(String input) {
autoCompletionTextField.setText(input);
}

@FXML
private void onBackClicked(ActionEvent ignoredEvent) {
offset(-1);
Expand Down Expand Up @@ -139,10 +147,6 @@ protected void updateItem(URI item, boolean empty) {
}));
}

public TextField getAutoCompletionTextField() {
return autoCompletionTextField;
}

private void setUpListeners() {
back.disableProperty().bind(webView.getEngine().getHistory().currentIndexProperty().isEqualTo(0));
forward.disableProperty().bind(webView.getEngine().getHistory().currentIndexProperty().greaterThanOrEqualTo(
Expand Down

0 comments on commit 4b2ae28

Please sign in to comment.