@Test public void testOk() { Handler okHandler = mock(Handler.class); Handler cancelHandler = mock(Handler.class); OkCancelDialog dialog = OkCancelDialog.builder("") .okHandler(okHandler) .cancelHandler(cancelHandler) .build(); dialog.open(); assertThat(UI.getCurrent().getWindows(), hasSize(1)); DialogTestUtil.clickOkButton(dialog); verify(okHandler).apply(); verify(cancelHandler, never()).apply(); assertThat(UI.getCurrent().getWindows(), hasSize(0)); }
protected void ok() { okHandler.apply(); }
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } }
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected  OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler,
            ButtonOption buttonOption, Component... contentComponents); @Deprecated  OkCancelDialog(String caption); @Deprecated  OkCancelDialog(String caption, Handler okHandler); @Deprecated  OkCancelDialog(String caption, Handler okHandler, ButtonOption buttonOption); @Deprecated  OkCancelDialog(String caption, Component content, Handler okHandler, ButtonOption buttonOption); }
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected  OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler,
            ButtonOption buttonOption, Component... contentComponents); @Deprecated  OkCancelDialog(String caption); @Deprecated  OkCancelDialog(String caption, Handler okHandler); @Deprecated  OkCancelDialog(String caption, Handler okHandler, ButtonOption buttonOption); @Deprecated  OkCancelDialog(String caption, Component content, Handler okHandler, ButtonOption buttonOption); @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override void setContent(@CheckForNull Component content); void setSize(String width, String height); MessageList validate(); ValidationService getValidationService(); void setValidationService(ValidationService validationService); void setBeforeOkHandler(Handler beforeOkHandler); OkCancelDialog open(); void addContent(Component c); void addContent(Component c, float expandRatio); boolean isOkPressed(); ValidationDisplayState getValidationDisplayState(); boolean isCancelPressed(); String getOkCaption(); void setOkCaption(String okCaption); String getCancelCaption(); void setCancelCaption(String cancelCaption); static Builder builder(String caption); }
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected  OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler,
            ButtonOption buttonOption, Component... contentComponents); @Deprecated  OkCancelDialog(String caption); @Deprecated  OkCancelDialog(String caption, Handler okHandler); @Deprecated  OkCancelDialog(String caption, Handler okHandler, ButtonOption buttonOption); @Deprecated  OkCancelDialog(String caption, Component content, Handler okHandler, ButtonOption buttonOption); @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override void setContent(@CheckForNull Component content); void setSize(String width, String height); MessageList validate(); ValidationService getValidationService(); void setValidationService(ValidationService validationService); void setBeforeOkHandler(Handler beforeOkHandler); OkCancelDialog open(); void addContent(Component c); void addContent(Component c, float expandRatio); boolean isOkPressed(); ValidationDisplayState getValidationDisplayState(); boolean isCancelPressed(); String getOkCaption(); void setOkCaption(String okCaption); String getCancelCaption(); void setCancelCaption(String cancelCaption); static Builder builder(String caption);  }