private Object getDefaulValue(OperationData d, String attributeName) { return getNestedAttributeValue(d, "defaultValue"); }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration) { return present(controller, configuration, null); }
private void setValue(OperationData attributeDefinition, String attributeRootPath, String attributeLogicalPath, OperationData forModel) { final String mc = getDynamicalColumnMapping(attributeDefinition); final String attributeName = attributeRootPath + "dyn_att_" + mc; final Object value = getModelAttribute(forModel, attributeName); label.setText("--"); if (value == null || StringUtils.isEmpty(String.valueOf(value))) { final Object o = getDefaulValue(attributeDefinition, attributeLogicalPath); if (o != null) { label.setText((String) o); } } else { label.setText((String) value); } }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { final String attributePath = configuration.getPropertyValue("attributePath"); String dynattributename = null; final String rootPath = null; // the dyn attribute name is the last part of the attribute path if (attributePath.split("\\.").length > 0) { final String[] t = attributePath.split("\\."); dynattributename = attributePath; //StringUtils.substringBeforeLast(attributePath, dynattributename); } if (controller instanceof FullTableViewController) { final FullTableViewController c = (FullTableViewController) controller; final SingleTableStructure t = (SingleTableStructure) c.processedElement(); final IPaginatedDataProvider dp = t.getDataProvider(); final MultipleResult attr = (MultipleResult) dp.getTypeDynamicalAttributes(); if(attr != null) { final List<OperationData> datas = attr.getData(); final OperationData p = getDynamicalAttributeDefnition(dynattributename, datas); if (p != null) { setValue(p, rootPath, dynattributename, (OperationData) forModel); } } } return label; }
private void translate(AbstractViewController controller, VLViewComponentXML configuration) { final Object datavalue = ReflectionUIUtils.invokeGetterOn(null, null); initEnumeratedTypeTranslater(configuration); if (datavalue != null) { if (enumeratedTypeTranslater != null) { // TO DO Asunch if long running final String realVal = enumeratedTypeTranslater.translate(controller, configuration, datavalue.toString()); label.setText(realVal); } else { label.setText(datavalue.toString()); } } }