private Object defaultFor(final ObjectActionParameter param) { final ObjectAdapter defaultAdapter = param.getDefault(objectAdapter); if (defaultAdapter == null) { return null; } // REVIEW: previously was using the spec of the parameter, but think instead it should be the // spec of the adapter itself // final ObjectSpecification defaultSpec = param.getSpecification(); final ObjectSpecification defaultSpec = defaultAdapter.getSpecification(); return DomainObjectReprRenderer.valueOrRef(rendererContext, defaultAdapter, defaultSpec); }
private Object choicesFor(final ObjectActionParameter param) { final ObjectAdapter[] choiceAdapters = param.getChoices(objectAdapter); if (choiceAdapters == null || choiceAdapters.length == 0) { return null; } final List<Object> list = Lists.newArrayList(); for (final ObjectAdapter choiceAdapter : choiceAdapters) { // REVIEW: previously was using the spec of the parameter, but think instead it should be the // spec of the adapter itself // final ObjectSpecification choiceSpec = param.getSpecification(); final ObjectSpecification choiceSpec = choiceAdapter.getSpecification(); list.add(DomainObjectReprRenderer.valueOrRef(rendererContext, choiceAdapter, choiceSpec)); } return list; }
private Object propertyChoices() { final ObjectAdapter[] choiceAdapters = objectMember.getChoices(objectAdapter); if (choiceAdapters == null || choiceAdapters.length == 0) { return null; } final List<Object> list = Lists.newArrayList(); for (final ObjectAdapter choiceAdapter : choiceAdapters) { // REVIEW: previously was using the spec of the member, but think instead it should be the // spec of the adapter itself // final ObjectSpecification choiceSpec = objectMember.getSpecification(); // REVIEW: check that it works for ToDoItem$Category, though... final ObjectSpecification choiceSpec = objectAdapter.getSpecification(); list.add(DomainObjectReprRenderer.valueOrRef(rendererContext, choiceAdapter, choiceSpec)); } return list; }