use of com.github.mvp4g.mvp4g2.core.eventbus.annotation.Event in project mvp4g2-examples by mvp4g.
the class SearchView method createView.
public void createView() {
container = div().add(div().style("width: 100%;").add(div().css("headline").textContent("Search Parameter (search for: 'S' or 'D')")).add(searchName = new TextField("Name")).add(searchCity = new TextField("City")).add(div().css("buttonBar").add(button().css("button").textContent("Search").on(click, event -> getPresenter().doClickSearchButton(searchName.getText(), searchCity.getText()))).add(button().css("button").textContent("Reset").on(click, event -> {
searchName.setText("");
searchCity.setText("");
})).asElement())).asElement();
}
use of com.github.mvp4g.mvp4g2.core.eventbus.annotation.Event in project mvp4g2 by mvp4g.
the class EventTest method testEventTestHistoryNamesNotUnique.
@Test
public void testEventTestHistoryNamesNotUnique() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventTestHistoryNamesNotUnique/EventTestHistoryNamesNotUnique.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("using a already used historyName");
}
use of com.github.mvp4g.mvp4g2.core.eventbus.annotation.Event in project mvp4g2 by mvp4g.
the class EventTest method testEventAnnotationInsideAOtherClassThenEventBus.
@Test
public void testEventAnnotationInsideAOtherClassThenEventBus() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventAnnotationInsideAOtherClassThenEventBus/EventAnnotationInsideAOtherClassThenEventBus.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventAnnotationInsideAOtherClassThenEventBus/MockShellPresenter.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventAnnotationInsideAOtherClassThenEventBus/IMockShellView.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventAnnotationInsideAOtherClassThenEventBus/MockShellView.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("Mvp4g2Processor: @Event can only be used inside a event bus! >>com.github.mvp4g.mvp4g2.processor.event.eventAnnotationInsideAOtherClassThenEventBus.MockShellPresenter<< does no implement IsEventBus");
}
use of com.github.mvp4g.mvp4g2.core.eventbus.annotation.Event in project mvp4g2 by mvp4g.
the class EventTest method testEventTestHandlerInBindAndHandlersAttribute01.
@Test
public void testEventTestHandlerInBindAndHandlersAttribute01() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventTestHandlerInBindAndHandlersAttribute01/EventTestHandlerInBindAndHandlersAttribute.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("can not be set in bind- and handlers-attribute");
}
use of com.github.mvp4g.mvp4g2.core.eventbus.annotation.Event in project mvp4g2 by mvp4g.
the class EventTest method testEventBusWithOneNotFoundHistoryAnnotationAndNonZeroArgmentsSignature.
@Test
public void testEventBusWithOneNotFoundHistoryAnnotationAndNonZeroArgmentsSignature() {
Compilation compilation = javac().withProcessors(new Mvp4g2Processor()).compile(new ArrayList<JavaFileObject>() {
{
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventBusWithOneNotFoundHistoryAnnotationAndNonZeroArgmentsSignature/EventBusWithOneNotFoundHistoryAnnotationAndNonZeroArgmentsSignature.java"));
add(JavaFileObjects.forResource("com/github/mvp4g/mvp4g2/processor/event/eventBusWithOneNotFoundHistoryAnnotationAndNonZeroArgmentsSignature/MockShellPresenter.java"));
}
});
CompilationSubject.assertThat(compilation).failed();
CompilationSubject.assertThat(compilation).hadErrorContaining("@NotFoundHistory can only be used on a method with no arguments");
}
Aggregations