-
Notifications
You must be signed in to change notification settings - Fork 2
01. Integration
To integrate Mvp4g into your project, the following steps need to be done:
- for GWT 2.x:
- Add needed library to your project or add a Maven dependency
- Modify your GWT configuration file (*.gwt.xml)
- Set your entry point
- Create your event bus, presenters, views...
- for GWT 3.0:
Once GWT 3 / J2Cl is available, we will update this section.
Mvp4g2 has dependencies to the following projects:
- JavaPoet (Download here)
- elemental2-dom (Download here)
Add the maven dependency:
<dependency>
<groupId>com.github.mvp4g</groupId>
<artifactId>mvp4g2</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.github.mvp4g</groupId>
<artifactId>mvp4g2-processor</artifactId>
<version>1.0.0</version>
</dependency>
Mvp4g2 is available on Maven central.
Mvp4g2 requires Java 8 and GWT 2.8.x. We recommand to always use the latest GWT 2 version.
Insert Mvp4g module into your project:
<inherits name='com.github.mvp4g.mvp4g2.Mvp4g2'/>
<entrypoint class='[path to your entrypoint]'/>
To implement Mvp4g2 in your application, first create an application interface:
@Application(eventBus = MyEventBus.class,
loader = MyApplicationLoader.class)
interface MyApplication
extends IsApplication {
}
The application interface must extends IsApplication
and needs the @Application
annotation.
The eventbus attribute of the @Application annotation is required, where as the loader-attribute is optional. (more informations about Mvp4g2 application loader).
Create the application EntryPoint:
public class MyApplicationEntryPoint
implements EntryPoint {
public void onModuleLoad() {
MyApplication application = new MyApplicationImpl();
application.run();
}
}
The MyApplicationImpl-class will be generated by the annotation processor and is available once a build is done.
Now that you have configured your project to use Mvp4g2, you can look at the rest of the documentation to create the different elements you need.
All code inside the com.github.mvp4g.mvp4g2.core.internal.*
packages is considered private API and should not be relied upon at all. It can change at any time and with no announcement.