final GeneratorContext context = this.getGeneratorContext();
context.branch();
context.info("Implementing " + method.getName());
final NewMethod newMethod = method.copy(newType);
newMethod.setAbstract(false);
newMethod.setFinal(true);
newMethod.setNative(false);
CodeBlock body = null;
while (true) {
final Type widgetType = method.getReturnType();
if (widgetType.equals(this.getTextBox())) {
body = buildTextBoxGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getTextArea())) {
body = buildTextAreaGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getRadioButton())) {
body = buildRadioButtonGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getCheckBox())) {
body = buildCheckBoxGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getListBox())) {
body = buildListBoxGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getLabel())) {
body = buildLabelGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getButton())) {
body = buildButtonGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getImage())) {
body = buildImageGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getHyperlink())) {
body = buildHyperlinkGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getHtml())) {
body = buildHtmlGetterMethodBody(method);
break;
}
if (widgetType.equals(this.getFormPanel())) {
body = buildFormPanelGetterMethodBody(method);
break;
}
this.throwUnsupportedWidgetType(method);
break;
}
newMethod.setBody(body);
context.unbranch();
}