use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation in project webtools.sourceediting by eclipse.
the class XSDGroupsForAnnotationEditPart method getModelChildren.
protected List getModelChildren() {
List xsdModelGroupList = new ArrayList();
List adapterList = new ArrayList();
IStructure structure = ((Annotation) getModel()).getOwner();
if (structure instanceof IComplexType) {
complexType = (IComplexType) structure;
if (complexType instanceof XSDComplexTypeDefinitionAdapter) {
XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter) complexType;
xsdModelGroupList = adapter.getModelGroups();
}
for (Iterator i = xsdModelGroupList.iterator(); i.hasNext(); ) {
Object obj = i.next();
if (obj instanceof XSDModelGroup) {
adapterList.add(XSDAdapterFactory.getInstance().adapt((XSDModelGroup) obj));
} else if (obj instanceof XSDModelGroupDefinition) {
adapterList.add(XSDAdapterFactory.getInstance().adapt((XSDModelGroupDefinition) obj));
}
}
} else if (structure instanceof XSDModelGroupDefinitionAdapter) {
XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter) structure;
XSDModelGroup group = adapter.getXSDModelGroupDefinition().getModelGroup();
if (group != null) {
adapterList.add(XSDAdapterFactory.getInstance().adapt(group));
}
}
return adapterList;
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation in project webtools.sourceediting by eclipse.
the class CompartmentEditPart method removeChildVisual.
protected void removeChildVisual(EditPart childEditPart) {
Object model = childEditPart.getModel();
IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
if (model instanceof IField) {
getCompartmentFigure().getContentPane().remove(child);
return;
} else if (model instanceof Annotation) {
getCompartmentFigure().getAnnotationPane().remove(child);
return;
}
super.removeChildVisual(childEditPart);
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation in project webtools.sourceediting by eclipse.
the class CompartmentEditPart method addChildVisual.
protected void addChildVisual(EditPart childEditPart, int index) {
Object model = childEditPart.getModel();
IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
if (model instanceof IField) {
getCompartmentFigure().getContentPane().add(child, index);
return;
} else if (model instanceof Annotation) {
getCompartmentFigure().getAnnotationPane().add(child);
return;
}
super.addChildVisual(childEditPart, index);
}
Aggregations