@Test public void testSettingSelectionByArray() { int[] testArray1 = {0, 1, 5, 6, 8, 9, 14, 15, 18, 19}; int[] testArray2 = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; int[] testArray3 = {0, 1, 2, 3, 4, 15, 16, 17, 18, 19}; for(int i = 0; i < 20; i++) { source.add(new Integer(i)); } listSelection.setSelection(testArray1); assertEquals(10, selectedList.size()); assertEquals(10, deselectedList.size()); listSelection.setSelection(testArray2); assertEquals(10, selectedList.size()); assertEquals(10, deselectedList.size()); listSelection.setSelection(testArray3); assertEquals(10, selectedList.size()); assertEquals(10, deselectedList.size()); }
public void setSelection(int index) { setSelection(index, index); }
ListSelection implements ListEventListener<E> { public void setSelection(int index) { setSelection(index, index); } }
ListSelection implements ListEventListener<E> { public void setSelection(int index) { setSelection(index, index); } ListSelection(EventList<E> source);  ListSelection(EventList<E> source, int[] initialSelection); }
ListSelection implements ListEventListener<E> { public void setSelection(int index) { setSelection(index, index); } ListSelection(EventList<E> source);  ListSelection(EventList<E> source, int[] initialSelection); @Override void listChanged(ListEvent<E> listChanges); void addValidSelectionMatcher(Matcher<E> validSelectionMatcher); void removeValidSelectionMatcher(Matcher<E> validSelectionMatcher); EventList<E> getSelected(); EventList<E> getTogglingSelected(); EventList<E> getDeselected(); EventList<E> getTogglingDeselected(); EventList<E> getSource(); void invertSelection(); boolean isSelected(int sourceIndex); void deselect(int index); void deselect(int start, int end); void deselect(int[] indices); void deselectAll(); void select(int index); void select(int start, int end); void select(int[] indices); int select(E value); boolean select(Collection<E> values); void selectAll(); void setSelection(int index); void setSelection(int start, int end); void setSelection(int[] indices); int getAnchorSelectionIndex(); void setAnchorSelectionIndex(int anchorSelectionIndex); int getLeadSelectionIndex(); void setLeadSelectionIndex(int leadSelectionIndex); void setSelectionMode(int selectionMode); int getSelectionMode(); int getMinSelectionIndex(); int getMaxSelectionIndex(); void addSelectionListener(Listener selectionListener); void removeSelectionListener(Listener selectionListener); void dispose(); }
ListSelection implements ListEventListener<E> { public void setSelection(int index) { setSelection(index, index); } ListSelection(EventList<E> source);  ListSelection(EventList<E> source, int[] initialSelection); @Override void listChanged(ListEvent<E> listChanges); void addValidSelectionMatcher(Matcher<E> validSelectionMatcher); void removeValidSelectionMatcher(Matcher<E> validSelectionMatcher); EventList<E> getSelected(); EventList<E> getTogglingSelected(); EventList<E> getDeselected(); EventList<E> getTogglingDeselected(); EventList<E> getSource(); void invertSelection(); boolean isSelected(int sourceIndex); void deselect(int index); void deselect(int start, int end); void deselect(int[] indices); void deselectAll(); void select(int index); void select(int start, int end); void select(int[] indices); int select(E value); boolean select(Collection<E> values); void selectAll(); void setSelection(int index); void setSelection(int start, int end); void setSelection(int[] indices); int getAnchorSelectionIndex(); void setAnchorSelectionIndex(int anchorSelectionIndex); int getLeadSelectionIndex(); void setLeadSelectionIndex(int leadSelectionIndex); void setSelectionMode(int selectionMode); int getSelectionMode(); int getMinSelectionIndex(); int getMaxSelectionIndex(); void addSelectionListener(Listener selectionListener); void removeSelectionListener(Listener selectionListener); void dispose(); static final int SINGLE_SELECTION; static final int SINGLE_INTERVAL_SELECTION; static final int MULTIPLE_INTERVAL_SELECTION; static final int MULTIPLE_INTERVAL_SELECTION_DEFENSIVE; }