SouthDockItem extends AbstractDockItem { void createButton() { itemButton.setSize(ButtonSize.SMALL); itemButton.setType(ButtonType.LINK); configureText(itemButton, getDock().getLabel()); configureIcon(itemButton, getDock().getImageIcon()); itemButton.getElement().addClassName(CSS.CSS().southDockItem()); itemButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (!opened) { open(); openCommand.execute(getIdentifier()); } else { close(); closeCommand.execute(getIdentifier()); } } }); } SouthDockItem(final UberfireDock dock,
                  final ParameterizedCommand<String> openCommand,
                  final ParameterizedCommand<String> closeCommand); @Override void openAndExecuteExpandCommand(); @Override void open(); @Override void close();  }
@Test public void createSouthDockItemWithFontIconTest() { southDockWithFontIcon.createButton(); InOrder ordenatedVerification = inOrder(southDockWithFontIcon); ordenatedVerification.verify(southDockWithFontIcon).configureText(any(Button.class), anyString()); ordenatedVerification.verify(southDockWithFontIcon).configureIcon(any(Button.class), eq((ImageResource) null)); ordenatedVerification.verify(southDockWithFontIcon, never()).configureImageIcon(any(Button.class), any(ImageResource.class)); }
@Test public void createSouthDockItemWithImageIconTest() { southDockWithImageIcon.createButton(); verify(southDockWithImageIcon).configureIcon(any(Button.class), eq(imageResource)); verify(southDockWithImageIcon).configureImageIcon(any(Button.class), eq(imageResource)); }