public void lock() { delegate.lock(); // record the current Thread as a lock holder threadsHoldingLock.add(Thread.currentThread()); }
/** {@inheritDoc} */ @Override public E get(int index) { getReadWriteLock().readLock().lock(); try { return source.get(index); } finally { getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ @Override public int size() { getReadWriteLock().readLock().lock(); try { return source.size(); } finally { getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ @Override public int indexOf(Object object) { getReadWriteLock().readLock().lock(); try { return source.indexOf(object); } finally { getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { getReadWriteLock().readLock().lock(); try { return source.lastIndexOf(object); } finally { getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ @Override public boolean retainAll(Collection<?> values) { getReadWriteLock().writeLock().lock(); try { return source.retainAll(values); } finally { getReadWriteLock().writeLock().unlock(); } }
/** * {@inheritDoc} */ @Override public boolean retainAll(Collection<?> c) { source.getReadWriteLock().writeLock().lock(); try { return source.retainAll(c); } finally { source.getReadWriteLock().writeLock().unlock(); } }
/** * {@inheritDoc} */ @Override public E set(int index, E element) { source.getReadWriteLock().writeLock().lock(); try { return source.set(index, element); } finally { source.getReadWriteLock().writeLock().unlock(); } }
/** @inheritDoc */ @Override public void removeColumn(TableColumn column) { swingThreadSource.getReadWriteLock().writeLock().lock(); try { swingThreadSource.remove(column); } finally { swingThreadSource.getReadWriteLock().writeLock().unlock(); } }
@Override public void widgetDefaultSelected(SelectionEvent e) { if(e.detail == SWT.CHECK) { getReadWriteLock().writeLock().lock(); try { updateItemChecked((TableItem)e.item); } finally { getReadWriteLock().writeLock().unlock(); } } }
/** Helper method to create a SwingThreadProxyList with read locks. */ private static <E> EventList<E> createSwingThreadProxyList(EventList<E> source) { final EventList<E> result; source.getReadWriteLock().readLock().lock(); try { result = GlazedListsSwing.swingThreadProxyList(source); } finally { source.getReadWriteLock().readLock().unlock(); } return result; }
/** {@inheritDoc} */ @Override public int size() { getReadWriteLock().readLock().lock(); try { return source.size(); } finally { getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ @Override public boolean isEmpty() { getReadWriteLock().readLock().lock(); try { return source.isEmpty(); } finally { getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ @Override public boolean addAll(int index, Collection<? extends E> values) { getReadWriteLock().writeLock().lock(); try { return source.addAll(index, values); } finally { getReadWriteLock().writeLock().unlock(); } }
/** {@inheritDoc} */ @Override public boolean removeAll(Collection<?> values) { getReadWriteLock().writeLock().lock(); try { return source.removeAll(values); } finally { getReadWriteLock().writeLock().unlock(); } }
/** * Gets the size of the list. */ @Override public int getSize() { source.getReadWriteLock().readLock().lock(); try { return source.size(); } finally { source.getReadWriteLock().readLock().unlock(); } }
/** * {@inheritDoc} */ public EventList<E> getTogglingSelected() { source.getReadWriteLock().readLock().lock(); try { return listSelection.getTogglingSelected(); } finally { source.getReadWriteLock().readLock().unlock(); } }
/** * {@inheritDoc} */ public EventList<E> getTogglingDeselected() { source.getReadWriteLock().readLock().lock(); try { return listSelection.getTogglingDeselected(); } finally { source.getReadWriteLock().readLock().unlock(); } }
/** * Provides access to an {@link EventList} that contains items from the * viewed Table that are not currently selected. */ public EventList<E> getDeselected() { source.getReadWriteLock().readLock().lock(); try { return selection.getSelectionList().getDeselected(); } finally { source.getReadWriteLock().readLock().unlock(); } }
* Provides access to an {@link EventList} that contains items from the * viewed {@link Table} that are not currently selected. */ public EventList<E> getDeselected() { source.getReadWriteLock().readLock().lock(); try { return selection.getSelectionList().getDeselected(); } finally { source.getReadWriteLock().readLock().unlock(); } } /**