Search in sources :

Example 6 with EntityNode

use of org.eclipse.scout.rt.client.ui.form.fields.composer.node.EntityNode in project scout.rt by eclipse.

the class ComposerDisplayTextBuilder method visitAndNodes.

private void visitAndNodes(List<? extends ITreeNode> nodes, StringBuilder buf, String prefix) {
    Iterator<? extends ITreeNode> nodeIt = nodes.iterator();
    ITreeNode node = null;
    boolean skipDoNext = false;
    while (nodeIt.hasNext() || skipDoNext) {
        // to ensure visit first node after an either or...
        if (!skipDoNext) {
            node = nodeIt.next();
        }
        // reset
        skipDoNext = false;
        if (node instanceof EntityNode) {
            visitEntityNode((EntityNode) node, buf, prefix);
        } else if (node instanceof AttributeNode) {
            visitAttributeNode((AttributeNode) node, buf, prefix);
        } else if (node instanceof EitherOrNode) {
            List<EitherOrNode> eitherOrNodes = new ArrayList<EitherOrNode>();
            eitherOrNodes.add((EitherOrNode) node);
            while (nodeIt.hasNext()) {
                node = nodeIt.next();
                if (node instanceof EitherOrNode) {
                    eitherOrNodes.add((EitherOrNode) node);
                } else {
                    skipDoNext = true;
                    break;
                }
            }
            visitOrNodes(eitherOrNodes, buf, prefix);
        }
    }
}
Also used : EitherOrNode(org.eclipse.scout.rt.client.ui.form.fields.composer.node.EitherOrNode) ITreeNode(org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode) AttributeNode(org.eclipse.scout.rt.client.ui.form.fields.composer.node.AttributeNode) ArrayList(java.util.ArrayList) EntityNode(org.eclipse.scout.rt.client.ui.form.fields.composer.node.EntityNode)

Aggregations

EntityNode (org.eclipse.scout.rt.client.ui.form.fields.composer.node.EntityNode)6 LinkedList (java.util.LinkedList)3 Order (org.eclipse.scout.rt.platform.Order)3 ConfigOperation (org.eclipse.scout.rt.platform.annotations.ConfigOperation)3 ArrayList (java.util.ArrayList)2 ITreeNode (org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode)2 AttributeNode (org.eclipse.scout.rt.client.ui.form.fields.composer.node.AttributeNode)2 EitherOrNode (org.eclipse.scout.rt.client.ui.form.fields.composer.node.EitherOrNode)2 IDataModelEntity (org.eclipse.scout.rt.shared.data.model.IDataModelEntity)2 Iterator (java.util.Iterator)1 List (java.util.List)1 AttributePath (org.eclipse.scout.rt.shared.data.model.AttributePath)1 EntityPath (org.eclipse.scout.rt.shared.data.model.EntityPath)1 IDataModelAttributeOp (org.eclipse.scout.rt.shared.data.model.IDataModelAttributeOp)1 Element (org.w3c.dom.Element)1