Skip to content

Commit

Permalink
Replace setting of first element with built-in method in selection model
Browse files Browse the repository at this point in the history
  • Loading branch information
ricantech authored and ricantech committed Feb 18, 2019
1 parent 205170c commit c00274c
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

public class ContentSelectorDialogView extends BaseDialog<Void> {

private static final int FIRST_ELEMENT = 0;

@FXML
private Button addFieldNameButton;
@FXML
Expand Down Expand Up @@ -109,7 +107,7 @@ private void removeKeyword() {

private void initListView(ListView<String> listViewToInit, Supplier<ListProperty<String>> backingList) {
listViewToInit.itemsProperty().bind(backingList.get());
listViewToInit.getSelectionModel().select(FIRST_ELEMENT);
listViewToInit.getSelectionModel().selectFirst();
}

private Optional<String> getSelectedFieldName() {
Expand Down

0 comments on commit c00274c

Please sign in to comment.