-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUomReferenceDataTableViewController.java
More file actions
53 lines (44 loc) · 1.72 KB
/
Copy pathUomReferenceDataTableViewController.java
File metadata and controls
53 lines (44 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package controller;
import java.net.URL;
import java.util.ResourceBundle;
import com.tc.app.exchangemonitor.model.cayenne.persistent.Uom;
import application.CayenneReferenceDataCache;
import entitypredicates.IUomPredicates;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
import javafx.collections.transformation.SortedList;
import javafx.fxml.FXML;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
public class UomReferenceDataTableViewController implements IGenericReferenceDataController
{
@FXML
private TableView<Uom> uomReferenceDataTableView;
@FXML
private TableColumn<Uom, String> uomCodeTableColumn;
@FXML
private TableColumn<Uom, String> uomShortNameTableColumn;
@FXML
private TableColumn<Uom, String> uomFullNameTableColumn;
private final ObservableList<Uom> uomObservableList = FXCollections.observableArrayList();
private final FilteredList<Uom> uomFilteredList = new FilteredList<>(this.uomObservableList, p -> true);
private final SortedList<Uom> uomSortedList = new SortedList<>(this.uomFilteredList);
@Override
public void initialize(final URL location, final ResourceBundle resources)
{
this.uomSortedList.comparatorProperty().bind(this.uomReferenceDataTableView.comparatorProperty());
this.uomObservableList.addAll(CayenneReferenceDataCache.loadAllActiveUoms().values());
this.uomReferenceDataTableView.setItems(this.uomSortedList);
}
@Override
public FilteredList<Uom> getInnerTableViewControlDataSource()
{
return this.uomFilteredList;
}
@Override
public void filter(final String filterText)
{
this.uomFilteredList.setPredicate(IUomPredicates.applyUomPredicate(filterText));
}
}