/** {@inheritDoc} */ @Override public E remove(int visibleIndex) { final E result = get(visibleIndex); super.remove(visibleIndex); return result; }
/** {@inheritDoc} */ @Override public E remove(int visibleIndex) { final E result = get(visibleIndex); super.remove(visibleIndex); return result; }
/** @inheritDoc */ public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } }
/** @inheritDoc */ @Override public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } }
/** @inheritDoc */ public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } }
/** @inheritDoc */ @Override public void moveColumn(int columnIndex, int newIndex) { if (columnIndex < 0 || columnIndex >= getColumnCount()) throw new IllegalArgumentException("columnIndex out of range"); if (newIndex < 0 || newIndex >= getColumnCount()) throw new IllegalArgumentException("newIndex out of range"); // If the column has not yet moved far enough to change positions // post the event anyway, the "draggedDistance" property of the // tableHeader will say how far the column has been dragged. // Here we are really trying to get the best out of an // API that could do with some rethinking. We preserve backward // compatibility by slightly bending the meaning of these methods. if (columnIndex == newIndex) { fireColumnMoved(new TableColumnModelEvent(this, columnIndex, newIndex)); return; } swingThreadSource.getReadWriteLock().writeLock().lock(); try { final boolean selected = selectionModel.isSelectedIndex(columnIndex); swingThreadSource.add(newIndex, swingThreadSource.remove(columnIndex)); // preserve the selection after the move if one existed if (selected) selectionModel.addSelectionInterval(newIndex, newIndex); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } }
/** @inheritDoc */ public void moveColumn(int columnIndex, int newIndex) { if (columnIndex < 0 || columnIndex >= getColumnCount()) throw new IllegalArgumentException("columnIndex out of range"); if (newIndex < 0 || newIndex >= getColumnCount()) throw new IllegalArgumentException("newIndex out of range"); // If the column has not yet moved far enough to change positions // post the event anyway, the "draggedDistance" property of the // tableHeader will say how far the column has been dragged. // Here we are really trying to get the best out of an // API that could do with some rethinking. We preserve backward // compatibility by slightly bending the meaning of these methods. if (columnIndex == newIndex) { fireColumnMoved(new TableColumnModelEvent(this, columnIndex, newIndex)); return; } swingThreadSource.getReadWriteLock().writeLock().lock(); try { final boolean selected = selectionModel.isSelectedIndex(columnIndex); swingThreadSource.add(newIndex, swingThreadSource.remove(columnIndex)); // preserve the selection after the move if one existed if (selected) selectionModel.addSelectionInterval(newIndex, newIndex); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } }
/** @inheritDoc */ public void moveColumn(int columnIndex, int newIndex) { if (columnIndex < 0 || columnIndex >= getColumnCount()) throw new IllegalArgumentException("columnIndex out of range"); if (newIndex < 0 || newIndex >= getColumnCount()) throw new IllegalArgumentException("newIndex out of range"); // If the column has not yet moved far enough to change positions // post the event anyway, the "draggedDistance" property of the // tableHeader will say how far the column has been dragged. // Here we are really trying to get the best out of an // API that could do with some rethinking. We preserve backward // compatibility by slightly bending the meaning of these methods. if (columnIndex == newIndex) { fireColumnMoved(new TableColumnModelEvent(this, columnIndex, newIndex)); return; } swingThreadSource.getReadWriteLock().writeLock().lock(); try { final boolean selected = selectionModel.isSelectedIndex(columnIndex); swingThreadSource.add(newIndex, swingThreadSource.remove(columnIndex)); // preserve the selection after the move if one existed if (selected) selectionModel.addSelectionInterval(newIndex, newIndex); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } }