Search in sources :

Example 1 with TreeBranch

use of org.talend.designer.gefabstractmap.figures.table.entity.TreeBranch in project tdi-studio-se by Talend.

the class XmlmapTreeNodeFigure method createEntityItems.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.designer.newabstractmap.figures.table.entity.TableEntityFigure#createEntityItems()
     */
@Override
protected void createEntityItems(TableEntityElement entityElement) {
    this.treeNode = getEntityManager().getModel();
    boolean isLookup = false;
    if (treeNode instanceof OutputTreeNode) {
        isLookup = true;
    } else {
        TreeNode inputTreeNodeRoot = XmlMapUtil.getTreeNodeRoot(treeNode);
        if (inputTreeNodeRoot != null && inputTreeNodeRoot.eContainer() instanceof InputXmlTree) {
            isLookup = ((InputXmlTree) inputTreeNodeRoot.eContainer()).isLookup();
        }
    }
    if (isLookup) {
        expression = new ExpressionFigure();
        expression.setText(treeNode.getExpression());
        if (!XmlMapUtil.isExpressionEditable(treeNode)) {
            expression.setOpaque(true);
            expression.setBackgroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_EXPREESION_DISABLE));
        } else {
            expression.setOpaque(false);
        }
        entityElement.add(expression);
    }
    branchContent = new XmlmapBranchContent(getEntityManager());
    TreeBranch treeBranch = new TreeBranch(branchContent, !isRoot());
    entityElement.add(treeBranch);
}
Also used : InputXmlTree(org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree) TreeBranch(org.talend.designer.gefabstractmap.figures.table.entity.TreeBranch) ExpressionFigure(org.talend.designer.gefabstractmap.figures.ExpressionFigure) OutputTreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode) TreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode) OutputTreeNode(org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode)

Aggregations

ExpressionFigure (org.talend.designer.gefabstractmap.figures.ExpressionFigure)1 TreeBranch (org.talend.designer.gefabstractmap.figures.table.entity.TreeBranch)1 InputXmlTree (org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree)1 OutputTreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode)1 TreeNode (org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode)1