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

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

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

TableColumn.getText介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

  1. for (Object col : playListTableView.getColumns()) {
  2. TableColumn colCasted = ((TableColumn)col);
  3. if(colCasted.getText().equals("Artist")){
  4. colCasted.setVisible(false);
  5. }
  6. }

代码示例来源:origin: org.javafxdata/datafx-cell

  1. public static <S> void print(ObservableList<TableColumn<S, ?>> columns) {
  2. System.out.println("Columns:");
  3. for (int i = 0; i < columns.size(); i++) {
  4. TableColumn<S,?> tc = columns.get(i);
  5. System.out.println(" Text: " + tc.getText());
  6. }
  7. }

代码示例来源:origin: io.datafx/ui

  1. public static <S> void print(ObservableList<TableColumn<S, ?>> columns) {
  2. System.out.println("Columns:");
  3. for (int i = 0; i < columns.size(); i++) {
  4. TableColumn<S,?> tc = columns.get(i);
  5. System.out.println(" Text: " + tc.getText());
  6. }
  7. }

代码示例来源:origin: org.javafxdata/datafx-ui

  1. public static <S> void print(ObservableList<TableColumn<S, ?>> columns) {
  2. System.out.println("Columns:");
  3. for (int i = 0; i < columns.size(); i++) {
  4. TableColumn<S,?> tc = columns.get(i);
  5. System.out.println(" Text: " + tc.getText());
  6. }
  7. }

代码示例来源:origin: io.datafx/ui

  1. public TableViewFactory<S> renameColumn(String oldName, String newName) {
  2. if (oldName == null || oldName.isEmpty() || newName == null || newName.isEmpty()) {
  3. return this;
  4. }
  5. for (int i = 0; i < columns.size(); i++) {
  6. TableColumn<S,?> tc = columns.get(i);
  7. if (oldName.equals(tc.getText())) {
  8. tc.setText(newName);
  9. break;
  10. }
  11. }
  12. return this;
  13. }

代码示例来源:origin: org.javafxdata/datafx-cell

  1. public TableViewFactory<S> renameColumn(String oldName, String newName) {
  2. if (oldName == null || oldName.isEmpty() || newName == null || newName.isEmpty()) {
  3. return this;
  4. }
  5. for (int i = 0; i < columns.size(); i++) {
  6. TableColumn<S,?> tc = columns.get(i);
  7. if (oldName.equals(tc.getText())) {
  8. tc.setText(newName);
  9. break;
  10. }
  11. }
  12. return this;
  13. }

代码示例来源:origin: org.javafxdata/datafx-ui

  1. public TableViewFactory<S> renameColumn(String oldName, String newName) {
  2. if (oldName == null || oldName.isEmpty() || newName == null || newName.isEmpty()) {
  3. return this;
  4. }
  5. for (int i = 0; i < columns.size(); i++) {
  6. TableColumn<S,?> tc = columns.get(i);
  7. if (oldName.equals(tc.getText())) {
  8. tc.setText(newName);
  9. break;
  10. }
  11. }
  12. return this;
  13. }

代码示例来源:origin: org.javafxdata/datafx-cell

  1. public TableViewFactory<S> selectColumns(String... names) {
  2. if (names == null || names.length == 0) {
  3. return this;
  4. }
  5. TableColumn<S,?> tc;
  6. for (int i = 0; i < names.length; i++) {
  7. String name = names[i];
  8. for (int j = 0; j < columns.size(); j++) {
  9. tc = columns.get(j);
  10. if (name == null) continue;
  11. if (name.equals(tc.getText())) {
  12. finalColumns.add(tc);
  13. columnSelectPerformed = true;
  14. }
  15. }
  16. }
  17. return this;
  18. }

代码示例来源:origin: io.datafx/ui

  1. public TableViewFactory<S> selectColumns(String... names) {
  2. if (names == null || names.length == 0) {
  3. return this;
  4. }
  5. TableColumn<S,?> tc;
  6. for (int i = 0; i < names.length; i++) {
  7. String name = names[i];
  8. for (int j = 0; j < columns.size(); j++) {
  9. tc = columns.get(j);
  10. if (name == null) continue;
  11. if (name.equals(tc.getText())) {
  12. finalColumns.add(tc);
  13. columnSelectPerformed = true;
  14. }
  15. }
  16. }
  17. return this;
  18. }

