use of org.talend.designer.gefabstractmap.part.MapperRootEditPart in project tdi-studio-se by Talend.
the class MapperGraphicalEditor method makeDefaultSelection.
public void makeDefaultSelection() {
EditPart contents = getGraphicalViewer().getContents();
if (contents instanceof MapperRootEditPart) {
MapperRootEditPart mapdataPart = (MapperRootEditPart) contents;
List children = mapdataPart.getChildren();
InputTablePart firstInputPart = null;
OutputTablePart firstOutputPart = null;
if (children != null) {
for (int i = 0; i < children.size(); i++) {
Object object = children.get(i);
if (object instanceof InputTablePart && firstInputPart == null) {
firstInputPart = (InputTablePart) object;
}
if (object instanceof OutputTablePart && firstOutputPart == null) {
firstOutputPart = (OutputTablePart) object;
}
if (firstInputPart != null && firstOutputPart != null) {
break;
}
}
if (firstInputPart != null) {
getGraphicalViewer().appendSelection(firstInputPart);
}
if (firstOutputPart != null) {
getGraphicalViewer().appendSelection(firstOutputPart);
}
}
}
}
Aggregations