Hi Yves,
I think I missed something this morning. You probably have events
handled by StartView and have something like that:
public interface DefaultEventBus ... {
@Event(handler=StartPresenter1.class)
void oneEvent();
}
@Events( startView = StartView2.class, ginModules = GinModule2.class,
module = Mvp4gModule2.class )
public interface EventBus2 extends DefaultEventBus ... {
//no code needed here
}
In this case, Mvp4g will create StartPresenter1 because it handles an
event and StartPresenter2 because its views is the start view.
To solve this issue, you have to override any event handled by
StartPresenter1:
@Events( startView = StartView2.class, ginModules = GinModule2.class,
module = Mvp4gModule2.class )
public interface EventBus2 extends DefaultEventBus ... {
//override any event handled by StartPresenter1
@Event(handler=StartPresenter2.class)
void oneEvent();
}
I have to admit this is not very convenient.
I haven't tried it but to have multiple views for the same presenter,
there might be another way that is a little bit different but may make
more sense for Mvp4g.
The idea is to configure Mvp4g to inject view interfaces (instead of
view implementation) and then use GIN to set this implementation.
Compared to the previous solution, the main difference would be:
//use Mvp4g configuration but inject the view interface
@Presenter(View = IOneView.class)
public class OnePresenter extends
BasePresenter<OnePresenter.IOneView, ...>{
public interface IOneView {...}
//No need for GIN injection
}
//Create GIN module to set the implementation like before:
public class GinModule1 extends AbstractGinModule {
@Override
protected void configure() {
bind( IOneView.class ).to( IOneViewImpl1.class );
}
...
}
public class GinModule2 extends AbstractGinModule {
@Override
protected void configure() {
bind( IOneView.class ).to( IOneViewImpl2.class );
}
...
}
//You will still have to define 2 event bus but you can set the same
view interface for both event bus.
@Events( startView = IStartView.class, ginModules = GinModule1.class,
module = Mvp4gModule1.class )
public interface EventBus1 extends DefaultEventBus ... {
//no code needed here
}
@Events( startView = IStartView.class, ginModules = GinModule2.class,
module = Mvp4gModule2.class )
public interface EventBus2 extends DefaultEventBus ... {
//no code needed here
}
This way should solve the start view issue and you should have access
to all Mvp4g features (including ReverseView).
Pierre
> > > - Show quoted text -- Hide quoted text -