private TableColumnExt getTableColumnExt(int modelIndex) { return (TableColumnExt) this.heatmap.getColumns(true).get(modelIndex); }
private void updateColumnSizeIfVisible(TableColumns column, int width, int maxWidth) { table.getColumns(true).get(column.getColumn()).setMaxWidth(maxWidth); table.getColumns(true).get(column.getColumn()).setPreferredWidth(width); }
protected TableColumn getColumnByModelIndex(int modelColumn) { // throwing here makes a filter test fail .. it's probably an issue // but don't want to touch (swingx filters will be gone soon) // if ((modelColumn < 0) || (modelColumn >= getColumnCount())) { // throw new IllegalArgumentException("invalid column index: " + // modelColumn); // } List<TableColumn> columns = table.getColumns(true); for (Iterator<TableColumn> iter = columns.iterator(); iter .hasNext();) { TableColumn column = iter.next(); if (column.getModelIndex() == modelColumn) { return column; } } return null; }
/** * Initialize the width related properties of all contained TableColumns, * both visible and hidden. * <p> * <ul> * <li>PENDING: move into ColumnFactory? * <li>PENDING: what to do if autoCreateColumn off? * <li>PENDING: public? to allow manual setting of column properties which * might effect their default sizing. Needed in testing - but real-world? * the factory is meant to do the property setting, based on tableModel and * meta-data (from where?). But leads to funny call sequence for per-table * factory (new JXTable(), table.setColumnFactory(..), table.setModel(...)) * </ul> * * @see #initializeColumnPreferredWidth(TableColumn) */ protected void initializeColumnWidths() { for (TableColumn column : getColumns(true)) { initializeColumnPreferredWidth(column); } }
/** * Remove all columns, make sure to include hidden. * <p> */ private void removeColumns() { /* * TODO: promote this method to superclass, and change * createDefaultColumnsFromModel() to call this method */ List<TableColumn> columns = getColumns(true); for (Iterator<TableColumn> iter = columns.iterator(); iter.hasNext();) { getColumnModel().removeColumn(iter.next()); } }
/** * Remove all columns, make sure to include hidden. * <p> */ private void removeColumns() { /* * TODO: promote this method to superclass, and change * createDefaultColumnsFromModel() to call this method */ List<TableColumn> columns = getColumns(true); for (Iterator<TableColumn> iter = columns.iterator(); iter.hasNext();) { getColumnModel().removeColumn(iter.next()); } }
/** * Initialize the width related properties of all contained TableColumns, * both visible and hidden. * <p> * <ul> * <li>PENDING: move into ColumnFactory? * <li>PENDING: what to do if autoCreateColumn off? * <li>PENDING: public? to allow manual setting of column properties which * might effect their default sizing. Needed in testing - but real-world? * the factory is meant to do the property setting, based on tableModel and * meta-data (from where?). But leads to funny call sequence for per-table * factory (new JXTable(), table.setColumnFactory(..), table.setModel(...)) * </ul> * * @see #initializeColumnPreferredWidth(TableColumn) */ protected void initializeColumnWidths() { for (TableColumn column : getColumns(true)) { initializeColumnPreferredWidth(column); } }
/** * Initialize the width related properties of all contained TableColumns, * both visible and hidden. * <p> * <ul> * <li>PENDING: move into ColumnFactory? * <li>PENDING: what to do if autoCreateColumn off? * <li>PENDING: public? to allow manual setting of column properties which * might effect their default sizing. Needed in testing - but real-world? * the factory is meant to do the property setting, based on tableModel and * meta-data (from where?). But leads to funny call sequence for per-table * factory (new JXTable(), table.setColumnFactory(..), table.setModel(...)) * </ul> * * @see #initializeColumnPreferredWidth(TableColumn) */ protected void initializeColumnWidths() { for (TableColumn column : getColumns(true)) { initializeColumnPreferredWidth(column); } }
/** * Initialize the width related properties of all contained TableColumns, * both visible and hidden. * <p> * <ul> * <li>PENDING: move into ColumnFactory? * <li>PENDING: what to do if autoCreateColumn off? * <li>PENDING: public? to allow manual setting of column properties which * might effect their default sizing. Needed in testing - but real-world? * the factory is meant to do the property setting, based on tableModel and * meta-data (from where?). But leads to funny call sequence for per-table * factory (new JXTable(), table.setColumnFactory(..), table.setModel(...)) * </ul> * * @see #initializeColumnPreferredWidth(TableColumn) */ protected void initializeColumnWidths() { for (TableColumn column : getColumns(true)) { initializeColumnPreferredWidth(column); } }
/** * Remove all columns, make sure to include hidden. * <p> */ private void removeColumns() { /* * TODO: promote this method to superclass, and change * createDefaultColumnsFromModel() to call this method */ List<TableColumn> columns = getColumns(true); for (Iterator<TableColumn> iter = columns.iterator(); iter.hasNext();) { getColumnModel().removeColumn(iter.next()); } }
/** * Remove all columns, make sure to include hidden. * <p> */ private void removeColumns() { /* * TODO: promote this method to superclass, and change * createDefaultColumnsFromModel() to call this method */ List<TableColumn> columns = getColumns(true); for (Iterator<TableColumn> iter = columns.iterator(); iter.hasNext();) { getColumnModel().removeColumn(iter.next()); } }
/** * Remove all columns, make sure to include hidden. * <p> */ private void removeColumns() { /* * TODO: promote this method to superclass, and change * createDefaultColumnsFromModel() to call this method */ List<TableColumn> columns = getColumns(true); for (Iterator<TableColumn> iter = columns.iterator(); iter.hasNext();) { getColumnModel().removeColumn(iter.next()); } }
/** * Creates and adds a ColumnVisiblityAction for every column that should be * togglable via the column control. <p> * * Here: all table columns contained in the <code>TableColumnModel</code> - * visible and invisible columns - to <code>createColumnVisibilityAction</code> and * adds all not <code>null</code> return values. * * <p> * PRE: canControl() * * @see #createColumnVisibilityAction */ protected void createVisibilityActions() { List<TableColumn> columns = table.getColumns(true); for (TableColumn column : columns) { ColumnVisibilityAction action = createColumnVisibilityAction(column); if (action != null) { getColumnVisibilityActions().add(action); } } }
/** * Creates and adds a ColumnVisiblityAction for every column that should be * togglable via the column control. <p> * * Here: all table columns contained in the <code>TableColumnModel</code> - * visible and invisible columns - to <code>createColumnVisibilityAction</code> and * adds all not <code>null</code> return values. * * <p> * PRE: canControl() * * @see #createColumnVisibilityAction */ protected void createVisibilityActions() { List<TableColumn> columns = table.getColumns(true); for (TableColumn column : columns) { ColumnVisibilityAction action = createColumnVisibilityAction(column); if (action != null) { getColumnVisibilityActions().add(action); } } }
/** * Creates and adds a ColumnVisiblityAction for every column that should be * togglable via the column control. <p> * * Here: all table columns contained in the <code>TableColumnModel</code> - * visible and invisible columns - to <code>createColumnVisibilityAction</code> and * adds all not <code>null</code> return values. * * <p> * PRE: canControl() * * @see #createColumnVisibilityAction */ protected void createVisibilityActions() { List<TableColumn> columns = table.getColumns(true); for (TableColumn column : columns) { ColumnVisibilityAction action = createColumnVisibilityAction(column); if (action != null) { getColumnVisibilityActions().add(action); } } }
@Override public void actionPerformed(ActionEvent actionEvent) { List<String> colNames = columnLayout.getColumns(); LOGGER.debug(String.format("Retrieved %d col names: <<%s>>", colNames.size(), colNames.toString())); List<TableColumns> visCols = new ArrayList<>(); Map<String, TableColumns> colNameToEnum = new HashMap<>(); for (TableColumns tcEnum : TableColumns.values()) { colNameToEnum.put(tcEnum.getName(), tcEnum); } for (TableColumn tableColumn : table.getColumns()) { Object o = tableColumn.getIdentifier(); if (!(o instanceof TableColumns)) { LOGGER.error("TableColumn identifier of unexpected type: " + tableColumn.getIdentifier().getClass().getName()); return; } TableColumns tcs = (TableColumns) o; table.getColumnExt(tcs).setVisible(false); } visCols.addAll(colNames.stream().map(colNameToEnum::get).collect(Collectors.toList())); TablesUtils.showOnlyThisColumns(table, visCols.toArray(new TableColumns[visCols.size()])); TablesUtils.sortColumnsInOrder(columnLayout, table); LOGGER.debug("Column changes applied"); } }
/** * Inits per column string values from TableColumns */ private void initPerColumnStringValues() { getStringValueRegistry().clearColumnStringValues(); for (TableColumn tableColumn : getColumns(true)) { updateStringValueForColumn(tableColumn, tableColumn.getCellRenderer()); } } /**
/** * Inits per column string values from TableColumns */ private void initPerColumnStringValues() { getStringValueRegistry().clearColumnStringValues(); for (TableColumn tableColumn : getColumns(true)) { updateStringValueForColumn(tableColumn, tableColumn.getCellRenderer()); } } /**
/** * Inits per column string values from TableColumns */ private void initPerColumnStringValues() { getStringValueRegistry().clearColumnStringValues(); for (TableColumn tableColumn : getColumns(true)) { updateStringValueForColumn(tableColumn, tableColumn.getCellRenderer()); } } /**
/** * Inits per column string values from TableColumns */ private void initPerColumnStringValues() { getStringValueRegistry().clearColumnStringValues(); for (TableColumn tableColumn : getColumns(true)) { updateStringValueForColumn(tableColumn, tableColumn.getCellRenderer()); } } /**