javafx.scene.control.TableView.setRowFactory()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(332)

本文整理了Java中javafx.scene.control.TableView.setRowFactory()方法的一些代码示例,展示了TableView.setRowFactory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableView.setRowFactory()方法的具体详情如下:
包路径:javafx.scene.control.TableView
类名称:TableView
方法名:setRowFactory

TableView.setRowFactory介绍

暂无

代码示例

代码示例来源:origin: pmd/pmd

eventLogTableView.setRowFactory(tv -> {
  TableRow<LogEntry> row = new TableRow<>();
  ChangeListener<Boolean> examinedListener = (obs, oldVal, newVal) -> row.pseudoClassStateChanged(NEW_ENTRY, !newVal);

代码示例来源:origin: org.controlsfx/controlsfx

/**
 * Install the row factory on the TableView when this column is assigned to a TableView.
 */
private void installRowFactoryOnTableViewAssignment() {
  tableViewProperty().addListener((observable, oldValue, newValue) -> {
    if (newValue != null) {
      getTableView().setRowFactory(param -> new TableRow<S>() {
        @Override
        protected Skin<?> createDefaultSkin() {
          return new ExpandableTableRowSkin<>(this, TableRowExpanderColumn.this);
        }
      });
    }
  });
}

代码示例来源:origin: no.tornado/tornadofx-controls

/**
 * Install the row factory on the TableView when this column is assigned to a TableView.
 */
private void installRowFactoryOnTableViewAssignment() {
  tableViewProperty().addListener((observable, oldValue, newValue) -> {
    if (newValue != null) {
      getTableView().setRowFactory(param -> new TableRow<S>() {
        @Override
        protected Skin<?> createDefaultSkin() {
          return new ExpandableTableRowSkin<>(this, TableRowExpanderColumn.this);
        }
      });
    }
  });
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * When row on tableviw is selected this pane is shown on the right side. Make it smarter!! If on
 * mobile view, i should be show over the table view.
 */
private void buildRightPane() {
 rightPane.setStyle("-fx-background-color: white;" + "-fx-border-color: -divider-color; " + "-fx-border-width:0.5;" + "-fx-min-width: 500;");
 rightPane.managedProperty().bind(rightPane.visibleProperty());
 rightPane.setVisible(false);
 // setRight(rightPane);
 tableView.setRowFactory(param -> {
  final TableRow tableRow = new TableRow<>();
  tableRow.addEventFilter(MouseEvent.MOUSE_CLICKED, mouseClicked -> {
   if (mouseClicked.getClickCount() == 2) {
    rightPane.setVisible(true);
    final SimpleDetailsPane condensedDetailsPane = new SimpleDetailsPane();
    rightPane.getChildren().clear();
    rightPane.getChildren().add(condensedDetailsPane);
   }
  });
  return tableRow;
 });
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * When row on tableviw is selected this pane is shown on the right side. Make it smarter!! If on
 * mobile view, i should be show over the table view.
 */
private void buildRightPane() {
 rightPane.setStyle("-fx-background-color: white;" + "-fx-border-color: -divider-color; " + "-fx-border-width:0.5;" + "-fx-min-width: 500;");
 rightPane.managedProperty().bind(rightPane.visibleProperty());
 rightPane.setVisible(false);
 // setRight(rightPane);
 tableView.setRowFactory(param -> {
  final TableRow tableRow = new TableRow<>();
  tableRow.addEventFilter(MouseEvent.MOUSE_CLICKED, mouseClicked -> {
   if (mouseClicked.getClickCount() == 2) {
    rightPane.setVisible(true);
    final SimpleDetailsPane condensedDetailsPane = new SimpleDetailsPane();
    rightPane.getChildren().clear();
    rightPane.getChildren().add(condensedDetailsPane);
   }
  });
  return tableRow;
 });
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

tableView.setRowFactory(param -> {
 final EpTableRow row = new EpTableRow();
 row.setController(controller);

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

tableView.setRowFactory((param) -> new TableRow<>() {
  @Override
  protected void updateItem(AttributeDiffInfoExtended mergeResultEntry, boolean empty) {

代码示例来源:origin: org.copper-engine/copper-monitoring-client

assert copyButton != null : "fx:id=\"copyButton\" was not injected: check your FXML file 'AuditTrailResult.fxml'.";
resultTable.setRowFactory(new Callback<TableView<AuditTrailResultModel>, TableRow<AuditTrailResultModel>>() {
  @Override
  public TableRow<AuditTrailResultModel> call(TableView<AuditTrailResultModel> param) {

代码示例来源:origin: ssaring/sportstracker

private void setupTableRowFactory(final ContextMenu contextMenu) {
  getTableView().setRowFactory(tableView -> {
    final TableRow<T> tableRow = new TableRow<>();
    // update table row color when the item value, the selection or the focus has been changed
      tableRow.itemProperty().addListener((observable, oldValue, newValue) -> updateTableRowColor(tableRow));
      tableRow.selectedProperty().addListener( //
          (observable, oldValue, newValue) -> updateTableRowColor(tableRow));
      getTableView().focusedProperty().addListener( //
          (observable, oldValue, newValue) -> updateTableRowColor(tableRow));
      // bind context menu to row, but only when the row is not empty
      tableRow.contextMenuProperty().bind( //
          Bindings.when(tableRow.emptyProperty()) //
              .then((ContextMenu) null) //
              .otherwise(contextMenu));
      // add listener for double clicks for editing the selected entry (ignore in empty rows)
      tableRow.setOnMouseClicked(event -> {
        if (event.getClickCount() > 1 && getSelectedEntryCount() == 1 && !tableRow.isEmpty()) {
          getEventHandler().onEditEntry(null);
        }
      });
      return tableRow;
    });
}

代码示例来源:origin: com.intuit.karate/karate-core

table.getColumns().addAll(nameCol, typeCol, valueCol);
table.setItems(getVarList());
table.setRowFactory(tv -> {
  TableRow<Var> row = new TableRow<>();
  row.setOnMouseClicked(e -> {

代码示例来源:origin: org.copper-engine/copper-monitoring-client

assert locationColumn != null;
resultTable.setRowFactory(new Callback<TableView<LogsRowModel>, TableRow<LogsRowModel>>() {
  @Override
  public TableRow<LogsRowModel> call(TableView<LogsRowModel> param) {

相关文章