use of org.talend.designer.xmlmap.parts.OutputXmlTreeEditPart in project tdi-studio-se by Talend.
the class XmlMapOutputZoneToolBar method moveUp.
/*
* (non-Javadoc)
*
* @see org.talend.designer.xmlmap.figures.treetools.zone.ZoneToolBar#moveUp()
*/
@Override
public void moveUp() {
List<OutputXmlTree> outputTrees = externalData.getOutputTrees();
OutputXmlTreeEditPart currentSelectedOutputXmlTree = graphicViewer.getFiguresManager().getCurrentSelectedOutputTable();
if (currentSelectedOutputXmlTree != null) {
OutputXmlTree selectedTree = (OutputXmlTree) currentSelectedOutputXmlTree.getModel();
int index = outputTrees.indexOf(selectedTree);
if (index != -1 && index - 1 >= 0) {
outputTrees.remove(selectedTree);
outputTrees.add(index - 1, selectedTree);
// index of modelchildren is different from index of tree
int indexOf = externalPart.getModelChildren().indexOf(selectedTree);
if (indexOf != -1) {
graphicViewer.appendSelection((EditPart) externalPart.getChildren().get(indexOf));
}
}
}
}
use of org.talend.designer.xmlmap.parts.OutputXmlTreeEditPart in project tdi-studio-se by Talend.
the class XmlMapOutputZoneToolBar method moveDown.
/*
* (non-Javadoc)
*
* @see org.talend.designer.xmlmap.figures.treetools.zone.ZoneToolBar#moveDown()
*/
@Override
public void moveDown() {
List<OutputXmlTree> outputTrees = externalData.getOutputTrees();
OutputXmlTreeEditPart currentSelectedOutputXmlTree = graphicViewer.getFiguresManager().getCurrentSelectedOutputTable();
if (currentSelectedOutputXmlTree != null) {
OutputXmlTree selectedTree = (OutputXmlTree) currentSelectedOutputXmlTree.getModel();
int index = outputTrees.indexOf(selectedTree);
if (index != -1 && index + 1 < outputTrees.size()) {
outputTrees.remove(selectedTree);
outputTrees.add(index + 1, selectedTree);
// index of modelchildren is different from index of tree
int indexOf = externalPart.getModelChildren().indexOf(selectedTree);
if (indexOf != -1) {
graphicViewer.appendSelection((EditPart) externalPart.getChildren().get(indexOf));
}
}
}
}
Aggregations