use of org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart 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();
}
}
use of org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart in project webtools.sourceediting by eclipse.
the class XSDAttributeDragAndDropCommand method getAttributeGroupEditParts.
// Attribute Group related helper method
protected List getAttributeGroupEditParts(AttributeGroupDefinitionEditPart attributeGroupEditPart) {
List groupList = new ArrayList();
List list = attributeGroupEditPart.getChildren();
for (Iterator i = list.iterator(); i.hasNext(); ) {
Object object = i.next();
if (object instanceof TargetConnectionSpacingFigureEditPart) {
targetSpacesList.add(object);
} else if (object instanceof AttributeGroupDefinitionEditPart) {
AttributeGroupDefinitionEditPart groupRef = (AttributeGroupDefinitionEditPart) object;
List groupRefChildren = groupRef.getChildren();
for (Iterator it = groupRefChildren.iterator(); it.hasNext(); ) {
Object o = it.next();
if (o instanceof TargetConnectionSpacingFigureEditPart) {
targetSpacesList.add(o);
} else if (o instanceof AttributeGroupDefinitionEditPart) {
AttributeGroupDefinitionEditPart aGroup = (AttributeGroupDefinitionEditPart) o;
groupList.add(aGroup);
groupList.addAll(getAttributeGroupEditParts(aGroup));
}
}
}
}
return groupList;
}
use of org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart in project webtools.sourceediting by eclipse.
the class BaseDragAndDropCommand method handleOtherTargets.
protected void handleOtherTargets(int index) {
int in = 0;
ConnectableEditPart previousModelEditPart = null;
for (Iterator i = targetSpacesList.iterator(); i.hasNext(); ) {
Object o = i.next();
previousModelEditPart = parentEditPart;
TargetConnectionSpacingFigureEditPart sp = (TargetConnectionSpacingFigureEditPart) o;
if (sp.getParent() instanceof ConnectableEditPart)
parentEditPart = (ConnectableEditPart) sp.getParent();
else
parentEditPart = null;
in++;
if (in > index) {
if (closerSibling == ABOVE_IS_CLOSER) {
parentEditPart = previousModelEditPart;
}
break;
}
}
}
use of org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart 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;
}
Aggregations