protected Layout getLayout(Object object, Class type) {
return new Layout() {
@Override
public HtmlComponent createComponent(Object object, Class type) {
Grade grade = (Grade) object;
HtmlInlineContainer container = new HtmlInlineContainer();
MetaSlot slot = (MetaSlot) getInputContext().getMetaObject();
final HtmlGradeTextInput value = new HtmlGradeTextInput(isRequired());
value.bind(slot);
value.setMaxLength(getMaxLength());
value.setSize(getSize());
HtmlMenu menu = new HtmlMenu();
menu.setName(slot.getKey().toString() + "_scale");
menu.createDefaultOption(RenderUtils.getResourceString("renderers.menu.default.title"));
for (GradeScale scale : GradeScale.values()) {
menu.createOption(RenderUtils.getEnumString(scale)).setValue(scale.getName());
}
if (grade != null && !grade.isEmpty()) {
value.setValue(grade.getValue());
menu.setValue(grade.getGradeScale().getName());
}
menu.setController(new HtmlController() {
@Override