@Ignore("Fix me") @Test public void testDeletionIssues_FixMe() { EventList<String> source = new BasicEventList<>(); TreeList<String> treeList = new TreeList<String>(source, COMPRESSED_CHARACTER_TREE_FORMAT, TreeList.NODES_START_EXPANDED); ListConsistencyListener<String> listConsistencyListener = ListConsistencyListener .install(treeList); listConsistencyListener.setPreviousElementTracked(false); source.add("A"); source.add("AB"); assertTreeStructure(treeList, new String[] {"A", "AB",}); source.add(0, "A"); assertTreeStructure(treeList, new String[] {"A", "A", "AB",}); source.remove(1); assertTreeStructure(treeList, new String[] {"A", "AB",}); source.set(1, "AB"); assertTreeStructure(treeList, new String[] {"A", "AB",}); }
@Override public E remove(int visibleIndex) { final E result = get(visibleIndex); super.remove(visibleIndex); return result; }
TreeList extends TransformedList<TreeList.Node<E>,E> { @Override public E remove(int visibleIndex) { final E result = get(visibleIndex); super.remove(visibleIndex); return result; } }
TreeList extends TransformedList<TreeList.Node<E>,E> { @Override public E remove(int visibleIndex) { final E result = get(visibleIndex); super.remove(visibleIndex); return result; } TreeList(EventList<E> source, Format<E> format, ExpansionModel<E> expansionModel); private  TreeList(InitializationData<E> initializationData); @Deprecated  TreeList(EventList<E> source, Format<E> format); }
TreeList extends TransformedList<TreeList.Node<E>,E> { @Override public E remove(int visibleIndex) { final E result = get(visibleIndex); super.remove(visibleIndex); return result; } TreeList(EventList<E> source, Format<E> format, ExpansionModel<E> expansionModel); private  TreeList(InitializationData<E> initializationData); @Deprecated  TreeList(EventList<E> source, Format<E> format); @SuppressWarnings("unchecked") static final ExpansionModel<E> nodesStartExpanded(); @SuppressWarnings("unchecked") static final ExpansionModel<E> nodesStartCollapsed(); EventList<Node<E>> getNodesList(); int depth(int visibleIndex); int subtreeSize(int visibleIndex, boolean includeCollapsed); @Override int size(); @Override E get(int visibleIndex); @Override E remove(int visibleIndex); Node<E> getTreeNode(int visibleIndex); boolean hasChildren(int visibleIndex); void setTreeFormat(Format<E> treeFormat); List<Node<E>> getRoots(); boolean getAllowsChildren(int visibleIndex); boolean isExpanded(int visibleIndex); void setExpanded(int visibleIndex, boolean expanded); void toggleExpanded(int visibleIndex); @Override void listChanged(ListEvent<Node<E>> listChanges); @Override void dispose(); }
TreeList extends TransformedList<TreeList.Node<E>,E> { @Override public E remove(int visibleIndex) { final E result = get(visibleIndex); super.remove(visibleIndex); return result; } TreeList(EventList<E> source, Format<E> format, ExpansionModel<E> expansionModel); private  TreeList(InitializationData<E> initializationData); @Deprecated  TreeList(EventList<E> source, Format<E> format); @SuppressWarnings("unchecked") static final ExpansionModel<E> nodesStartExpanded(); @SuppressWarnings("unchecked") static final ExpansionModel<E> nodesStartCollapsed(); EventList<Node<E>> getNodesList(); int depth(int visibleIndex); int subtreeSize(int visibleIndex, boolean includeCollapsed); @Override int size(); @Override E get(int visibleIndex); @Override E remove(int visibleIndex); Node<E> getTreeNode(int visibleIndex); boolean hasChildren(int visibleIndex); void setTreeFormat(Format<E> treeFormat); List<Node<E>> getRoots(); boolean getAllowsChildren(int visibleIndex); boolean isExpanded(int visibleIndex); void setExpanded(int visibleIndex, boolean expanded); void toggleExpanded(int visibleIndex); @Override void listChanged(ListEvent<Node<E>> listChanges); @Override void dispose(); static final ExpansionModel NODES_START_EXPANDED; static final ExpansionModel NODES_START_COLLAPSED; }