// get cell TableColumn tableColumn = table.getColumns().get(colIndex); ObservableValue observableValue = tableColumn.getCellObservableValue(rowIndex); if( observableValue instanceof StringProperty) { ((StringProperty) observableValue).set(clipboardCellContent); }
public boolean evaluate(T item) { ObservableValue<R> value = tableColumn.getCellObservableValue(item); return unselectedValues.size() == 0 || !unselectedValues.contains(value.getValue()); }
private static ArrayList<String> getTableViewValues(TableView tableView) { ArrayList<String> values = new ArrayList<>(); ObservableList<TableColumn> columns = tableView.getColumns(); for (Object row : tableView.getItems()) { for (TableColumn column : columns) { values.add( (String) column. getCellObservableValue(row). getValue()); } } return values; }
TablePosition pos = table.getSelectionModel().getSelectedCells().get(0); int row = pos.getRow(); // Item here is the table view type: Item item = table.getItems().get(row); TableColumn col = pos.getTableColumn(); // this gives the value in the selected cell: String data = (String) col.getCellObservableValue(item).getValue();
ObservableList<TablePosition> selectedCells = table.getSelectionModel().getSelectedCells() ; selectedCells.addListener((ListChangeListener.Change<? extends TablePosition> change) -> { if (selectedCells.size() > 0) { TablePosition selectedCell = selectedCells.get(0); TableColumn column = selectedCell.getTableColumn(); int rowIndex = selectedCell.getRow(); Object data = column.getCellObservableValue(rowIndex).getValue(); } });
ObservableValue observableValue = tableColumn.getCellObservableValue(rowTable);
private void initializeValues() { tableFilter.getBackingList().stream() .forEach(t -> addBackingItem(t, tableColumn.getCellObservableValue(t))); tableFilter.getTableView().getItems().stream() .map(tableColumn::getCellObservableValue).forEach(this::addVisibleItem); }
public static TableCell<?, ?> getCellAt(TableView<?> tableView, int row, int column) { TableCell<?, ?> cell = getVisibleCellAt(tableView, row, column); if (cell != null) { return cell; } TableColumn tableColumn = tableView.getColumns().get(column); cell = (TableCell) tableColumn.getCellFactory().call(tableColumn); ObservableValue cellObservableValue = tableColumn.getCellObservableValue(row); if (cellObservableValue == null) return null; Object value = cellObservableValue.getValue(); Method updateItem; try { updateItem = cell.getClass().getDeclaredMethod("updateItem", new Class[] {Object.class, Boolean.TYPE}); updateItem.setAccessible(true); updateItem.invoke(cell, value, false); return cell; } catch (Throwable e) { throw new RuntimeException(e); } }
ObservableValue observableValue = tableColumn.getCellObservableValue(rowTable);
ObservableValue observableValue = tableColumn.getCellObservableValue(rowTable);