use of org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree in project tdi-studio-se by Talend.
the class MapperManager method refreshTreeSchemaEditor.
/**
*
* DOC Administrator Comment method "refreshTreeSchemaEditor".
*
* @param outputTree
*/
public void refreshTreeSchemaEditor(AbstractInOutTree outputTree) {
XmlTreeSchemaTableView outputTreeSchemaEditor = null;
if (outputTree instanceof InputXmlTree) {
outputTreeSchemaEditor = mapperUI.getTabFolderEditors().getInputTreeSchemaEditor();
} else {
outputTreeSchemaEditor = mapperUI.getTabFolderEditors().getOutputTreeSchemaEditor();
}
TreeSchemaTableEditor editor = new TreeSchemaTableEditor(outputTree);
outputTreeSchemaEditor.setExtendedTableModel(editor);
// editor.setModifiedBeanListenable(outputTreeSchemaEditor.getTableViewerCreator());
}
use of org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree in project tdi-studio-se by Talend.
the class InputLoopTableUtil method getSourceLoopsFromConnectionSource.
private static void getSourceLoopsFromConnectionSource(TreeNode connectionSource, List<TreeNode> soruceLoops, InputXmlTree mainInputTree) {
InputXmlTree inputTree = (InputXmlTree) XmlMapUtil.getAbstractInOutTree(connectionSource);
TreeNode loopParentTreeNode = null;
if (inputTree == mainInputTree) {
loopParentTreeNode = XmlMapUtil.getLoopParentNode(connectionSource);
if (loopParentTreeNode != null) {
soruceLoops.add(loopParentTreeNode);
}
} else {
getLoopSourceFromLookupNode(connectionSource, mainInputTree, soruceLoops);
}
}
use of org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree in project tdi-studio-se by Talend.
the class MapDataHelper method rebuildModelInputs.
public void rebuildModelInputs(List<? extends IConnection> inputConn, XmlMapData mapData) {
// remove no used input tree
if (mapData.getInputTrees().size() != inputConn.size()) {
List treesToRemove = new ArrayList();
for (InputXmlTree inputTree : mapData.getInputTrees()) {
boolean found = false;
for (IConnection connection : inputConn) {
if (inputTree.getName().equals(connection.getName())) {
found = true;
}
}
if (!found) {
for (TreeNode treeNode : inputTree.getNodes()) {
XmlMapUtil.detachNodeConnections(treeNode, mapData, true);
}
treesToRemove.add(inputTree);
XmlMapUtil.detachFilterSource(inputTree, mapData);
}
}
mapData.getInputTrees().removeAll(treesToRemove);
}
for (IConnection inData : inputConn) {
String name = inData.getName();
InputXmlTree inputTree = null;
for (InputXmlTree in : mapData.getInputTrees()) {
if (in.getName() != null && in.getName().equals(name)) {
inputTree = in;
break;
}
}
if (inputTree == null) {
inputTree = XmlmapFactory.eINSTANCE.createInputXmlTree();
inputTree.setName(name);
inputTree.setLookup(EConnectionType.FLOW_MAIN != inData.getLineStyle());
mapData.getInputTrees().add(inputTree.isLookup() ? mapData.getInputTrees().size() : 0, inputTree);
} else {
inputTree.setLookup(EConnectionType.FLOW_MAIN != inData.getLineStyle());
}
if (inputTree.getLookupMode() == null) {
inputTree.setLookupMode(XML_MAP_LOOKUP_MODE.LOAD_ONCE.toString());
}
if (inputTree.getMatchingMode() == null) {
inputTree.setMatchingMode(XML_MAP_MATCHING_MODE.ALL_ROWS.toString());
}
rebuildInputTree(inputTree, inData.getMetadataTable(), mapData);
}
}
use of org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree in project tdi-studio-se by Talend.
the class XmlMapTableTree method createColumns.
@Override
protected void createColumns() {
layoutManager.setAjustToTableWidth(false);
// table column title
MapperTable xmlTree = tableModelManager.getModel();
boolean hasExpression = false;
if (xmlTree instanceof InputXmlTree) {
InputXmlTree inputTree = (InputXmlTree) xmlTree;
if (inputTree.isLookup()) {
expressionColumn = new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
expressionColumn.setText("Exp.key");
this.addColumn(expressionColumn);
columnSash = new ColumnSash(this);
columnSash.setLeftColumn(expressionColumn);
this.addSeparator(columnSash);
hasExpression = true;
}
} else {
expressionColumn = new TableColumn(ColumnKeyConstant.KEY_EXPRESSION);
expressionColumn.setText("Expression");
this.addColumn(expressionColumn);
columnSash = new ColumnSash(this);
columnSash.setLeftColumn(expressionColumn);
this.addSeparator(columnSash);
hasExpression = true;
}
nameColumn = new TableColumn(ColumnKeyConstant.KEY_NAME);
nameColumn.setText("Column");
if (columnSash != null) {
columnSash.setRightColumn(nameColumn);
}
this.addColumn(nameColumn);
if (hasExpression) {
layoutManager.setWeight(0, 0.5);
}
}
use of org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree 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);
}
Aggregations