/** @deprecated As of release 6.0.0, replaced with {@link #removeFromSelection}. */ public void removeSelection(Object obj) { removeFromSelection(obj); } }
public void remove() { removeFromSelection(_current); _it.remove(); --_nextIndex; fireEvent(ListDataEvent.INTERVAL_REMOVED, _nextIndex, _nextIndex); } };
public void remove() { removeFromSelection(_current); _it.remove(); final int index = _it.nextIndex(); fireEvent(ListDataEvent.INTERVAL_REMOVED, index, index); }
public E remove(int index) { E ret = _list.get(index); removeFromSelection(ret); //Bug ZK-1428: should remove the object after removeFromSelection //since Listbox.doSelectionChanged will try to get the object again _list.remove(index); fireEvent(ListDataEvent.INTERVAL_REMOVED, index, index); return ret; }
/** * Remove from fromIndex(inclusive) to toIndex(exclusive). If fromIndex equals toIndex, * this methods do nothing. * @param fromIndex the begin index (inclusive) to be removed. * @param toIndex the end index (exclusive) to be removed. */ public void removeRange(int fromIndex, int toIndex) { if (fromIndex > toIndex) { throw new UiException( "fromIndex must less than toIndex: fromIndex: " + fromIndex + ", toIndex: " + toIndex); } if (fromIndex == toIndex) { return; } int sz = _list.size(); if (sz == fromIndex) { return; } int index = fromIndex; //B70-ZK-2447 : IndexOutOfBound exception occurs when using ListModelList.removeRange(0, size) with all items selected Set<E> removedObjs = new HashSet<E>(); for (final Iterator<E> it = _list.listIterator(fromIndex); it.hasNext() && index < toIndex; ++index) { final E obj = it.next(); removedObjs.add(obj); it.remove(); } fireEvent(ListDataEvent.INTERVAL_REMOVED, fromIndex, index - 1); for (E obj : removedObjs) removeFromSelection(obj); }