Component comp = (Component) bean;
WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(comp);
if (adapter != null) {
StringBuilder builder = new StringBuilder();
Object value = property.getFieldValue(bean);
ICodeGen gen = property.getCodeGenerator();
if (gen != null && value != null) {
String initCode = gen.getInitJavaCode(value, imports);
if (initCode != null)
builder.append(initCode);
}
if (!adapter.isRoot()) {
String name = adapter.getID();
builder.append(name + ".");
}
String code;
if (gen != null) {
code = value == null ? "null" : gen.getJavaCode(value, imports);
} else {
code = value == null ? "null" : value.toString();
}
if (code != null) {
builder.append(property.getSetName() + "(");