/** {@inheritDoc} */ @Override public E set(int index, E value) { if(!isWritable()) throw new IllegalStateException("List " + this.getClass().getName() + " cannot be modified in the current state"); if(index < 0 || index >= size()) throw new IndexOutOfBoundsException("Cannot set at " + index + " on list of size " + size()); return (E) source.set(getSourceIndex(index), (S) value); }
/** {@inheritDoc} */ @Override public void add(int index, E value) { if(!isWritable()) throw new IllegalStateException("Non-writable List cannot be modified"); if(index < 0 || index > size()) throw new IndexOutOfBoundsException("Cannot add at " + index + " on list of size " + size()); final int sourceIndex = index < size() ? getSourceIndex(index) : source.size(); source.add(sourceIndex, (S) value); }
/** {@inheritDoc} */ @Override public void add(int index, E value) { if(!isWritable()) throw new IllegalStateException("Non-writable List cannot be modified"); if(index < 0 || index > size()) throw new IndexOutOfBoundsException("Cannot add at " + index + " on list of size " + size()); final int sourceIndex = index < size() ? getSourceIndex(index) : source.size(); source.add(sourceIndex, (S) value); }
/** {@inheritDoc} */ @Override public E set(int index, E value) { if(!isWritable()) throw new IllegalStateException("List " + this.getClass().getName() + " cannot be modified in the current state"); if(index < 0 || index >= size()) throw new IndexOutOfBoundsException("Cannot set at " + index + " on list of size " + size()); return (E) source.set(getSourceIndex(index), (S) value); }
/** {@inheritDoc} */ @Override public void add(int index, E value) { if(!isWritable()) throw new IllegalStateException("Non-writable List cannot be modified"); if(index < 0 || index > size()) throw new IndexOutOfBoundsException("Cannot add at " + index + " on list of size " + size()); final int sourceIndex = index < size() ? getSourceIndex(index) : source.size(); source.add(sourceIndex, (S) value); }
/** {@inheritDoc} */ @Override public E remove(int index) { if(!isWritable()) throw new IllegalStateException("Non-writable List cannot be modified"); if(index < 0 || index >= size()) throw new IndexOutOfBoundsException("Cannot remove at " + index + " on list of size " + size()); return (E) source.remove(getSourceIndex(index)); }
/** {@inheritDoc} */ @Override public E remove(int index) { if(!isWritable()) throw new IllegalStateException("Non-writable List cannot be modified"); if(index < 0 || index >= size()) throw new IndexOutOfBoundsException("Cannot remove at " + index + " on list of size " + size()); return (E) source.remove(getSourceIndex(index)); }
/** {@inheritDoc} */ @Override public E set(int index, E value) { if(!isWritable()) throw new IllegalStateException("List " + this.getClass().getName() + " cannot be modified in the current state"); if(index < 0 || index >= size()) throw new IndexOutOfBoundsException("Cannot set at " + index + " on list of size " + size()); return (E) source.set(getSourceIndex(index), (S) value); }
/** {@inheritDoc} */ @Override public E remove(int index) { if(!isWritable()) throw new IllegalStateException("Non-writable List cannot be modified"); if(index < 0 || index >= size()) throw new IndexOutOfBoundsException("Cannot remove at " + index + " on list of size " + size()); return (E) source.remove(getSourceIndex(index)); }
/** @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 getColumnCount() { swingThreadSource.getReadWriteLock().readLock().lock(); try { return swingThreadSource.size(); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** @inheritDoc */ public int getColumnCount() { swingThreadSource.getReadWriteLock().readLock().lock(); try { return swingThreadSource.size(); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** @inheritDoc */ public int getColumnCount() { swingThreadSource.getReadWriteLock().readLock().lock(); try { return swingThreadSource.size(); } finally { swingThreadSource.getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ public int getRowCount() { // a row for every list element, plus the headers swtThreadSource.getReadWriteLock().readLock().lock(); try { return swtThreadSource.size() + getFixedHeaderRowCount(); } finally { swtThreadSource.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(); } }
/** * 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(); } }