@Override protected String computeValue() { return delegate.get(); }
@Override protected String computeValue() { if (optOffice.isPresent()) { ITradingOffice office = optOffice.get(); return office.storedAmountBinding().asString().get()+" / "+office.capacityProperty().get(); } else { return "0 / 0"; } } };
@Override protected String computeValue() { if (optOffice.isPresent()) { ITradingOffice office = optOffice.get(); return office.storedAmountBinding().asString().get() + " / " + office.capacityProperty().get(); } else { return "0 / 0"; } } };
@Override protected String computeValue() { return ship.getLoadBinding().asString().get()+" / "+(ship.getLoadableSpace())+" "+shipName; } };
@Override protected String computeValue() { return ship.getLoadBinding().asString().get()+" / "+ship.getLoadableSpace(); } };
@Override protected String computeValue() { return ship.getLoadBinding().asString().get()+" / "+(ship.getLoadableSpace())+" "+shipName; } };
@Override protected String computeValue() { ICity actualCity = city.getCity(); return actualCity.getName()+" "+actualCity.getPopulationBinding().asString().get(); } };
@Override protected String computeValue() { ICity actualCity = city.getCity(); return actualCity.getName()+" "+actualCity.getPopulationBinding().asString().get(); } };
@Override protected String computeValue() { return office.storedAmountBinding().asString().get() + " / " + office.capacityProperty().get(); } };
TableView<Item> table = new TableView<>(FXCollections.observableArrayList( new Item("ok"), new Item("bad"), new Item("good"))); TableColumn<Item, String> typeColumn = new TableColumn<>("type"); typeColumn.setCellValueFactory(new PropertyValueFactory<>("type")); table.setRowFactory(tv -> { TableRow<Item> row = new TableRow<>(); StringBinding typeBinding = Bindings.selectString(row.itemProperty(), "type"); row.backgroundProperty().bind(Bindings.createObjectBinding(() -> new Background(new BackgroundFill(typeToColor(typeBinding.get()), CornerRadii.EMPTY, Insets.EMPTY)), typeBinding)); return row; }); table.getColumns().add(typeColumn);