@Test public void testSetupOnHideHandler() { final HTMLElement body = mock(HTMLElement.class); final Node modalBody = mock(Node.class); final Node modalContent = mock(Node.class); final Node modalDialog = mock(Node.class); final Node modalComponent = mock(Node.class); final Command command = mock(Command.class); final JQuery jQuery = mock(JQuery.class); final ArgumentCaptor<CallbackFunction> captor = ArgumentCaptor.forClass(CallbackFunction.class); body.parentNode = modalBody; modalBody.parentNode = modalContent; modalContent.parentNode = modalDialog; modalDialog.parentNode = modalComponent; doReturn(body).when(view).getBody(); when(view.constraintModalJQuery()).thenReturn(jQuery); view.setupOnHideHandler(command); verify(jQuery).on(eq("hidden.bs.modal"), captor.capture()); captor.getValue().call(mock(JQueryEvent.class)); verify(command).execute(); }
@Override public void setupOnHideHandler(final Command handler) { constraintModalJQuery().on("hidden.bs.modal", (e) -> handler.execute()); }
DataTypeConstraintModalView implements DataTypeConstraintModal.View { @Override public void setupOnHideHandler(final Command handler) { constraintModalJQuery().on("hidden.bs.modal", (e) -> handler.execute()); } }
DataTypeConstraintModalView implements DataTypeConstraintModal.View { @Override public void setupOnHideHandler(final Command handler) { constraintModalJQuery().on("hidden.bs.modal", (e) -> handler.execute()); } @Inject  DataTypeConstraintModalView(final HTMLDivElement header,
                                       final HTMLDivElement body,
                                       final HTMLDivElement footer,
                                       final HTMLDivElement componentContainer,
                                       final HTMLButtonElement okButton,
                                       final HTMLButtonElement cancelButton,
                                       final HTMLAnchorElement clearAllAnchor,
                                       final @Named("span") HTMLElement type,
                                       final HTMLDivElement selectConstraint,
                                       final HTMLDivElement constraintWarningMessage,
                                       final HTMLButtonElement closeConstraintWarningMessage); }
DataTypeConstraintModalView implements DataTypeConstraintModal.View { @Override public void setupOnHideHandler(final Command handler) { constraintModalJQuery().on("hidden.bs.modal", (e) -> handler.execute()); } @Inject  DataTypeConstraintModalView(final HTMLDivElement header,
                                       final HTMLDivElement body,
                                       final HTMLDivElement footer,
                                       final HTMLDivElement componentContainer,
                                       final HTMLButtonElement okButton,
                                       final HTMLButtonElement cancelButton,
                                       final HTMLAnchorElement clearAllAnchor,
                                       final @Named("span") HTMLElement type,
                                       final HTMLDivElement selectConstraint,
                                       final HTMLDivElement constraintWarningMessage,
                                       final HTMLButtonElement closeConstraintWarningMessage); @PostConstruct void init(); @Override void init(final DataTypeConstraintModal presenter); @Override String getHeader(); @Override HTMLElement getBody(); @Override HTMLElement getFooter(); @EventHandler("ok-button") void onOkButtonClick(final ClickEvent e); @EventHandler("cancel-button") void onCancelButtonClick(final ClickEvent e); @EventHandler("clear-all-anchor") void onClearAllAnchorClick(final ClickEvent e); @EventHandler("close-constraint-warning-message") void onCloseConstraintWarningClick(final ClickEvent e); @Override void showConstraintWarningMessage(); @Override void setType(final String type); @Override void setupEmptyContainer(); @Override void loadComponent(final ConstraintType constraintType); @Override void onShow(); @Override void setupOnHideHandler(final Command handler); @Override void enableOkButton(); @Override void disableOkButton(); }
DataTypeConstraintModalView implements DataTypeConstraintModal.View { @Override public void setupOnHideHandler(final Command handler) { constraintModalJQuery().on("hidden.bs.modal", (e) -> handler.execute()); } @Inject  DataTypeConstraintModalView(final HTMLDivElement header,
                                       final HTMLDivElement body,
                                       final HTMLDivElement footer,
                                       final HTMLDivElement componentContainer,
                                       final HTMLButtonElement okButton,
                                       final HTMLButtonElement cancelButton,
                                       final HTMLAnchorElement clearAllAnchor,
                                       final @Named("span") HTMLElement type,
                                       final HTMLDivElement selectConstraint,
                                       final HTMLDivElement constraintWarningMessage,
                                       final HTMLButtonElement closeConstraintWarningMessage); @PostConstruct void init(); @Override void init(final DataTypeConstraintModal presenter); @Override String getHeader(); @Override HTMLElement getBody(); @Override HTMLElement getFooter(); @EventHandler("ok-button") void onOkButtonClick(final ClickEvent e); @EventHandler("cancel-button") void onCancelButtonClick(final ClickEvent e); @EventHandler("clear-all-anchor") void onClearAllAnchorClick(final ClickEvent e); @EventHandler("close-constraint-warning-message") void onCloseConstraintWarningClick(final ClickEvent e); @Override void showConstraintWarningMessage(); @Override void setType(final String type); @Override void setupEmptyContainer(); @Override void loadComponent(final ConstraintType constraintType); @Override void onShow(); @Override void setupOnHideHandler(final Command handler); @Override void enableOkButton(); @Override void disableOkButton();  }