Search in sources :

Example 6 with AbstractConnectionEditPart

use of org.eclipse.gef.editparts.AbstractConnectionEditPart in project tdi-studio-se by Talend.

the class TableEntityPart method refreshChildrenTargetConnections.

public void refreshChildrenTargetConnections(TableEntityPart rootPart, boolean expanded) {
    for (Object obj : getChildren()) {
        if (obj instanceof TableEntityPart) {
            TableEntityPart part = (TableEntityPart) obj;
            if (expanded) {
                // do collapse
                part.setRootAnchor(rootPart.getFigure());
            } else {
                part.setRootAnchor(null);
            }
            if (part.getTargetConnections() != null) {
                for (Object conn : part.getTargetConnections()) {
                    if (conn instanceof AbstractConnectionEditPart) {
                        AbstractConnectionEditPart connectionEditPart = (AbstractConnectionEditPart) conn;
                        connectionEditPart.refresh();
                    // if (connectionEditPart.getFigure() instanceof PolylineConnection) {
                    // PolylineConnection connFigure = (PolylineConnection) connectionEditPart.getFigure();
                    // if (expanded) {
                    // connFigure.setLineStyle(SWT.LINE_DASHDOTDOT);
                    // } else {
                    // connFigure.setLineStyle(SWT.LINE_SOLID);
                    // }
                    // }
                    }
                }
            }
            part.refreshChildrenTargetConnections(rootPart, expanded);
        }
    }
}
Also used : AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart)

Aggregations

AbstractConnectionEditPart (org.eclipse.gef.editparts.AbstractConnectionEditPart)6 Dimension (org.eclipse.draw2d.geometry.Dimension)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 EditPart (org.eclipse.gef.EditPart)1 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 ConnLabelEditPart (org.talend.designer.core.ui.editor.connections.ConnLabelEditPart)1 ConnectionPart (org.talend.designer.core.ui.editor.connections.ConnectionPart)1 ConnectionPerformanceEditPart (org.talend.designer.core.ui.editor.connections.ConnectionPerformanceEditPart)1 NodeLabelEditPart (org.talend.designer.core.ui.editor.nodes.NodeLabelEditPart)1 NoteEditPart (org.talend.designer.core.ui.editor.notes.NoteEditPart)1 ProcessPart (org.talend.designer.core.ui.editor.process.ProcessPart)1