@Test public void testAdd() { ZoomLevelSelectorItem item = mock(ZoomLevelSelectorItem.class); HTMLElement itemElement = mock(HTMLElement.class); when(item.getElement()).thenReturn(itemElement); when(items.get()).thenReturn(item); Command c = mock(Command.class); tested.add("item1", c); verify(item, times(1)).setText(eq("item1")); verify(item, times(1)).setOnClick(eq(c)); verify(dropDownMenu, times(1)).appendChild(eq(itemElement)); }
@Override public void add(final String text, final Command onClick) { final ZoomLevelSelectorItem item = items.get(); item.setText(text); item.setOnClick(onClick); dropDownMenu.appendChild(item.getElement()); }
ZoomLevelSelectorView extends Composite implements ZoomLevelSelector.View { @Override public void add(final String text, final Command onClick) { final ZoomLevelSelectorItem item = items.get(); item.setText(text); item.setOnClick(onClick); dropDownMenu.appendChild(item.getElement()); } }
ZoomLevelSelectorView extends Composite implements ZoomLevelSelector.View { @Override public void add(final String text, final Command onClick) { final ZoomLevelSelectorItem item = items.get(); item.setText(text); item.setOnClick(onClick); dropDownMenu.appendChild(item.getElement()); }  }
ZoomLevelSelectorView extends Composite implements ZoomLevelSelector.View { @Override public void add(final String text, final Command onClick) { final ZoomLevelSelectorItem item = items.get(); item.setText(text); item.setOnClick(onClick); dropDownMenu.appendChild(item.getElement()); }  @Override void init(final ZoomLevelSelector presenter); @Override void add(final String text,
                    final Command onClick); @Override void clear(); void setSelectedValue(String selectedItem); @Override void setText(String text); @Override void setEnabled(boolean enabled); @Override void dropUp(); @PreDestroy void destroy(); }
ZoomLevelSelectorView extends Composite implements ZoomLevelSelector.View { @Override public void add(final String text, final Command onClick) { final ZoomLevelSelectorItem item = items.get(); item.setText(text); item.setOnClick(onClick); dropDownMenu.appendChild(item.getElement()); }  @Override void init(final ZoomLevelSelector presenter); @Override void add(final String text,
                    final Command onClick); @Override void clear(); void setSelectedValue(String selectedItem); @Override void setText(String text); @Override void setEnabled(boolean enabled); @Override void dropUp(); @PreDestroy void destroy();  }