use of org.eclipse.scout.rt.shared.data.form.properties.AbstractPropertyData in project scout.rt by eclipse.
the class AbstractFormData method initConfig.
@Override
protected void initConfig() {
// add properties
List<Class<AbstractPropertyData>> configuredPropertyDatas = getConfiguredPropertyDatas();
Map<Class<? extends AbstractPropertyData>, AbstractPropertyData> propMap = new HashMap<Class<? extends AbstractPropertyData>, AbstractPropertyData>(configuredPropertyDatas.size());
for (Class<AbstractPropertyData> propertyDataClazz : configuredPropertyDatas) {
AbstractPropertyData p = ConfigurationUtility.newInnerInstance(this, propertyDataClazz);
propMap.put(p.getClass(), p);
}
if (!propMap.isEmpty()) {
m_propertyMap = propMap;
}
// add fields
List<Class<? extends AbstractFormFieldData>> formFieldDataClazzes = getConfiguredFieldDatas();
m_fieldMap = new HashMap<Class<? extends AbstractFormFieldData>, AbstractFormFieldData>(formFieldDataClazzes.size());
Map<Class<?>, Class<? extends AbstractFormFieldData>> replacements = ConfigurationUtility.getReplacementMapping(formFieldDataClazzes);
if (!replacements.isEmpty()) {
m_fieldDataReplacements = replacements;
}
for (Class<? extends AbstractFormFieldData> formFieldDataClazz : formFieldDataClazzes) {
AbstractFormFieldData f = ConfigurationUtility.newInnerInstance(this, formFieldDataClazz);
m_fieldMap.put(f.getClass(), f);
}
}
use of org.eclipse.scout.rt.shared.data.form.properties.AbstractPropertyData in project scout.rt by eclipse.
the class AbstractFormData method getAllPropertiesRec.
/**
* @return all properties of the form data and all its external template field data in a map with qualified ids<br>
* The array of returned fields is the result of a top-down breadth-first tree traversal
* <p>
* Example:
*
* <pre>
* A (p1, p4)
* U
* E (p3)
* F
* V
* B
* X (p2)
* Y
* </pre>
*
* would be returned as p1, p4, p2, p3
*/
public Map<Integer, Map<String, /* qualified property id */
AbstractPropertyData<?>>> getAllPropertiesRec() {
TreeMap<Integer, Map<String, AbstractPropertyData<?>>> breadthFirstMap = new TreeMap<Integer, Map<String, AbstractPropertyData<?>>>();
HashMap<String, AbstractPropertyData<?>> rootMap = new HashMap<String, /* qualified field id */
AbstractPropertyData<?>>();
breadthFirstMap.put(0, rootMap);
for (AbstractPropertyData<?> prop : getAllProperties()) {
rootMap.put(prop.getClass().getSimpleName(), prop);
}
for (AbstractFormFieldData child : getFields()) {
collectAllPropertiesRec(child, breadthFirstMap, 1, child.getFieldId() + FIELD_PATH_DELIM);
}
return breadthFirstMap;
}
Aggregations