@Test public void testSetItemsUnknownImplementation() { view.setItems(singletonList(mock(HasListSelectorControl.ListSelectorItem.class))); verify(itemsContainer, never()).appendChild(any()); }
@Override public void setItems(final List<ListSelectorItem> items) { DOMUtil.removeAllChildren(itemsContainer); items.forEach(item -> makeListSelectorItemView(item).ifPresent(child -> itemsContainer.appendChild(child.getElement()))); }
ListSelectorViewImpl implements ListSelectorView { @Override public void setItems(final List<ListSelectorItem> items) { DOMUtil.removeAllChildren(itemsContainer); items.forEach(item -> makeListSelectorItemView(item).ifPresent(child -> itemsContainer.appendChild(child.getElement()))); } }
ListSelectorViewImpl implements ListSelectorView { @Override public void setItems(final List<ListSelectorItem> items) { DOMUtil.removeAllChildren(itemsContainer); items.forEach(item -> makeListSelectorItemView(item).ifPresent(child -> itemsContainer.appendChild(child.getElement()))); } ListSelectorViewImpl(); @Inject  ListSelectorViewImpl(final UnorderedList itemsContainer,
                                final ManagedInstance<ListSelectorTextItemView> listSelectorTextItemViews,
                                final ManagedInstance<ListSelectorDividerItemView> listSelectorDividerItemViews,
                                final ManagedInstance<ListSelectorHeaderItemView> listSelectorHeaderItemViews); }
ListSelectorViewImpl implements ListSelectorView { @Override public void setItems(final List<ListSelectorItem> items) { DOMUtil.removeAllChildren(itemsContainer); items.forEach(item -> makeListSelectorItemView(item).ifPresent(child -> itemsContainer.appendChild(child.getElement()))); } ListSelectorViewImpl(); @Inject  ListSelectorViewImpl(final UnorderedList itemsContainer,
                                final ManagedInstance<ListSelectorTextItemView> listSelectorTextItemViews,
                                final ManagedInstance<ListSelectorDividerItemView> listSelectorDividerItemViews,
                                final ManagedInstance<ListSelectorHeaderItemView> listSelectorHeaderItemViews); @Override void init(final Presenter presenter); @Override void setItems(final List<ListSelectorItem> items); @Override void show(final Optional<String> title); @Override void hide(); @Override void setOnClosedByKeyboardCallback(final Consumer<CanBeClosedByKeyboard> callback); }
ListSelectorViewImpl implements ListSelectorView { @Override public void setItems(final List<ListSelectorItem> items) { DOMUtil.removeAllChildren(itemsContainer); items.forEach(item -> makeListSelectorItemView(item).ifPresent(child -> itemsContainer.appendChild(child.getElement()))); } ListSelectorViewImpl(); @Inject  ListSelectorViewImpl(final UnorderedList itemsContainer,
                                final ManagedInstance<ListSelectorTextItemView> listSelectorTextItemViews,
                                final ManagedInstance<ListSelectorDividerItemView> listSelectorDividerItemViews,
                                final ManagedInstance<ListSelectorHeaderItemView> listSelectorHeaderItemViews); @Override void init(final Presenter presenter); @Override void setItems(final List<ListSelectorItem> items); @Override void show(final Optional<String> title); @Override void hide(); @Override void setOnClosedByKeyboardCallback(final Consumer<CanBeClosedByKeyboard> callback);  }