Search in sources :

Example 1 with TableViewManager

use of jgnash.uifx.util.TableViewManager in project jgnash by ccavanaugh.

the class ImportPageTwoController method initialize.

@FXML
private void initialize() {
    textFlow.getChildren().addAll(new Text(TextResource.getString("ImportTwo.txt")));
    deleteButton.disableProperty().bind(tableView.getSelectionModel().selectedItemProperty().isNull());
    tableView.setTableMenuButtonVisible(false);
    tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    tableView.setEditable(true);
    tableView.getItems().addListener((ListChangeListener<ImportTransaction>) c -> valid.set(tableView.getItems().size() > 0));
    buildTableView();
    tableViewManager = new TableViewManager<>(tableView, PREF_NODE);
    tableViewManager.setColumnWeightFactory(column -> PREF_COLUMN_WEIGHTS[column]);
    tableViewManager.setMinimumColumnWidthFactory(column -> MIN_COLUMN_WIDTHS[column]);
    updateDescriptor();
}
Also used : Button(javafx.scene.control.Button) ImportFilter(jgnash.convert.importat.ImportFilter) Engine(jgnash.engine.Engine) TableViewManager(jgnash.uifx.util.TableViewManager) StackPane(javafx.scene.layout.StackPane) AccountComboBox(jgnash.uifx.control.AccountComboBox) BigDecimal(java.math.BigDecimal) Nullable(jgnash.util.Nullable) ListChangeListener(javafx.collections.ListChangeListener) Map(java.util.Map) AccountType(jgnash.engine.AccountType) TableView(javafx.scene.control.TableView) ImportTransaction(jgnash.convert.importat.ImportTransaction) JavaFXUtils(jgnash.uifx.util.JavaFXUtils) TransactionType(jgnash.engine.TransactionType) Objects(java.util.Objects) FXML(javafx.fxml.FXML) Text(javafx.scene.text.Text) List(java.util.List) LocalDate(java.time.LocalDate) TextResource(jgnash.resource.util.TextResource) ImportUtils(jgnash.convert.importat.ImportUtils) BayesImportClassifier(jgnash.convert.importat.BayesImportClassifier) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) Transaction(jgnash.engine.Transaction) MouseEvent(javafx.scene.input.MouseEvent) EngineFactory(jgnash.engine.EngineFactory) FXCollections(javafx.collections.FXCollections) BigDecimalTableCell(jgnash.uifx.control.BigDecimalTableCell) TextFlow(javafx.scene.text.TextFlow) NumberFormat(java.text.NumberFormat) ArrayList(java.util.ArrayList) TableColumn(javafx.scene.control.TableColumn) GenericImport(jgnash.convert.importat.GenericImport) TableCell(javafx.scene.control.TableCell) ResourceBundle(java.util.ResourceBundle) Tooltip(javafx.scene.control.Tooltip) CurrencyNode(jgnash.engine.CurrencyNode) Label(javafx.scene.control.Label) ShortDateTableCell(jgnash.uifx.control.ShortDateTableCell) TableRow(javafx.scene.control.TableRow) ImportBank(jgnash.convert.importat.ImportBank) MaterialDesignLabel(jgnash.uifx.resource.font.MaterialDesignLabel) ResourceUtils(jgnash.resource.util.ResourceUtils) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) ImportState(jgnash.convert.importat.ImportState) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) AbstractWizardPaneController(jgnash.uifx.control.wizard.AbstractWizardPaneController) Account(jgnash.engine.Account) ContentDisplay(javafx.scene.control.ContentDisplay) Options(jgnash.uifx.Options) Text(javafx.scene.text.Text) ImportTransaction(jgnash.convert.importat.ImportTransaction) FXML(javafx.fxml.FXML)

Example 2 with TableViewManager

use of jgnash.uifx.util.TableViewManager in project jgnash by ccavanaugh.

the class ReconcileDialogController method loadTables.

private void loadTables() {
    final TableViewManager<RecTransaction> increaseTableViewManager = new TableViewManager<>(increaseTableView, PREF_NODE);
    increaseTableViewManager.setColumnWeightFactory(getColumnWeightFactory());
    increaseTableViewManager.setPreferenceKeyFactory(() -> INCREASE_KEY);
    final TableViewManager<RecTransaction> decreaseTableViewManager = new TableViewManager<>(decreaseTableView, PREF_NODE);
    decreaseTableViewManager.setColumnWeightFactory(getColumnWeightFactory());
    decreaseTableViewManager.setPreferenceKeyFactory(() -> DECREASE_KEY);
    transactions.addAll(account.getSortedTransactionList().stream().filter(this::reconcilable).map(transaction -> new RecTransaction(transaction, transaction.getReconciled(account))).collect(Collectors.toList()));
    configureTableView(increaseTableView, increaseTableViewManager);
    configureTableView(decreaseTableView, decreaseTableViewManager);
    increaseTableView.setItems(increaseList);
    decreaseTableView.setItems(decreaseList);
    updateCalculatedValues();
}
Also used : RecTransaction(jgnash.engine.RecTransaction) TableViewManager(jgnash.uifx.util.TableViewManager)

Aggregations

TableViewManager (jgnash.uifx.util.TableViewManager)2 BigDecimal (java.math.BigDecimal)1 NumberFormat (java.text.NumberFormat)1 LocalDate (java.time.LocalDate)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 ResourceBundle (java.util.ResourceBundle)1 SimpleBooleanProperty (javafx.beans.property.SimpleBooleanProperty)1 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)1 SimpleStringProperty (javafx.beans.property.SimpleStringProperty)1 FXCollections (javafx.collections.FXCollections)1 ListChangeListener (javafx.collections.ListChangeListener)1 FXML (javafx.fxml.FXML)1 Button (javafx.scene.control.Button)1 ContentDisplay (javafx.scene.control.ContentDisplay)1 Label (javafx.scene.control.Label)1 TableCell (javafx.scene.control.TableCell)1 TableColumn (javafx.scene.control.TableColumn)1