@Override public void setDraggedColumn(TableColumn pAColumn) { int lIndex = -1; if (pAColumn != null) lIndex = getColumnModel().getColumnIndex(pAColumn.getIdentifier()); if (lIndex != 0) super.setDraggedColumn(pAColumn); }
public int compare(TableColumn c1, TableColumn c2) { Integer index1 = (Integer)c1.getIdentifier(); Integer index2 = (Integer)c2.getIdentifier(); return index1.compareTo(index2); } });
/** * Whether the table column is sortable. * * @param column * the table column to test. * @return true is the table column is sortable. */ protected boolean isSortable(TableColumn column) { return column.getIdentifier() != null && column.getIdentifier().toString().length() > 0 && !column.getIdentifier().toString().startsWith("#"); }
private boolean isColumnReadOnly(TableColumn aViewCol) { if (aViewCol.getIdentifier() instanceof ModelColumn) { return ((ModelColumn) aViewCol.getIdentifier()).isReadOnly(); } return false; } }
@Override public int getColumnIndex(Object columnIdentifier) { if (columnIdentifier == null) { throw new IllegalArgumentException("Dont send null to getColumnIndex, null shouldn't be in the sorting table."); } for (int x = 0; x < columnList.size(); x++) { if (columnList.get(x).getIdentifier().equals(columnIdentifier)) { return x; } } throw new IllegalArgumentException(); }
/** * {@inheritDoc} */ public TableColumnExt getColumnExt(Object identifier) { for (Iterator<TableColumn> iter = initialColumns.iterator(); iter.hasNext();) { TableColumn column = iter.next(); if ((column instanceof TableColumnExt) && (identifier.equals(column.getIdentifier()))) { return (TableColumnExt) column; } } return null; }
/** * {@inheritDoc} */ @Override public TableColumnExt getColumnExt(Object identifier) { for (Iterator<TableColumn> iter = initialColumns.iterator(); iter.hasNext();) { TableColumn column = iter.next(); if ((column instanceof TableColumnExt) && (identifier.equals(column.getIdentifier()))) { return (TableColumnExt) column; } } return null; }
/** * {@inheritDoc} */ @Override public TableColumnExt getColumnExt(Object identifier) { for (Iterator<TableColumn> iter = initialColumns.iterator(); iter.hasNext();) { TableColumn column = iter.next(); if ((column instanceof TableColumnExt) && (identifier.equals(column.getIdentifier()))) { return (TableColumnExt) column; } } return null; }
private void orderUpdate() { // order.clear(); if (!frozen) { order = new ArrayList<Sortables>(); for (TableColumn c : columnList) { order.add((Sortables) c.getIdentifier()); } } check(); }
protected AbstractApplicationTableModel(TableColumnModelExt columnModel, boolean createNewRow, boolean createEmptyRowIsEmpty) { this.identifiers = Lists.newArrayListWithCapacity(columnModel.getColumnCount()); for (TableColumn tc : columnModel.getColumns(true)) { this.identifiers.add((ColumnIdentifier<R>) tc.getIdentifier()); } this.createNewRow = createNewRow; this.createEmptyRowIsEmpty = createEmptyRowIsEmpty; }
/** * {@inheritDoc} */ @Override public Object getColumnIdentifierAt(int columnIndex) { if ((columnIndex < 0) || (columnIndex >= getColumnCount())) { throw new ArrayIndexOutOfBoundsException( "invalid column index: " + columnIndex); } TableColumn column = getColumnByModelIndex(columnIndex); Object identifier = column != null ? column.getIdentifier() : null; return identifier; }
/** * {@inheritDoc} */ @Override public Object getColumnIdentifierAt(int columnIndex) { if ((columnIndex < 0) || (columnIndex >= getColumnCount())) { throw new ArrayIndexOutOfBoundsException( "invalid column index: " + columnIndex); } TableColumn column = getColumnByModelIndex(columnIndex); Object identifier = column != null ? column.getIdentifier() : null; return identifier; }
/** * {@inheritDoc} */ @Override public Object getColumnIdentifierAt(int columnIndex) { if ((columnIndex < 0) || (columnIndex >= getColumnCount())) { throw new ArrayIndexOutOfBoundsException( "invalid column index: " + columnIndex); } TableColumn column = getColumnByModelIndex(columnIndex); Object identifier = column != null ? column.getIdentifier() : null; return identifier; }
private static boolean canMove(TableColumn column, JTableHeader header) { return (column != null) && header.getReorderingAllowed() && header.getColumnModel().getColumnIndex(column.getIdentifier()) != 0; }
private void installColumn(TableColumn column) { this.column = column; column.addPropertyChangeListener(getColumnListener()); updateFromColumnHeader(column.getHeaderValue()); // #429-swing: actionCommand must be string if (column.getIdentifier() != null) { setActionCommand(column.getIdentifier().toString()); } boolean visible = (column instanceof TableColumnExt) ? ((TableColumnExt) column).isVisible() : true; updateFromColumnVisible(visible); }
private void installColumn(TableColumn column) { this.column = column; column.addPropertyChangeListener(getColumnListener()); updateFromColumnHeader(column.getHeaderValue()); // #429-swing: actionCommand must be string if (column.getIdentifier() != null) { setActionCommand(column.getIdentifier().toString()); } boolean visible = (column instanceof TableColumnExt) ? ((TableColumnExt) column).isVisible() : true; updateFromColumnVisible(visible); }
private void installColumn(TableColumn column) { this.column = column; column.addPropertyChangeListener(getColumnListener()); updateFromColumnHeader(column.getHeaderValue()); // #429-swing: actionCommand must be string if (column.getIdentifier() != null) { setActionCommand(column.getIdentifier().toString()); } boolean visible = (column instanceof TableColumnExt) ? ((TableColumnExt) column).isVisible() : true; updateFromColumnVisible(visible); }
private void installColumn(TableColumn column) { this.column = column; column.addPropertyChangeListener(getColumnListener()); updateFromColumnHeader(column.getHeaderValue()); // #429-swing: actionCommand must be string if (column.getIdentifier() != null) { setActionCommand(column.getIdentifier().toString()); } boolean visible = (column instanceof TableColumnExt) ? ((TableColumnExt) column).isVisible() : true; updateFromColumnVisible(visible); }
private void installColumn(TableColumn column) { this.column = column; column.addPropertyChangeListener(getColumnListener()); updateFromColumnHeader(column.getHeaderValue()); // #429-swing: actionCommand must be string if (column.getIdentifier() != null) { setActionCommand(column.getIdentifier().toString()); } boolean visible = (column instanceof TableColumnExt) ? ((TableColumnExt) column).isVisible() : true; updateFromColumnVisible(visible); }
public void showColumn(final int _modelIndex){ final TableColumn col = new TableColumn(_modelIndex); col.setIdentifier(getTable().getModel().getColumnName(_modelIndex)); col.setHeaderValue(col.getIdentifier()); getColumnModel().addColumn(col); adjustWidth(col); }