@Test public void testDispose() { EventList<String> baseList = GlazedLists.eventListOf("A", "B", "C", "C", "B", "A"); FilterList<String> filterList = new FilterList<>(baseList); GlazedListsTests.ListEventCounter<String> counter = new GlazedListsTests.ListEventCounter<>(); filterList.addListEventListener(counter); TextMatcherEditor<String> editor = new TextMatcherEditor<>(GlazedLists.toStringTextFilterator()); filterList.setMatcherEditor(editor); assertEquals(0, counter.getCountAndReset()); editor.setFilterText(new String[] {"B"}); assertEquals(1, counter.getCountAndReset()); filterList.dispose(); assertEquals(0, counter.getCountAndReset()); editor.setFilterText(new String[] {"C"}); assertEquals(0, counter.getCountAndReset()); }
@Override public void dispose() { super.dispose(); if (currentEditor != null) { currentEditor.removeMatcherEditorListener(listener); } disposed = true; currentEditor = null; currentMatcher = null; }
FilterList extends TransformedList<E,E> { @Override public void dispose() { super.dispose(); if (currentEditor != null) { currentEditor.removeMatcherEditorListener(listener); } disposed = true; currentEditor = null; currentMatcher = null; } }
FilterList extends TransformedList<E,E> { @Override public void dispose() { super.dispose(); if (currentEditor != null) { currentEditor.removeMatcherEditorListener(listener); } disposed = true; currentEditor = null; currentMatcher = null; } FilterList(EventList<E> source);  FilterList(EventList<E> source, Matcher<? super E> matcher);  FilterList(EventList<E> source, MatcherEditor<? super E> matcherEditor); }
FilterList extends TransformedList<E,E> { @Override public void dispose() { super.dispose(); if (currentEditor != null) { currentEditor.removeMatcherEditorListener(listener); } disposed = true; currentEditor = null; currentMatcher = null; } FilterList(EventList<E> source);  FilterList(EventList<E> source, Matcher<? super E> matcher);  FilterList(EventList<E> source, MatcherEditor<? super E> matcherEditor); void setMatcher(Matcher<? super E> matcher); void setMatcherEditor(MatcherEditor<? super E> editor); @Override void dispose(); @Override final void listChanged(ListEvent<E> listChanges); @Override final int size(); }
FilterList extends TransformedList<E,E> { @Override public void dispose() { super.dispose(); if (currentEditor != null) { currentEditor.removeMatcherEditorListener(listener); } disposed = true; currentEditor = null; currentMatcher = null; } FilterList(EventList<E> source);  FilterList(EventList<E> source, Matcher<? super E> matcher);  FilterList(EventList<E> source, MatcherEditor<? super E> matcherEditor); void setMatcher(Matcher<? super E> matcher); void setMatcherEditor(MatcherEditor<? super E> editor); @Override void dispose(); @Override final void listChanged(ListEvent<E> listChanges); @Override final int size();  }