ConsoleButtonImpl extends Composite implements ConsoleButton, ClickHandler, MouseOverHandler, MouseOutHandler { @Override public void setCheckedStatus(boolean isChecked) { ButtonResources.Css buttonCss = resources.buttonCss(); if (isChecked) { icon.removeClassNameBaseVal(buttonCss.whiteColor()); icon.addClassNameBaseVal(buttonCss.activeConsoleButton()); } else { icon.removeClassNameBaseVal(buttonCss.activeConsoleButton()); icon.addClassNameBaseVal(buttonCss.whiteColor()); } image.getElement().appendChild(icon.getSvgElement().getElement()); } @Inject  ConsoleButtonImpl(ButtonResources resources,
                             TooltipWidget tooltip,
                             @NotNull @Assisted String prompt,
                             @NotNull @Assisted SVGResource image); @Override void setCheckedStatus(boolean isChecked); @Override void setDelegate(ActionDelegate delegate); @Override void onClick(ClickEvent clickEvent); @Override void onMouseOut(MouseOutEvent mouseOutEvent); @Override void onMouseOver(MouseOverEvent mouseOverEvent); static final int TOP_TOOLTIP_SHIFT; }
@Test public void checkStatusShouldBeChangedToCheckedStyle() throws Exception { reset(runnerCss); widget.setCheckedStatus(true); verify(runnerCss).activeConsoleButton(); verify(runnerCss).whiteColor(); }
@Test public void checkStatusShouldBeChangedToUncheckedStyle() throws Exception { reset(runnerCss); widget.setCheckedStatus(false); verify(runnerCss).activeConsoleButton(); verify(runnerCss).whiteColor(); }