use of org.uberfire.ext.widgets.core.client.wizards.WizardPageStatusChangeEvent in project kie-wb-common by kiegroup.
the class ProjectPage method removeProject.
@Override
public void removeProject(final ExampleProject project) {
model.removeProject(project);
pageStatusChangedEvent.fire(new WizardPageStatusChangeEvent(this));
}
use of org.uberfire.ext.widgets.core.client.wizards.WizardPageStatusChangeEvent in project kie-wb-common by kiegroup.
the class ProjectPage method addProject.
@Override
public void addProject(final ExampleProject project) {
model.addProject(project);
pageStatusChangedEvent.fire(new WizardPageStatusChangeEvent(this));
}
use of org.uberfire.ext.widgets.core.client.wizards.WizardPageStatusChangeEvent in project kie-wb-common by kiegroup.
the class SourceRepositoryPage method playgroundRepositorySelected.
@Override
public void playgroundRepositorySelected() {
model.setSelectedRepository(stockRepository);
view.hideRepositoryUrlInputForm();
view.setCustomRepositoryValue(null);
pageStatusChangedEvent.fire(new WizardPageStatusChangeEvent(this));
}
use of org.uberfire.ext.widgets.core.client.wizards.WizardPageStatusChangeEvent in project kie-wb-common by kiegroup.
the class SearchAnnotationPageTest method testSearchAnnotationNotFound.
@Test
public void testSearchAnnotationNotFound() {
modelerServiceCaller = new CallerMock<DataModelerService>(modelerService);
SearchAnnotationPage searchPage = new SearchAnnotationPage(view, modelerServiceCaller, wizardPageStatusChangeEvent);
searchPage.init(kieModule, ElementType.FIELD);
searchPage.prepareView();
searchPage.addSearchAnnotationHandler(searchAnnotationHandler);
// emulates the user is typing
searchPage.onSearchClassChanged();
// the wizard page should be automatically invalidated since the annotation class name to search
// has changed.
verify(wizardPageStatusChangeEvent, times(1)).fire(any(WizardPageStatusChangeEvent.class));
WizardTestUtil.assertPageComplete(false, searchPage);
assertEquals(CreateAnnotationWizardPage.PageStatus.NOT_VALIDATED, searchPage.getStatus());
// the handler should also have been invocked.
verify(searchAnnotationHandler, times(1)).onSearchClassChanged();
// emulate the user is searching the javax.persistence.Entity annotation.
AnnotationDefinitionRequest request = new AnnotationDefinitionRequest(Entity.class.getName());
// empty response was returned
AnnotationDefinitionResponse response = new AnnotationDefinitionResponse(null);
when(view.getClassName()).thenReturn(Entity.class.getName());
when(modelerService.resolveDefinitionRequest(request, kieModule)).thenReturn(response);
// emulate the user click on the search button
searchPage.onSearchClass();
// now the page should be completed
WizardTestUtil.assertPageComplete(false, searchPage);
verify(wizardPageStatusChangeEvent, times(2)).fire(any(WizardPageStatusChangeEvent.class));
// the handler should also have been invoked with the expected annotation definition.
verify(searchAnnotationHandler, times(1)).onAnnotationDefinitionChange(null);
}
use of org.uberfire.ext.widgets.core.client.wizards.WizardPageStatusChangeEvent in project kie-wb-common by kiegroup.
the class NewContainerFormPresenter method onDependencyPathSelectedEvent.
void onDependencyPathSelectedEvent(@Observes final DependencyPathSelectedEvent event) {
if (event != null && event.getContext() != null && event.getPath() != null) {
if (event.getContext().equals(artifactListWidgetPresenter)) {
m2RepoService.call(new RemoteCallback<GAV>() {
@Override
public void callback(GAV gav) {
setAValidContainerName(gav.toString());
view.setGroupId(gav.getGroupId());
view.setArtifactId(gav.getArtifactId());
view.setVersion(gav.getVersion());
wizardPageStatusChangeEvent.fire(new WizardPageStatusChangeEvent(NewContainerFormPresenter.this));
}
}).loadGAVFromJar(event.getPath());
}
} else {
logger.warn("Illegal event argument.");
}
}
Aggregations