@Test public void buttonIsNotDepressedWhenWindowIsMaximized() { when(cellMock.getAppearance()).thenReturn(cellAppearanceMock); when(cellAppearanceMock.getMaxTextLength()).thenReturn(50); when(headerMock.getText()).thenReturn("Mock window"); when(windowMock.getHeader()).thenReturn(headerMock); TaskButton uut = spy(new TaskButton(windowMock, cellMock)); uut.onMaximize(mock(MaximizeEvent.class)); verify(uut).setValue(eq(false), eq(false)); }
@Override public void onMaximize(MaximizeEvent event) { setValue(false, false); }
TaskButton extends ToggleButton implements MinimizeEvent.MinimizeHandler,
                                                        MaximizeEvent.MaximizeHandler,
                                                        ShowEvent.ShowHandler { @Override public void onMaximize(MaximizeEvent event) { setValue(false, false); } }
TaskButton extends ToggleButton implements MinimizeEvent.MinimizeHandler,
                                                        MaximizeEvent.MaximizeHandler,
                                                        ShowEvent.ShowHandler { @Override public void onMaximize(MaximizeEvent event) { setValue(false, false); } TaskButton(Window win);   TaskButton(Window win, TaskButtonCell cell); }
TaskButton extends ToggleButton implements MinimizeEvent.MinimizeHandler,
                                                        MaximizeEvent.MaximizeHandler,
                                                        ShowEvent.ShowHandler { @Override public void onMaximize(MaximizeEvent event) { setValue(false, false); } TaskButton(Window win);   TaskButton(Window win, TaskButtonCell cell); @Override TaskButtonCell getCell(); @Override void onMaximize(MaximizeEvent event); @Override void onMinimize(MinimizeEvent event); @Override void onShow(ShowEvent event); @Override void setText(String text); Window getWindow(); }
TaskButton extends ToggleButton implements MinimizeEvent.MinimizeHandler,
                                                        MaximizeEvent.MaximizeHandler,
                                                        ShowEvent.ShowHandler { @Override public void onMaximize(MaximizeEvent event) { setValue(false, false); } TaskButton(Window win);   TaskButton(Window win, TaskButtonCell cell); @Override TaskButtonCell getCell(); @Override void onMaximize(MaximizeEvent event); @Override void onMinimize(MinimizeEvent event); @Override void onShow(ShowEvent event); @Override void setText(String text); Window getWindow();  }