@Test public void testShow() { final BiConsumer<String, ConstraintType> expectedOnSave = (s, c) -> { }; final ArgumentCaptor<Command> onHide = ArgumentCaptor.forClass(Command.class); doNothing().when(modal).superShow(); modal.show(expectedOnSave); final BiConsumer<String, ConstraintType> actualOnSave = modal.getOnSave(); assertEquals(expectedOnSave, actualOnSave); verify(modal).superShow(); verify(dataTypeShortcuts).disable(); verify(view).onShow(); verify(view).setupOnHideHandler(onHide.capture()); onHide.getValue().execute(); verify(modal).onHide(); }
public void show(final BiConsumer<String, ConstraintType> onSaveConsumer) { onSave = onSaveConsumer; superShow(); getView().onShow(); getView().setupOnHideHandler(this::onHide); dataTypeShortcuts.disable(); }
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { public void show(final BiConsumer<String, ConstraintType> onSaveConsumer) { onSave = onSaveConsumer; superShow(); getView().onShow(); getView().setupOnHideHandler(this::onHide); dataTypeShortcuts.disable(); } }
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { public void show(final BiConsumer<String, ConstraintType> onSaveConsumer) { onSave = onSaveConsumer; superShow(); getView().onShow(); getView().setupOnHideHandler(this::onHide); dataTypeShortcuts.disable(); } @Inject  DataTypeConstraintModal(final View view,
                                   final DataTypeShortcuts dataTypeShortcuts,
                                   final DataTypeConstraintEnumeration constraintEnumeration,
                                   final DataTypeConstraintExpression constraintExpression,
                                   final DataTypeConstraintRange constraintRange); }
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { public void show(final BiConsumer<String, ConstraintType> onSaveConsumer) { onSave = onSaveConsumer; superShow(); getView().onShow(); getView().setupOnHideHandler(this::onHide); dataTypeShortcuts.disable(); } @Inject  DataTypeConstraintModal(final View view,
                                   final DataTypeShortcuts dataTypeShortcuts,
                                   final DataTypeConstraintEnumeration constraintEnumeration,
                                   final DataTypeConstraintExpression constraintExpression,
                                   final DataTypeConstraintRange constraintRange); @PostConstruct void setup(); void save(); void show(final BiConsumer<String, ConstraintType> onSaveConsumer); @Override void hide(); void enableOkButton(); void disableOkButton(); }
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { public void show(final BiConsumer<String, ConstraintType> onSaveConsumer) { onSave = onSaveConsumer; superShow(); getView().onShow(); getView().setupOnHideHandler(this::onHide); dataTypeShortcuts.disable(); } @Inject  DataTypeConstraintModal(final View view,
                                   final DataTypeShortcuts dataTypeShortcuts,
                                   final DataTypeConstraintEnumeration constraintEnumeration,
                                   final DataTypeConstraintExpression constraintExpression,
                                   final DataTypeConstraintRange constraintRange); @PostConstruct void setup(); void save(); void show(final BiConsumer<String, ConstraintType> onSaveConsumer); @Override void hide(); void enableOkButton(); void disableOkButton();  }