代码示例来源:origin: org.javafxdata/datafx-ui

  1. public TableViewFactory<S> selectColumns(String... names) {
  2. if (names == null || names.length == 0) {
  3. return this;
  4. }
  5. TableColumn<S,?> tc;
  6. for (int i = 0; i < names.length; i++) {
  7. String name = names[i];
  8. for (int j = 0; j < columns.size(); j++) {
  9. tc = columns.get(j);
  10. if (name == null) continue;
  11. if (name.equals(tc.getText())) {
  12. finalColumns.add(tc);
  13. columnSelectPerformed = true;
  14. }
  15. }
  16. }
  17. return this;
  18. }

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

  1. public static String getColumnName(TableView<?> tableView, int i) {
  2. ObservableList<?> columns = tableView.getColumns();
  3. TableColumn<?, ?> tableColumn = (TableColumn<?, ?>) columns.get(i);
  4. return tableColumn.getText();
  5. }

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

  1. private String createCsvFromTable(TableView<T> tableView) {
  2. StringBuilder result = new StringBuilder();
  3. for (TableColumn<?, ?> column : tableView.getColumns()) {
  4. result.append(escapeCsvString(column.getText())).append("\t");
  5. }
  6. result.append("\n");
  7. for (int i = 0; i < tableView.getItems().size(); i++) {
  8. for (TableColumn<?, ?> column : tableView.getColumns()) {
  9. Object cellData = column.getCellData(i);
  10. String data = "";
  11. if (cellData != null) {
  12. data = cellData.toString();
  13. }
  14. result.append(escapeCsvString(data)).append("\t");
  15. }
  16. result.append("\n");
  17. }
  18. return result.toString();
  19. }

代码示例来源:origin: com.powsybl/powsybl-gse-security-analysis

  1. clipboardString.append('\t');
  2. clipboardString.append(table.getColumns().get(col).getText());
  3. first.set(false);
  4. });

代码示例来源:origin: stackoverflow.com

  1. private void buttonsPerHeader(TableView<Person> table, Pane root) {
  2. if (!(table.getSkin() instanceof TableViewSkinBase)) return;
  3. TableViewSkinBase skin = (TableViewSkinBase) table.getSkin();
  4. TableHeaderRow headerRow = skin.getTableHeaderRow();
  5. for (TableColumn col : table.getColumns()) {
  6. TableColumnHeader header = headerRow.getColumnHeaderFor(col);
  7. Button button = new Button(col.getText());
  8. button.prefWidthProperty().bind(Bindings.createDoubleBinding(() ->
  9. header.getBoundsInLocal().getWidth(), header.boundsInLocalProperty()));
  10. button.minWidthProperty().bind(button.prefWidthProperty());
  11. button.maxWidthProperty().bind(button.prefWidthProperty());
  12. button.layoutXProperty().bind(Bindings.createDoubleBinding(() ->
  13. header.getLocalToSceneTransform().transform(header.getBoundsInLocal()).getMinX(),
  14. header.boundsInLocalProperty(), header.localToSceneTransformProperty()));
  15. button.layoutYProperty().bind(Bindings.createDoubleBinding(() ->
  16. table.getBoundsInParent().getMaxY() ,table.boundsInParentProperty()));
  17. root.getChildren().add(button);
  18. }
  19. }

代码示例来源:origin: stackoverflow.com

  1. private void makeHeaderWrappable(TableColumn col) {
  2. Label label = new Label(col.getText());
  3. label.setStyle("-fx-padding: 8px;");
  4. label.setWrapText(true);
  5. label.setAlignment(Pos.CENTER);
  6. label.setTextAlignment(TextAlignment.CENTER);
  7. StackPane stack = new StackPane();
  8. stack.getChildren().add(label);
  9. stack.prefWidthProperty().bind(col.widthProperty().subtract(5));
  10. label.prefWidthProperty().bind(stack.prefWidthProperty());
  11. col.setGraphic(stack);
  12. }

代码示例来源:origin: stackoverflow.com

  1. XSSFRow header = sheet.createRow((short) rowIndex++);
  2. for (TableColumn column : columns) {
  3. String columnName = column.getText();
  4. XSSFCell cell = header.createCell(cellIndex++);
  5. cell.setCellValue(column.getText());
  6. cell.setCellStyle(headerStyle);

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

  1. columnOptions.add(column.getText());

代码示例来源:origin: org.tentackle/tentackle-fx

  1. cell.setText(column.getText());
  2. cell.setGraphic(column.getGraphic());
  3. cell.setFont(headerFont);

相关文章