Search in sources :

Example 1 with XmlMapFilterContainer

use of org.talend.designer.xmlmap.figures.treesettings.XmlMapFilterContainer in project tdi-studio-se by Talend.

the class InputXmlTreeFigure method createTreeSettings.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.designer.xmlmap.figures.AbstractInOutTreeFigure#createTreeSettings(org.eclipse.draw2d.Figure)
     */
@Override
protected void createTreeSettings(Figure parent) {
    if (getInputXmlTree().isLookup()) {
        settingContainer = new InputTreeSettingContainer(getMappManager());
        parent.add(settingContainer);
        filterFigure = new XmlMapFilterContainer(getMappManager(), (Composite) getMappManager().getEditPart().getViewer().getControl());
        parent.add(filterFigure);
        globalMapContainer = new GlobalMapContainer(getMappManager());
        parent.add(globalMapContainer);
    }
}
Also used : GlobalMapContainer(org.talend.designer.xmlmap.figures.table.GlobalMapContainer) InputTreeSettingContainer(org.talend.designer.xmlmap.figures.treesettings.InputTreeSettingContainer) Composite(org.eclipse.swt.widgets.Composite) XmlMapFilterContainer(org.talend.designer.xmlmap.figures.treesettings.XmlMapFilterContainer)

Example 2 with XmlMapFilterContainer

use of org.talend.designer.xmlmap.figures.treesettings.XmlMapFilterContainer in project tdi-studio-se by Talend.

the class OutputXmlTreeFigure method createTreeSettings.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.designer.xmlmap.figures.AbstractInOutTreeFigure#createTreeSettings(org.eclipse.draw2d.Figure)
     */
@Override
protected void createTreeSettings(Figure parent) {
    settingContainer = new OutputTreeSettingContainer(getTableManager());
    parent.add(settingContainer);
    filterFigure = new XmlMapFilterContainer(getTableManager(), (Composite) getTableManager().getEditPart().getViewer().getControl());
    parent.add(filterFigure);
}
Also used : OutputTreeSettingContainer(org.talend.designer.xmlmap.figures.treesettings.OutputTreeSettingContainer) Composite(org.eclipse.swt.widgets.Composite) XmlMapFilterContainer(org.talend.designer.xmlmap.figures.treesettings.XmlMapFilterContainer)

Example 3 with XmlMapFilterContainer

use of org.talend.designer.xmlmap.figures.treesettings.XmlMapFilterContainer in project tdi-studio-se by Talend.

the class SearchZoneMapper method setEntryState.

public void setEntryState(MapperManager mapperManager, EntryState entryState, Figure entry) {
    if (entry != null) {
        if (entry instanceof XmlmapTreeNodeFigure) {
            XmlmapTreeNodeFigure xmlMapTreeNodeFigure = (XmlmapTreeNodeFigure) entry;
            if (xmlMapTreeNodeFigure != null) {
                if (xmlMapTreeNodeFigure.getExpressionFigure() != null && matcher.matches(xmlMapTreeNodeFigure.getExpressionFigure().getText())) {
                    xmlMapTreeNodeFigure.getExpressionFigure().setOpaque(true);
                    xmlMapTreeNodeFigure.getExpressionFigure().setBackgroundColor(entryState.getColor());
                }
                if (xmlMapTreeNodeFigure.getTreeNode() != null && matcher.matches(xmlMapTreeNodeFigure.getTreeNode().getName())) {
                    if (XmlMapUtil.isSubElementOfDocument(xmlMapTreeNodeFigure.getTreeNode())) {
                        if (!xmlMapTreeNodeFigure.getTreeNode().getName().endsWith("(choice)")) {
                            xmlMapTreeNodeFigure.getBranchContent().setOpaque(true);
                            xmlMapTreeNodeFigure.getBranchContent().setBackgroundColor(entryState.getColor());
                        }
                    } else {
                        xmlMapTreeNodeFigure.setOpaque(true);
                        xmlMapTreeNodeFigure.setBackgroundColor(entryState.getColor());
                        xmlMapTreeNodeFigure.setOpaque(false);
                        if (xmlMapTreeNodeFigure.getExpressionFigure() != null && !matcher.matches(xmlMapTreeNodeFigure.getExpressionFigure().getText())) {
                        // xmlMapTreeNodeFigure.getExpressionFigure().setOpaque(true);
                        // xmlMapTreeNodeFigure.getExpressionFigure().setBackgroundColor(EntryState.NONE.getColor());
                        }
                    }
                }
            }
        } else if (entry instanceof VarEntityFigure) {
            VarEntityFigure varEntityFigure = (VarEntityFigure) entry;
            if (varEntityFigure != null) {
                if (varEntityFigure.getExpression() != null && matcher.matches(varEntityFigure.getExpression().getText())) {
                    varEntityFigure.getExpression().setOpaque(true);
                    varEntityFigure.getExpression().setBackgroundColor(entryState.getColor());
                }
                if (varEntityFigure.getVarName() != null && matcher.matches(varEntityFigure.getVarName())) {
                    varEntityFigure.setOpaque(true);
                    varEntityFigure.setBackgroundColor(entryState.getColor());
                    if (varEntityFigure.getExpression() == null || !matcher.matches(varEntityFigure.getExpression().getText())) {
                        varEntityFigure.getExpression().setOpaque(true);
                        varEntityFigure.getExpression().setBackgroundColor(EntryState.NONE.getColor());
                    }
                    varEntityFigure.getTypeFigure().setOpaque(true);
                    varEntityFigure.getTypeFigure().setBackgroundColor(EntryState.NONE.getColor());
                }
            }
        } else if (entry instanceof XmlMapFilterContainer) {
            XmlMapFilterContainer filterText = (XmlMapFilterContainer) entry;
            if (filterText != null && filterText.getTextArea() != null) {
                filterText.getTextArea().setOpaque(true);
                filterText.getTextArea().setBackgroundColor(entryState.getColor());
            }
        }
    }
}
Also used : VarEntityFigure(org.talend.designer.gefabstractmap.figures.var.VarEntityFigure) XmlmapTreeNodeFigure(org.talend.designer.xmlmap.figures.treeNode.XmlmapTreeNodeFigure) XmlMapFilterContainer(org.talend.designer.xmlmap.figures.treesettings.XmlMapFilterContainer)

Aggregations

XmlMapFilterContainer (org.talend.designer.xmlmap.figures.treesettings.XmlMapFilterContainer)3 Composite (org.eclipse.swt.widgets.Composite)2 VarEntityFigure (org.talend.designer.gefabstractmap.figures.var.VarEntityFigure)1 GlobalMapContainer (org.talend.designer.xmlmap.figures.table.GlobalMapContainer)1 XmlmapTreeNodeFigure (org.talend.designer.xmlmap.figures.treeNode.XmlmapTreeNodeFigure)1 InputTreeSettingContainer (org.talend.designer.xmlmap.figures.treesettings.InputTreeSettingContainer)1 OutputTreeSettingContainer (org.talend.designer.xmlmap.figures.treesettings.OutputTreeSettingContainer)1