@Test public void testChangeList() { final BasicEventList<String> source = new BasicEventList<>(); final List list = new List(getShell(), SWT.MULTI); final DefaultEventListViewer<String> viewer = new DefaultEventListViewer<>(source, list); source.addAll(GlazedListsTests.delimitedStringToList("A B C D E F")); assertSame(list, viewer.getList()); assertEquals(source.size(), list.getItemCount()); assertTrue(Arrays.equals(source.toArray(new String[source.size()]), list.getItems())); source.clear(); assertEquals(0, list.getItemCount()); assertTrue(Arrays.equals(new String[0], list.getItems())); source.add("B"); source.add("D"); source.add(0, "A"); source.add(2, "C"); assertEquals(GlazedListsTests.delimitedStringToList("A B C D"), source); assertEquals(source.size(), list.getItemCount()); assertTrue(Arrays.equals(source.toArray(new String[source.size()]), list.getItems())); source.addAll(GlazedListsTests.delimitedStringToList("E F")); source.removeAll(GlazedListsTests.delimitedStringToList("A B")); assertEquals(GlazedListsTests.delimitedStringToList("C D E F"), source); assertEquals(source.size(), list.getItemCount()); assertTrue(Arrays.equals(source.toArray(new String[source.size()]), list.getItems())); source.remove(0); source.remove("E"); assertEquals(GlazedListsTests.delimitedStringToList("D F"), source); assertEquals(source.size(), list.getItemCount()); assertTrue(Arrays.equals(source.toArray(new String[source.size()]), list.getItems())); }
public List getList() { return list; }
DefaultEventListViewer implements ListEventListener<E> { public List getList() { return list; } }
DefaultEventListViewer implements ListEventListener<E> { public List getList() { return list; } DefaultEventListViewer(EventList<E> source, List list);  DefaultEventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat); protected  DefaultEventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat, boolean disposeSource); }
DefaultEventListViewer implements ListEventListener<E> { public List getList() { return list; } DefaultEventListViewer(EventList<E> source, List list);  DefaultEventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat); protected  DefaultEventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat, boolean disposeSource); ItemFormat<? super E> getItemFormat(); List getList(); EventList<E> getDeselected(); EventList<E> getTogglingDeselected(); EventList<E> getSelected(); EventList<E> getTogglingSelected(); @Override void listChanged(ListEvent<E> listChanges); void invertSelection(); void dispose(); }
DefaultEventListViewer implements ListEventListener<E> { public List getList() { return list; } DefaultEventListViewer(EventList<E> source, List list);  DefaultEventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat); protected  DefaultEventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat, boolean disposeSource); ItemFormat<? super E> getItemFormat(); List getList(); EventList<E> getDeselected(); EventList<E> getTogglingDeselected(); EventList<E> getSelected(); EventList<E> getTogglingSelected(); @Override void listChanged(ListEvent<E> listChanges); void invertSelection(); void dispose();  }