Search in sources :

Example 1 with RelationPart

use of org.talend.sqlbuilder.erdiagram.ui.parts.RelationPart in project tdi-studio-se by Talend.

the class ErDiagramPartFactory method createEditPart.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart, java.lang.Object)
     */
public EditPart createEditPart(EditPart context, Object model) {
    EditPart part = null;
    if (model instanceof ErDiagram) {
        part = new ErDiagramPart();
    } else if (model instanceof Column) {
        part = new ColumnPart();
    } else if (model instanceof Table) {
        part = new TablePart();
    } else if (model instanceof Relation) {
        part = new RelationPart();
    } else {
        return null;
    }
    // tell the newly created part about the model object
    part.setModel(model);
    return part;
}
Also used : RelationPart(org.talend.sqlbuilder.erdiagram.ui.parts.RelationPart) Relation(org.talend.sqlbuilder.erdiagram.ui.nodes.Relation) Table(org.talend.sqlbuilder.erdiagram.ui.nodes.Table) ErDiagram(org.talend.sqlbuilder.erdiagram.ui.nodes.ErDiagram) Column(org.talend.sqlbuilder.erdiagram.ui.nodes.Column) EditPart(org.eclipse.gef.EditPart) TablePart(org.talend.sqlbuilder.erdiagram.ui.parts.TablePart) ColumnPart(org.talend.sqlbuilder.erdiagram.ui.parts.ColumnPart) ErDiagramPart(org.talend.sqlbuilder.erdiagram.ui.parts.ErDiagramPart)

Aggregations

EditPart (org.eclipse.gef.EditPart)1 Column (org.talend.sqlbuilder.erdiagram.ui.nodes.Column)1 ErDiagram (org.talend.sqlbuilder.erdiagram.ui.nodes.ErDiagram)1 Relation (org.talend.sqlbuilder.erdiagram.ui.nodes.Relation)1 Table (org.talend.sqlbuilder.erdiagram.ui.nodes.Table)1 ColumnPart (org.talend.sqlbuilder.erdiagram.ui.parts.ColumnPart)1 ErDiagramPart (org.talend.sqlbuilder.erdiagram.ui.parts.ErDiagramPart)1 RelationPart (org.talend.sqlbuilder.erdiagram.ui.parts.RelationPart)1 TablePart (org.talend.sqlbuilder.erdiagram.ui.parts.TablePart)1