/** * Returns the element at the specified position in this list. This unwraps * a {@link CheckWrapped} object from the source if necessary. */ @Override public E get(int index) { if(checkableTableFormat != null) { return super.get(index); } else { CheckWrapped<E> checkWrapped = (CheckWrapped<E>)super.get(index); return checkWrapped.getWrapped(); } }
/** @inheritDoc */ public TableColumn getColumn(int columnIndex) { swingThreadSource.getReadWriteLock().readLock().lock(); try { return swingThreadSource.get(columnIndex); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** @inheritDoc */ @Override public TableColumn getColumn(int columnIndex) { swingThreadSource.getReadWriteLock().readLock().lock(); try { return swingThreadSource.get(columnIndex); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** * Returns the element at the specified position in this list. This unwraps * a {@link CheckWrapped} object from the source if necessary. */ @Override public E get(int index) { if(checkableTableFormat != null) { return super.get(index); } else { CheckWrapped<E> checkWrapped = (CheckWrapped<E>)super.get(index); return checkWrapped.getWrapped(); } }
/** @inheritDoc */ public TableColumn getColumn(int columnIndex) { swingThreadSource.getReadWriteLock().readLock().lock(); try { return swingThreadSource.get(columnIndex); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** * Returns the element at the specified position in this list. This unwraps * a {@link CheckWrapped} object from the source if necessary. */ @Override public E get(int index) { if(checkableTableFormat != null) { return super.get(index); } else { CheckWrapped<E> checkWrapped = (CheckWrapped<E>)super.get(index); return checkWrapped.getWrapped(); } }
/** @inheritDoc */ public int getColumnIndex(Object identifier) { if (identifier == null) throw new IllegalArgumentException("identifier is null"); swingThreadSource.getReadWriteLock().readLock().lock(); try { for (int i = 0, n = swingThreadSource.size(); i < n; i++) { if (identifier.equals(swingThreadSource.get(i).getIdentifier())) return i; } throw new IllegalArgumentException("Identifier not found"); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** @inheritDoc */ @Override public int getColumnIndex(Object identifier) { if (identifier == null) throw new IllegalArgumentException("identifier is null"); swingThreadSource.getReadWriteLock().readLock().lock(); try { for (int i = 0, n = swingThreadSource.size(); i < n; i++) { if (identifier.equals(swingThreadSource.get(i).getIdentifier())) return i; } throw new IllegalArgumentException("Identifier not found"); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** * Recalculates the total combined width of all columns. */ private void recalcWidthCache() { swingThreadSource.getReadWriteLock().readLock().lock(); try { totalColumnWidth = 0; for (int i = 0, n = swingThreadSource.size(); i < n; i++) totalColumnWidth += swingThreadSource.get(i).getWidth(); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** @inheritDoc */ public int getColumnIndex(Object identifier) { if (identifier == null) throw new IllegalArgumentException("identifier is null"); swingThreadSource.getReadWriteLock().readLock().lock(); try { for (int i = 0, n = swingThreadSource.size(); i < n; i++) { if (identifier.equals(swingThreadSource.get(i).getIdentifier())) return i; } throw new IllegalArgumentException("Identifier not found"); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** * Recalculates the total combined width of all columns. */ private void recalcWidthCache() { swingThreadSource.getReadWriteLock().readLock().lock(); try { totalColumnWidth = 0; for (int i = 0, n = swingThreadSource.size(); i < n; i++) totalColumnWidth += swingThreadSource.get(i).getWidth(); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** * Recalculates the total combined width of all columns. */ private void recalcWidthCache() { swingThreadSource.getReadWriteLock().readLock().lock(); try { totalColumnWidth = 0; for (int i = 0, n = swingThreadSource.size(); i < n; i++) totalColumnWidth += swingThreadSource.get(i).getWidth(); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** @inheritDoc */ public int getColumnIndexAtX(int x) { if (x < 0) return -1; swingThreadSource.getReadWriteLock().readLock().lock(); try { for (int i = 0, n = swingThreadSource.size(); i < n; i++) { TableColumn column = swingThreadSource.get(i); x = x - column.getWidth(); if (x < 0) return i; } } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } return -1; }
/** @inheritDoc */ @Override public int getColumnIndexAtX(int x) { if (x < 0) return -1; swingThreadSource.getReadWriteLock().readLock().lock(); try { for (int i = 0, n = swingThreadSource.size(); i < n; i++) { TableColumn column = swingThreadSource.get(i); x = x - column.getWidth(); if (x < 0) return i; } } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } return -1; }
/** {@inheritDoc} */ public boolean isRowResizable(int row) { // header rows are not resizable if(row < getFixedHeaderRowCount()) { return false; // regular rows may be resizable } else { swtThreadSource.getReadWriteLock().readLock().lock(); try { return kTableFormat.isRowResizable(swtThreadSource.get(row - getFixedHeaderRowCount())); } finally { swtThreadSource.getReadWriteLock().readLock().unlock(); } } }
/** @inheritDoc */ public int getColumnIndexAtX(int x) { if (x < 0) return -1; swingThreadSource.getReadWriteLock().readLock().lock(); try { for (int i = 0, n = swingThreadSource.size(); i < n; i++) { TableColumn column = swingThreadSource.get(i); x = x - column.getWidth(); if (x < 0) return i; } } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } return -1; }
/** {@inheritDoc} */ public String getTooltipAt(int column, int row) { // headers have no tooltips if(row < getFixedHeaderRowCount()) { return null; // get regular row tooltips } else { swtThreadSource.getReadWriteLock().readLock().lock(); try { return kTableFormat.getColumnTooltip(swtThreadSource.get(row - getFixedHeaderRowCount()), column); } finally { swtThreadSource.getReadWriteLock().readLock().unlock(); } } }
/** {@inheritDoc} */ public KTableCellRenderer getCellRenderer(int column, int row) { // headers get the default renderer if(row < getFixedHeaderRowCount()) { return KTableCellRenderer.defaultRenderer; // regular rows may have a custom renderer } else { swtThreadSource.getReadWriteLock().readLock().lock(); try { return kTableFormat.getColumnRenderer(swtThreadSource.get(row - getFixedHeaderRowCount()), column); } finally { swtThreadSource.getReadWriteLock().readLock().unlock(); } } }
/** {@inheritDoc} */ public void setRowHeight(int row, int value) { // header rows are not resizable if(row < getFixedHeaderRowCount()) { return; // regular rows may be resizable } else { swtThreadSource.getReadWriteLock().readLock().lock(); try { kTableFormat.setRowHeight(swtThreadSource.get(row - getFixedHeaderRowCount()), value); } finally { swtThreadSource.getReadWriteLock().readLock().unlock(); } } } }
/** {@inheritDoc} */ public Object getContentAt(int column, int row) { // get header content if(row < getFixedHeaderRowCount()) { return kTableFormat.getColumnHeaderValue(row, column); // get regular cell content } else { swtThreadSource.getReadWriteLock().readLock().lock(); try { return kTableFormat.getColumnValue(swtThreadSource.get(row - getFixedHeaderRowCount()), column); } finally { swtThreadSource.getReadWriteLock().readLock().unlock(); } } }