use of org.talend.designer.xmlmap.model.emf.xmlmap.XmlMapData in project tdi-studio-se by Talend.
the class XMLMapperHelper method hasAllInOne.
private static boolean hasAllInOne(final INode xmlMapperNode) {
boolean hasAllInOne = false;
List<? extends IConnection> outConnections = (List<? extends IConnection>) xmlMapperNode.getOutgoingConnections();
XmlMapData xmlMapData = (XmlMapData) ElementParameterParser.getObjectValueXMLTree(xmlMapperNode);
if (xmlMapData != null && outConnections != null && outConnections.size() > 0) {
List<OutputXmlTree> outputTables = xmlMapData.getOutputTrees();
HashMap<String, IConnection> hNameToConnection = new HashMap<String, IConnection>();
for (IConnection connection : outConnections) {
hNameToConnection.put(connection.getName(), connection);
}
for (OutputXmlTree outputTable : outputTables) {
String tableName = outputTable.getName();
IConnection connection = hNameToConnection.get(tableName);
if (connection == null) {
continue;
}
if (outputTable.isAllInOne()) {
hasAllInOne = true;
break;
}
}
}
return hasAllInOne;
}
use of org.talend.designer.xmlmap.model.emf.xmlmap.XmlMapData in project tdi-studio-se by Talend.
the class ProblemsAnalyser method checkProblems.
public void checkProblems(AbstractInOutTree abstractTree) {
// clear problems for the tree before recheck it
if (treeAndProblems.get(abstractTree) != null) {
treeAndProblems.get(abstractTree).clear();
}
// check problems for InputLoopTable in output
final XmlMapData copyOfMapData = mapperManager.getExternalData();
// check problems for InputLoopTable in output
InputXmlTree mainInputTree = mapperManager.getMainInputTree();
if (abstractTree instanceof OutputXmlTree) {
checkInputLoopTablesProblem((OutputXmlTree) abstractTree, mainInputTree);
}
isMultipleDocType = false;
List<? extends TreeNode> nodes = null;
if (abstractTree instanceof InputXmlTree) {
nodes = ((InputXmlTree) abstractTree).getNodes();
} else if (abstractTree instanceof OutputXmlTree) {
nodes = ((OutputXmlTree) abstractTree).getNodes();
}
if (nodes != null) {
checkTreeNodesProblem(abstractTree, nodes);
}
if (treeAndProblems.get(abstractTree) == null || treeAndProblems.get(abstractTree).isEmpty()) {
treeAndProblems.remove(abstractTree);
}
}
use of org.talend.designer.xmlmap.model.emf.xmlmap.XmlMapData in project tdi-studio-se by Talend.
the class XmlMapFiguresManager method getInputTables.
/*
* (non-Javadoc)
*
* @see org.talend.designer.newabstractmap.figures.manager.FiguresManager#getInputTables()
*/
@Override
protected List<MapperTable> getInputTables() {
List<MapperTable> inputTables = new ArrayList<MapperTable>();
XmlMapData mapData = (XmlMapData) getRootEditPart().getModel();
inputTables.addAll(mapData.getInputTrees());
return inputTables;
}
use of org.talend.designer.xmlmap.model.emf.xmlmap.XmlMapData in project tdi-studio-se by Talend.
the class VarToolBarFigure method removeVar.
@Override
protected void removeVar() {
CommandStack commandStack = getTableManager().getGraphicalViewer().getEditDomain().getCommandStack();
commandStack.execute(new Command() {
@Override
public void execute() {
List selectedEditParts = getTableManager().getGraphicalViewer().getSelectedEditParts();
final List<VarNode> toRemove = new ArrayList<VarNode>();
int minIndex = parentTable.getNodes().size() - 1;
for (Object obj : selectedEditParts) {
if (obj instanceof VarNodeEditPart) {
VarNode model = (VarNode) ((VarNodeEditPart) obj).getModel();
toRemove.add(model);
XmlMapUtil.detachNodeConnections(model, (XmlMapData) parentTable.eContainer(), true);
int index = parentTable.getNodes().indexOf(model);
if (index < minIndex) {
minIndex = index;
}
}
}
parentTable.getNodes().removeAll(toRemove);
if (!tablePart.getChildren().isEmpty()) {
if (minIndex > tablePart.getChildren().size() - 1) {
minIndex = tablePart.getChildren().size() - 1;
}
tablePart.getViewer().select((EditPart) tablePart.getChildren().get(minIndex));
} else {
remove.setEnabled(false);
}
}
});
}
use of org.talend.designer.xmlmap.model.emf.xmlmap.XmlMapData in project tdi-studio-se by Talend.
the class XmlMapFiguresManager method getOutputTables.
/*
* (non-Javadoc)
*
* @see org.talend.designer.newabstractmap.figures.manager.FiguresManager#getOutputTables()
*/
@Override
protected List<MapperTable> getOutputTables() {
List<MapperTable> outputTables = new ArrayList<MapperTable>();
XmlMapData mapData = (XmlMapData) getRootEditPart().getModel();
outputTables.addAll(mapData.getOutputTrees());
return outputTables;
}
Aggregations