Search in sources :

Example 1 with RowLayout

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout in project webtools.sourceediting by eclipse.

the class FieldFigure method editPartAttached.

public void editPartAttached(EditPart owner) {
    StructureEditPart structureEditPart = null;
    for (EditPart parent = owner.getParent(); parent != null; parent = parent.getParent()) {
        if (parent instanceof StructureEditPart) {
            structureEditPart = (StructureEditPart) parent;
            break;
        }
    }
    RowLayout rowLayout = (RowLayout) rowFigure.getLayoutManager();
    IStructureFigure typeFigure = structureEditPart.getStructureFigure();
    Assert.isTrue(typeFigure instanceof StructureFigure, "Expected object of type StructureFigure");
    rowLayout.setColumnData(((StructureFigure) typeFigure).getColumnData());
}
Also used : IStructureFigure(org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure) IStructureFigure(org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure) StructureEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart) RowLayout(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout) StructureEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart) EditPart(org.eclipse.gef.EditPart)

Example 2 with RowLayout

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout in project webtools.sourceediting by eclipse.

the class CompartmentFigure method editPartAttached.

public void editPartAttached(EditPart owner) {
    StructureEditPart structureEditPart = null;
    for (EditPart parent = owner.getParent(); parent != null; parent = parent.getParent()) {
        if (parent instanceof StructureEditPart) {
            structureEditPart = (StructureEditPart) parent;
            break;
        }
    }
    RowLayout rowLayout = (RowLayout) rowFigure.getLayoutManager();
    IStructureFigure typeFigure = structureEditPart.getStructureFigure();
    Assert.isTrue(typeFigure instanceof StructureFigure, "Expected object of type StructureFigure");
    rowLayout.setColumnData(((StructureFigure) typeFigure).getColumnData());
}
Also used : IStructureFigure(org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure) IStructureFigure(org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure) StructureEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart) RowLayout(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout) StructureEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart) EditPart(org.eclipse.gef.EditPart)

Aggregations

EditPart (org.eclipse.gef.EditPart)2 StructureEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart)2 IStructureFigure (org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure)2 RowLayout (org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout)2