Search in sources :

Example 1 with ComposerAttributeForm

use of org.eclipse.scout.rt.client.ui.form.fields.composer.internal.ComposerAttributeForm in project scout.rt by eclipse.

the class AbstractAddAttributeMenu method execAction.

@Override
protected void execAction() {
    ComposerAttributeForm form = new ComposerAttributeForm();
    EntityNode eNode = null;
    ITreeNode n = m_parentNode;
    while (n != null) {
        if (n instanceof EntityNode) {
            eNode = (EntityNode) n;
            break;
        }
        n = n.getParentNode();
    }
    if (eNode != null) {
        form.setAvailableAttributes(eNode.getEntity().getAttributes());
    } else {
        form.setAvailableAttributes(m_field.getAttributes());
    }
    form.startNew();
    form.waitFor();
    if (form.isFormStored()) {
        IDataModelAttribute a = form.getSelectedAttribute();
        IDataModelAttributeOp op = form.getSelectedOp();
        List<Object> values = form.getSelectedValues();
        List<String> displayValues = form.getSelectedDisplayValues();
        m_field.addAttributeNode(m_parentNode, a, null, op, values, displayValues);
    }
}
Also used : ITreeNode(org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode) IDataModelAttributeOp(org.eclipse.scout.rt.shared.data.model.IDataModelAttributeOp) IDataModelAttribute(org.eclipse.scout.rt.shared.data.model.IDataModelAttribute) ComposerAttributeForm(org.eclipse.scout.rt.client.ui.form.fields.composer.internal.ComposerAttributeForm)

Aggregations

ITreeNode (org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode)1 ComposerAttributeForm (org.eclipse.scout.rt.client.ui.form.fields.composer.internal.ComposerAttributeForm)1 IDataModelAttribute (org.eclipse.scout.rt.shared.data.model.IDataModelAttribute)1 IDataModelAttributeOp (org.eclipse.scout.rt.shared.data.model.IDataModelAttributeOp)1