GWT: Editor Framework asks for Has/Setter method

192 views Asked by At

I created an editor which contains some sub-editors editing nested fields, but gwt complains that it needs a has/setter method.

Here is my editor code. The class CompInfo has a UIInfo. Inside UIInfo class, displayName is simply a String. I already have setter method for it, but it is still complaining.

// top level editors
@UiField @Path("attrName") TextField attributeName;
@UiField @Path("compName") TextField componentName;
@UiField @Path("compInterfaceName") TextField interfaceName;
@UiField @Path("compType") TextField componentType;
@UiField TextField defaultValue;
@UiField @Path("auxData") TextField crossReference;
@UiField BooleanToggleButton nonUserComponent;
@UiField BooleanToggleButton mandatory;
@UiField TextField annotation;
// ui info editor
@UiField @Path("UIInfo.disabled") CheckBox uiDisabled;
@UiField @Path("UIInfo.displayName") TextField uiDisplayName;

Here are the errors:

[ERROR] [onboardingtool] - Errors in 'generated://03A84A085FC6AAD2AC9A5323F65AA50F/com/algorithmics/mdc/client/widget/CompInfoEditor_UIInfo_displayName_Context.java'
[ERROR] [onboardingtool] - Line 17: The method hasDisplayName() is undefined for the type String
[ERROR] [onboardingtool] - Line 20: The method setDisplayName(String) is undefined for the type String

Here is the code it generated:

public class CompInfoEditor_UIInfo_displayName_Context extends com.google.gwt.editor.client.impl.AbstractEditorContext<java.lang.String> {
  private final com.algorithmics.uds.dmob.input.CompInfo parent;
  public CompInfoEditor_UIInfo_displayName_Context(com.algorithmics.uds.dmob.input.CompInfo parent, com.google.gwt.editor.client.Editor<java.lang.String> editor, String path) {
    super(editor,path);
    this.parent = parent;
  }
  @Override public boolean canSetInModel() {
    return parent != null && true && parent.getUIInfo() != null && parent.getUIInfo().getDisplayName() != null;
  }
  @Override public java.lang.String checkAssignment(Object value) {
    return (java.lang.String) value;
  }
  @Override public Class getEditedType() { return java.lang.String.class; }
  @Override public java.lang.String getFromModel() {
    return (parent != null && parent.getUIInfo() != null && parent.getUIInfo().getDisplayName() != null) ? parent.getUIInfo().getDisplayName().hasDisplayName() : null;
  }
  @Override public void setInModel(java.lang.String data) {
    parent.getUIInfo().getDisplayName().setDisplayName(data);
  }
}

UPDATE:

My UIInfo class has setDisplayName, getDisplayName and hasDisplayName method. It seems like a bug, because when I remove hasDisplayName method, it works OK. (Anyone found this one reported to google?) But UIInfo is actually a legacy class and I cannot remove hasDisplayName. Any suggestions? Or I should just stop using Editor Framework for it?

0

There are 0 answers