-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccountReferenceDataTableViewController.java
More file actions
53 lines (44 loc) · 1.78 KB
/
Copy pathAccountReferenceDataTableViewController.java
File metadata and controls
53 lines (44 loc) · 1.78 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.Account;
import application.CayenneReferenceDataCache;
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 AccountReferenceDataTableViewController implements IGenericReferenceDataController
{
@FXML
private TableView<Account> accountReferenceDataTableView;
@FXML
private TableColumn<Account, Integer> accountNumTableColumn;
@FXML
private TableColumn<Account, String> accountShortNameTableColumn;
@FXML
private TableColumn<Account, String> accountFullNameTableColumn;
@FXML
private TableColumn<Account, String> accountTypeCodeTableColumn;
private final ObservableList<Account> accountsObservableList = FXCollections.observableArrayList();
private final FilteredList<Account> accountsFilteredList = new FilteredList<>(this.accountsObservableList, p -> true);
private final SortedList<Account> accountsSortedList = new SortedList<>(this.accountsFilteredList);
@Override
public void initialize(final URL location, final ResourceBundle resources)
{
this.accountsSortedList.comparatorProperty().bind(this.accountReferenceDataTableView.comparatorProperty());
this.accountsObservableList.addAll(CayenneReferenceDataCache.loadAllActiveAccounts().values());
this.accountReferenceDataTableView.setItems(this.accountsSortedList);
}
@Override
public FilteredList<Account> getInnerTableViewControlDataSource()
{
return this.accountsFilteredList;
}
@Override
public void filter(final String filterText)
{
}
}