Search in sources :

Example 1 with ModelGroupDefinitionReferenceEditPart

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

the class XSDElementDragAndDropCommand method getModelGroupEditParts.

// Model Group related helper method
protected List getModelGroupEditParts(ModelGroupEditPart modelGroupEditPart) {
    List modelGroupList = new ArrayList();
    List list = modelGroupEditPart.getChildren();
    for (Iterator i = list.iterator(); i.hasNext(); ) {
        Object object = i.next();
        if (object instanceof TargetConnectionSpacingFigureEditPart) {
            targetSpacesList.add(object);
        } else if (object instanceof ModelGroupDefinitionReferenceEditPart) {
            ModelGroupDefinitionReferenceEditPart groupRef = (ModelGroupDefinitionReferenceEditPart) object;
            List groupRefChildren = groupRef.getChildren();
            for (Iterator it = groupRefChildren.iterator(); it.hasNext(); ) {
                Object o = it.next();
                if (o instanceof ModelGroupEditPart) {
                    getModelGroupEditParts((ModelGroupEditPart) o);
                }
            }
        } else if (object instanceof ModelGroupEditPart) {
            getModelGroupEditParts((ModelGroupEditPart) object);
        }
    }
    return modelGroupList;
}
Also used : ModelGroupDefinitionReferenceEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.ModelGroupDefinitionReferenceEditPart) ModelGroupEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.ModelGroupEditPart) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) TargetConnectionSpacingFigureEditPart(org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart)

Aggregations

ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 ModelGroupDefinitionReferenceEditPart (org.eclipse.wst.xsd.ui.internal.design.editparts.ModelGroupDefinitionReferenceEditPart)1 ModelGroupEditPart (org.eclipse.wst.xsd.ui.internal.design.editparts.ModelGroupEditPart)1 TargetConnectionSpacingFigureEditPart (org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart)1