@Test public void taskButtonMinimizesWindowWhenActiveOnSelect() { when(mockWindow.isVisible()).thenReturn(true); when(mockWindowManager.getActive()).thenReturn(mockWindow); uut.onClick(mock(Cell.Context.class), mock(XElement.class), false, mock(NativeEvent.class), mockValueUpdater); verify(mockWindow).isVisible(); verify(mockWindow).minimize(); verifyNoMoreInteractions(mockWindow); }
@Override protected void onClick(Context context, XElement p, Boolean value, NativeEvent event, ValueUpdater<Boolean> valueUpdater) { boolean valuePassed = value; if(!window.isVisible()) { window.show(); } else if (window == windowManager.getActive()){ window.minimize(); } else { window.toFront(); valuePassed = true; } callSuperOnClick(context, p, event, valueUpdater, valuePassed); }
TaskButtonCell extends ToggleButtonCell { @Override protected void onClick(Context context, XElement p, Boolean value, NativeEvent event, ValueUpdater<Boolean> valueUpdater) { boolean valuePassed = value; if(!window.isVisible()) { window.show(); } else if (window == windowManager.getActive()){ window.minimize(); } else { window.toFront(); valuePassed = true; } callSuperOnClick(context, p, event, valueUpdater, valuePassed); } }
TaskButtonCell extends ToggleButtonCell { @Override protected void onClick(Context context, XElement p, Boolean value, NativeEvent event, ValueUpdater<Boolean> valueUpdater) { boolean valuePassed = value; if(!window.isVisible()) { window.show(); } else if (window == windowManager.getActive()){ window.minimize(); } else { window.toFront(); valuePassed = true; } callSuperOnClick(context, p, event, valueUpdater, valuePassed); } TaskButtonCell(final Window window);   TaskButtonCell(TaskButtonCellAppearance<Boolean> appearance,
                   final Window window,
                   final WindowManager windowManager); }
TaskButtonCell extends ToggleButtonCell { @Override protected void onClick(Context context, XElement p, Boolean value, NativeEvent event, ValueUpdater<Boolean> valueUpdater) { boolean valuePassed = value; if(!window.isVisible()) { window.show(); } else if (window == windowManager.getActive()){ window.minimize(); } else { window.toFront(); valuePassed = true; } callSuperOnClick(context, p, event, valueUpdater, valuePassed); } TaskButtonCell(final Window window);   TaskButtonCell(TaskButtonCellAppearance<Boolean> appearance,
                   final Window window,
                   final WindowManager windowManager); @Override TaskButtonCellAppearance<Boolean> getAppearance(); @Override void setText(String text); }
TaskButtonCell extends ToggleButtonCell { @Override protected void onClick(Context context, XElement p, Boolean value, NativeEvent event, ValueUpdater<Boolean> valueUpdater) { boolean valuePassed = value; if(!window.isVisible()) { window.show(); } else if (window == windowManager.getActive()){ window.minimize(); } else { window.toFront(); valuePassed = true; } callSuperOnClick(context, p, event, valueUpdater, valuePassed); } TaskButtonCell(final Window window);   TaskButtonCell(TaskButtonCellAppearance<Boolean> appearance,
                   final Window window,
                   final WindowManager windowManager); @Override TaskButtonCellAppearance<Boolean> getAppearance(); @Override void setText(String text);  }