@Test public void testAddContentChangeHandler() { doAnswer( new Answer() { @Override public Object answer( InvocationOnMock invocation ) throws Throwable { final ContentChangeHandler handler = (ContentChangeHandler) invocation.getArguments()[ 0 ]; if ( handler != null ) { handler.onContentChange(); } return null; } } ).when( view ).addContentChangeHandler( any( ContentChangeHandler.class ) ); presenter.addContentChangeHandler( mock( ContentChangeHandler.class ) ); final ArgumentCaptor<WizardPageStatusChangeEvent> eventCaptor = ArgumentCaptor.forClass( WizardPageStatusChangeEvent.class ); verify( wizardPageStatusChangeEvent ).fire( eventCaptor.capture() ); assertEquals( presenter, eventCaptor.getValue().getPage() ); }
public void addContentChangeHandler(final ContentChangeHandler contentChangeHandler) { checkNotNull("contentChangeHandler", contentChangeHandler); view.addContentChangeHandler(new ContentChangeHandler() { @Override public void onContentChange() { contentChangeHandler.onContentChange(); wizardPageStatusChangeEvent.fire(new WizardPageStatusChangeEvent(NewTemplatePresenter.this)); } }); }
NewTemplatePresenter implements WizardPage { public void addContentChangeHandler(final ContentChangeHandler contentChangeHandler) { checkNotNull("contentChangeHandler", contentChangeHandler); view.addContentChangeHandler(new ContentChangeHandler() { @Override public void onContentChange() { contentChangeHandler.onContentChange(); wizardPageStatusChangeEvent.fire(new WizardPageStatusChangeEvent(NewTemplatePresenter.this)); } }); } }
NewTemplatePresenter implements WizardPage { public void addContentChangeHandler(final ContentChangeHandler contentChangeHandler) { checkNotNull("contentChangeHandler", contentChangeHandler); view.addContentChangeHandler(new ContentChangeHandler() { @Override public void onContentChange() { contentChangeHandler.onContentChange(); wizardPageStatusChangeEvent.fire(new WizardPageStatusChangeEvent(NewTemplatePresenter.this)); } }); } @Inject  NewTemplatePresenter(final View view,
                                final Caller<SpecManagementService> specManagementService,
                                final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent); }
NewTemplatePresenter implements WizardPage { public void addContentChangeHandler(final ContentChangeHandler contentChangeHandler) { checkNotNull("contentChangeHandler", contentChangeHandler); view.addContentChangeHandler(new ContentChangeHandler() { @Override public void onContentChange() { contentChangeHandler.onContentChange(); wizardPageStatusChangeEvent.fire(new WizardPageStatusChangeEvent(NewTemplatePresenter.this)); } }); } @Inject  NewTemplatePresenter(final View view,
                                final Caller<SpecManagementService> specManagementService,
                                final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent); boolean hasProcessCapability(); String getTemplateName(); @PostConstruct void init(); @Override String getTitle(); @Override void isComplete(final Callback<Boolean> callback); void addContentChangeHandler(final ContentChangeHandler contentChangeHandler); @Override void initialise(); @Override void prepareView(); @Override Widget asWidget(); boolean isValid(); boolean isTemplateNameValid(); boolean isCapabilityValid(); void clear(); boolean isRuleCapabilityChecked(); boolean isProcessCapabilityChecked(); boolean isPlanningCapabilityChecked(); View getView(); }
NewTemplatePresenter implements WizardPage { public void addContentChangeHandler(final ContentChangeHandler contentChangeHandler) { checkNotNull("contentChangeHandler", contentChangeHandler); view.addContentChangeHandler(new ContentChangeHandler() { @Override public void onContentChange() { contentChangeHandler.onContentChange(); wizardPageStatusChangeEvent.fire(new WizardPageStatusChangeEvent(NewTemplatePresenter.this)); } }); } @Inject  NewTemplatePresenter(final View view,
                                final Caller<SpecManagementService> specManagementService,
                                final Event<WizardPageStatusChangeEvent> wizardPageStatusChangeEvent); boolean hasProcessCapability(); String getTemplateName(); @PostConstruct void init(); @Override String getTitle(); @Override void isComplete(final Callback<Boolean> callback); void addContentChangeHandler(final ContentChangeHandler contentChangeHandler); @Override void initialise(); @Override void prepareView(); @Override Widget asWidget(); boolean isValid(); boolean isTemplateNameValid(); boolean isCapabilityValid(); void clear(); boolean isRuleCapabilityChecked(); boolean isProcessCapabilityChecked(); boolean isPlanningCapabilityChecked(); View getView();  }