alt83 / mvp4g

Automatically exported from code.google.com/p/mvp4g
0 stars 0 forks source link

APT: not compatible with Intellij #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello ,

I'm using version 1.3.1 of mvp4g.

When running APT using mvp4g processors I got these 2 errors:
 - Invalid Event bus: cern.ais.plugin.gwt.client.test.ApplicationEventBus can't be injected to HomeApplicationPresenter. Can not convert cern.ais.plugin.gwt.client.test.ApplicationEventBus to E
and
 - Invalid Event bus: cern.ais.plugin.gwt.client.test.ApplicationEventBus can't be injected to FirefoxAjaxHackHandler. Can not convert cern.ais.plugin.gwt.client.test.ApplicationEventBus to E

I looked at the issue 41 which is similar, but I still don't understand why 
this error is thrown by APT.

When disabling APT, the GWT client is running fine.

Thanks for your help to let me understand what the problem is.

My EventBus:

@Events( startView = HomeApplicationView.class )
public interface ApplicationEventBus extends EventBus {

    //front home page
    @Start
    @Event( handlers = {FirefoxAjaxHackHandler.class, HomeApplicationPresenter.class} )
    public void start();
}

The FirefoxAjaxHackHandler:

@EventHandler
public class FirefoxAjaxHackHandler extends BaseEventHandler<EventBus> {
    public void onStart() {
        ...
    }
}

The HomeApplicationPresenter:
@Presenter( view = HomeApplicationView.class )
public class HomeApplicationPresenter extends 
LazyPresenter<HomeApplicationPresenter.IHomeApplicationView, 
ApplicationEventBus> {
    public interface IHomeApplicationView extends LazyView {
        ...
    }

    //startup event
  public void onStart() {
    ...
  }

  @Override public void bindView() {
        System.out.println("bind view");
   }

}

And the HomeApplicationView  

public class HomeApplicationView extends Viewport implements 
HomeApplicationPresenter.IHomeApplicationView {
...
}

Original issue reported on code.google.com by guillaum...@gmail.com on 21 Sep 2011 at 2:17

GoogleCodeExporter commented 9 years ago
Do you run the apt inside Eclipse? What version of java do you use?

Thanks.

Original comment by plcoir...@gmail.com on 22 Sep 2011 at 1:02

GoogleCodeExporter commented 9 years ago
I'm running APT within intellij 10.5.
The java version is jdk1.6.0_26

Thanks.

Original comment by guillaum...@gmail.com on 22 Sep 2011 at 7:13

GoogleCodeExporter commented 9 years ago
APT has a strange behavior. It doesn't behave the same way with eclipse or java 
tools (like maven). Since it was meant to be used for Eclipse, I developed it 
to be compatible with this IDE and unfortunately only this IDE. This means it 
won't work with maven, ant or intellij.

It could a good thing to make it compatible with anything but unfortunately I 
won't have time to do it. If a developer has some time to do it, that would be 
great.

This is not blocking since the ATP is meant only to display messages inside the 
IDE directly. It is not needed to compile or run your project. If you have this 
issue, just remove the ATP from your project.

Original comment by plcoir...@gmail.com on 22 Sep 2011 at 10:24

GoogleCodeExporter commented 9 years ago
I was not aware of the strange behavior from APT. I disabled APT in intellij 
since it was only a way to check at compile time that everything is fine. I 
wish I can help to integrate this tool to my favorite IDE :)
Thanks a lot for your good work and your support. 

Original comment by guillaum...@gmail.com on 23 Sep 2011 at 7:09

GoogleCodeExporter commented 9 years ago
APT isn't supported anymore.

Original comment by plcoir...@gmail.com on 6 Sep 2013 at 4:31