Search in sources :

Example 1 with MapperRootEditPart

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);
            }
        }
    }
}
Also used : OutputTablePart(org.talend.designer.gefabstractmap.part.OutputTablePart) MapperRootEditPart(org.talend.designer.gefabstractmap.part.MapperRootEditPart) MapperRootEditPart(org.talend.designer.gefabstractmap.part.MapperRootEditPart) EditPart(org.eclipse.gef.EditPart) List(java.util.List) EventObject(java.util.EventObject) InputTablePart(org.talend.designer.gefabstractmap.part.InputTablePart)

Aggregations

EventObject (java.util.EventObject)1 List (java.util.List)1 EditPart (org.eclipse.gef.EditPart)1 InputTablePart (org.talend.designer.gefabstractmap.part.InputTablePart)1 MapperRootEditPart (org.talend.designer.gefabstractmap.part.MapperRootEditPart)1 OutputTablePart (org.talend.designer.gefabstractmap.part.OutputTablePart)1