Example usage for javafx.collections ObservableList sorted

List of usage examples for javafx.collections ObservableList sorted

Introduction

In this page you can find the example usage for javafx.collections ObservableList sorted.

Prototype

public default SortedList<E> sorted(Comparator<E> comparator) 

Source Link

Document

Creates a SortedList wrapper of this list using the specified comparator.

Usage

From source file:ninja.eivind.hotsreplayuploader.window.nodes.UploaderNode.java

private void bindList() {
    final ObservableList<ReplayFile> files = uploaderService.getFiles();
    newReplaysCount.setText(String.valueOf(files.size()));
    files.addListener(//from   ww  w. j  a  v a2s  . c  o  m
            (ListChangeListener<ReplayFile>) c -> newReplaysCount.setText(String.valueOf(files.size())));
    newReplaysView.setItems(files.sorted(new ReplayFileComparator()));
    newReplaysView.setCellFactory(new CustomListCellFactory(uploaderService));

    uploadedReplays.textProperty().bind(uploaderService.getUploadedCount());
}