19 package org.sleuthkit.autopsy.timeline.ui;
21 import java.util.function.Supplier;
22 import javafx.scene.control.IndexedCell;
23 import javafx.scene.control.ListCell;
24 import javafx.scene.control.TableCell;
25 import javafx.scene.control.TableColumn;
26 import javafx.scene.control.TreeTableCell;
27 import javafx.scene.control.TreeTableColumn;
28 import javafx.scene.control.TreeTableView;
39 public TreeTableCell< X, Y>
forTreeTable(TreeTableColumn< X, Y> column) {
40 return new AbstractTreeTableCell();
43 public TableCell<X, Y>
forTable(TableColumn<X, Y> column) {
44 return new AbstractTableCell();
48 return new AbstractListCell();
51 protected abstract void configureCell(IndexedCell<? extends Y> cell, Y item,
boolean empty, Supplier<X> supplier);
56 @SuppressWarnings({
"unchecked"})
58 super.updateItem(item, empty);
59 configureCell(
this, item, empty, (() -> (X) this.getTableRow().getItem()));
67 super.updateItem(item, empty);
72 TreeTableView<X> treeTableView = this.treeTableViewProperty().get();
73 this.setTranslateX(treeTableView.getTreeItemLevel(treeTableView.getTreeItem(getIndex())) << 4);
74 configureCell(
this, item, empty, (() -> this.getTreeTableRow().getItem()));
81 @SuppressWarnings(
"unchecked")
83 super.updateItem(item, empty);
void updateItem(Y item, boolean empty)
TableCell< X, Y > forTable(TableColumn< X, Y > column)
abstract void configureCell(IndexedCell<?extends Y > cell, Y item, boolean empty, Supplier< X > supplier)
TreeTableCell< X, Y > forTreeTable(TreeTableColumn< X, Y > column)
void updateItem(Y item, boolean empty)
void updateItem(Y item, boolean empty)