Search in sources :

Example 1 with CompartmentEditPart

use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart in project webtools.sourceediting by eclipse.

the class XSDAttributeDragAndDropCommand method calculateAttributeGroupList.

// Attribute Group related helper method
protected void calculateAttributeGroupList() {
    EditPart editPart = target;
    while (editPart != null) {
        if (editPart instanceof ComplexTypeEditPart) {
            List list = editPart.getChildren();
            for (Iterator i = list.iterator(); i.hasNext(); ) {
                Object child = i.next();
                if (child instanceof CompartmentEditPart) {
                    List compartmentList = ((CompartmentEditPart) child).getChildren();
                    for (Iterator it = compartmentList.iterator(); it.hasNext(); ) {
                        Object obj = it.next();
                        if (obj instanceof XSDAttributesForAnnotationEditPart) {
                            XSDAttributesForAnnotationEditPart groups = (XSDAttributesForAnnotationEditPart) obj;
                            List groupList = groups.getChildren();
                            for (Iterator iter = groupList.iterator(); iter.hasNext(); ) {
                                Object groupChild = iter.next();
                                if (groupChild instanceof TargetConnectionSpacingFigureEditPart) {
                                    targetSpacesList.add(groupChild);
                                } else if (groupChild instanceof AttributeGroupDefinitionEditPart) {
                                    getAttributeGroupEditParts((AttributeGroupDefinitionEditPart) groupChild);
                                }
                            }
                        }
                    }
                }
            }
        }
        editPart = editPart.getParent();
    }
}
Also used : ComplexTypeEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ComplexTypeEditPart) AttributeGroupDefinitionEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.AttributeGroupDefinitionEditPart) TargetConnectionSpacingFigureEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart) XSDBaseFieldEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart) ComplexTypeEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ComplexTypeEditPart) CompartmentEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) BaseFieldEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart) AttributeGroupDefinitionEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.AttributeGroupDefinitionEditPart) EditPart(org.eclipse.gef.EditPart) XSDAttributesForAnnotationEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.XSDAttributesForAnnotationEditPart) Iterator(java.util.Iterator) CompartmentEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart) ArrayList(java.util.ArrayList) List(java.util.List) TargetConnectionSpacingFigureEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart) XSDAttributesForAnnotationEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.XSDAttributesForAnnotationEditPart)

Aggregations

ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 EditPart (org.eclipse.gef.EditPart)1 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)1 BaseFieldEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart)1 CompartmentEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart)1 ComplexTypeEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ComplexTypeEditPart)1 AttributeGroupDefinitionEditPart (org.eclipse.wst.xsd.ui.internal.design.editparts.AttributeGroupDefinitionEditPart)1 TargetConnectionSpacingFigureEditPart (org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart)1 XSDAttributesForAnnotationEditPart (org.eclipse.wst.xsd.ui.internal.design.editparts.XSDAttributesForAnnotationEditPart)1 XSDBaseFieldEditPart (org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart)1