use of org.eclipse.scout.rt.shared.data.form.fields.treefield.AbstractTreeFieldData in project scout.rt by eclipse.
the class FormDataStatementBuilder method build.
@SuppressWarnings("cast")
public String build(AbstractFormData formData) {
m_where = new StringBuilder();
// build constraints for fields
for (BasicPartDefinition def : m_basicDefs) {
if (def.accept(formData)) {
Map<String, String> parentAliasMap = getAliasMapper().getRootAliases();
EntityContribution contrib = def.createInstance(this, formData, parentAliasMap);
String cons = createWhereConstraint(contrib);
if (cons != null) {
addWhere(" AND " + cons);
}
}
}
// build constraints for composer trees
Map<Integer, Map<String, AbstractFormFieldData>> fieldsBreathFirstMap = formData.getAllFieldsRec();
for (Map<String, AbstractFormFieldData> map : fieldsBreathFirstMap.values()) {
for (AbstractFormFieldData f : map.values()) {
if (f.isValueSet() && f instanceof AbstractTreeFieldData) {
// composer tree with entity, attribute
EntityContribution contrib = buildTreeNodes(((AbstractTreeFieldData) f).getRoots(), EntityStrategy.BuildConstraints, AttributeStrategy.BuildConstraintOfAttributeWithContext);
String cons = createWhereConstraint(contrib);
if (cons != null) {
addWhere(" AND " + cons);
}
}
}
}
return getWhereConstraints();
}
use of org.eclipse.scout.rt.shared.data.form.fields.treefield.AbstractTreeFieldData in project scout.rt by eclipse.
the class AbstractComposerField method importFormFieldData.
@Override
public void importFormFieldData(AbstractFormFieldData source, boolean valueChangeTriggersEnabled) {
Assertions.assertNotNull(source);
AbstractTreeFieldData treeFieldData = (AbstractTreeFieldData) source;
if (treeFieldData.isValueSet() && m_tree != null) {
try {
if (!valueChangeTriggersEnabled) {
setValueChangeTriggerEnabled(false);
}
//
m_tree.importTreeData(treeFieldData);
} finally {
if (!valueChangeTriggersEnabled) {
setValueChangeTriggerEnabled(true);
}
}
}
}
use of org.eclipse.scout.rt.shared.data.form.fields.treefield.AbstractTreeFieldData in project scout.rt by eclipse.
the class AbstractComposerField method exportFormFieldData.
@Override
public void exportFormFieldData(AbstractFormFieldData target) {
if (m_tree != null) {
AbstractTreeFieldData treeFieldData = (AbstractTreeFieldData) target;
m_tree.exportTreeData(treeFieldData);
}
}
use of org.eclipse.scout.rt.shared.data.form.fields.treefield.AbstractTreeFieldData in project scout.rt by eclipse.
the class AbstractTreeField method importFormFieldData.
@Override
public void importFormFieldData(AbstractFormFieldData source, boolean valueChangeTriggersEnabled) {
Assertions.assertNotNull(source);
AbstractTreeFieldData treeFieldData = (AbstractTreeFieldData) source;
if (treeFieldData.isValueSet() && m_tree != null) {
try {
if (!valueChangeTriggersEnabled) {
setValueChangeTriggerEnabled(false);
}
//
m_tree.importTreeData(treeFieldData);
} finally {
if (!valueChangeTriggersEnabled) {
setValueChangeTriggerEnabled(true);
}
}
}
}
Aggregations