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