GWT generated java code does not compile. No clear explanation given.

108 views
Skip to first unread message

Tiago Rinck Caveden

unread,
Nov 19, 2012, 4:31:23 AM11/19/12
to google-we...@googlegroups.com
Hello all,

I'm having a tough issue. GWT is generating a piece of Java code that does not compile. I wonder if any GWT pro here could help me find a workaround or an actual fix to whatever is wrong.

First let me explain what I'm attempting to do. I'm annoyed by the fact that CellTables and the Editor framework don't play well together. So I decided to implement something that could make this two pieces of GWT code interact better.

I started by making a merge between ListDataProvider and ListEditor. The result is the class ListEditorDataProvider attached. This class works fine, and it's all I needed when I didn't want to edit the elements of the list, just the list itself (adding or removing elements, for ex.).

I wasn't yet satisfied, because in some cases I did want to edit the elements of the List. For this reason, I wrote the EditableCellTable class attached, which uses ListEditorDataProvider. The goal is to make the integration between Columns and Editors as smooth as I could, and to reduce some of the boilerplate in user code.
This class got quite complicated, with lots of generics. And I guess my problem lies somewhere in there.

Before actually using the class, my project's code compiled fine. It was only after creating my first instance of EditableCellTable, which would specify actual types to all the generic templates, that I started having errors.

Besides the two classes above, I attach to this mail the generated java class that doesn't compile, an example view using this EditableCellTable, a couple EntityProxies used by the view, as well as an enum. I commented out "utility code" in EditableCellTable, and other pieces of code which don't matter. I tried to remove  package declarations and all other references that could contain my employer's name since I'm not 100% sure they are okay with it.

I was using GWT2.4.0, but I verified that the problem remains on 2.5.0 as well. I'm also using kjordan's fix for issue 6912 provided here. I don't think this fix has anything to do with my problem since it deals with ExtraTypes, but I thought I should mention it since it relates to code generation.

Can anybody help me? I'm totally lost on this one.

Thank you very much in advance for any help given,
--
Tiago Rinck Caveden

EditableCellTable.java
ListEditorDataProvider.java
OrganizationEntityParam.java
OrganizationEntityParamProxy.java
OrganizationEntityTypeProxy.java
OrgEntityTypeEditView.java
OrgEntityTypeEditView.ui.xml
OrgEntityTypeEditView_RequestFactoryEditorDelegate.java

Thomas Broyer

unread,
Nov 19, 2012, 4:50:18 AM11/19/12
to google-we...@googlegroups.com
The problem is that in EditableCellTable your ListEditor is typed with "? extends EditableCellTable.SubEditor<T>". Your EditableCellTable should have an additional parameter type giving the type of SubEditor to use (will be ParamRowEditor in your case):

public class EditableCellTable<T,E extends EditableCellTable.SubEditor<T>> extends CellTable<T> implements IsEditor<ListEditor<T, E>> { … }

And in your view:

@UiField(provided=true) EditableCellTable<OrganizationEntityParamProxy, ParamRowEditor> acceptableParams = …

Tiago

unread,
Nov 19, 2012, 5:45:49 AM11/19/12
to google-we...@googlegroups.com
Wow, you fixed it right away! Impressive!

Provide me your Bitcoin tip address and I'll send you what I have in my phone as a display of gratitude.

By the way, are you aware of any intentions to make a proper implementation of what I tried to do? A widget that could display a list of items in a table and allow the edition of such list via the Editor framework. I don't think I'd be the only one using it... :-)

Thank you again,
Tiago.

confile

unread,
Jan 29, 2016, 1:35:01 PM1/29/16
to GWT Users, cav...@gmail.com
Hi Tiago, 

could you please provide an example of how the ListEditorDataProvider works. I have problems moving from my:

ListDataProvider<String> dataProvider;
HasDataEditor<String> dataEditor;

to you ListEditorDataProvider.
Reply all
Reply to author
Forward
0 new messages