use of eu.ggnet.dwoss.customer.ui.CustomerTaskService in project dwoss by gg-net.
the class CustomerSearchController method initialize.
@Override
public void initialize(URL url, ResourceBundle rb) {
resultListView.setCellFactory(listView -> {
return new ListCell<PicoCustomer>() {
@Override
protected void updateItem(PicoCustomer item, boolean empty) {
super.updateItem(item, empty);
// Platform.runLater(() -> { // WTF i need this, i don't know, but otherwise
if (item == null || empty) {
setText("");
} else {
setText(item.getShortDescription());
}
// });
}
};
});
// bind the checkboxes to the Set of SearchField
bindCheckBoxes();
// add contextmenu to listview
resultListView.setContextMenu(buildContextMenu());
CUSTOMER_TASK_SERVICE = new CustomerTaskService();
observableCustomers = CUSTOMER_TASK_SERVICE.getPartialResults();
resultListView.setItems(observableCustomers);
searchButton.setOnAction((ActionEvent event) -> search());
searchField.setOnKeyPressed((ke) -> {
if (ke.getCode() == KeyCode.ENTER) {
search();
}
});
SEARCH_PROPERTY.bind(searchField.textProperty());
// Needed, so the bar will fill the space, otherwise it keeps beeing small
progressBar.setMaxWidth(MAX_VALUE);
progressBar.setMaxHeight(MAX_VALUE);
// hidde the HBox
progressBar.visibleProperty().bind(CUSTOMER_TASK_SERVICE.runningProperty());
progressIndicator.visibleProperty().bind(CUSTOMER_TASK_SERVICE.runningProperty());
statusHbox.visibleProperty().bind(CUSTOMER_TASK_SERVICE.runningProperty());
progressIndicator.setProgress(0);
progressBar.setProgress(0);
progressBar.progressProperty().bind(CUSTOMER_TASK_SERVICE.progressProperty());
progressIndicator.progressProperty().bind(CUSTOMER_TASK_SERVICE.progressProperty());
Ui.progress().observe(CUSTOMER_TASK_SERVICE);
}
Aggregations