Search in sources :

Example 6 with IStructure

use of org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure in project webtools.sourceediting by eclipse.

the class RootContentEditPart method getModelChildren.

protected List getModelChildren() {
    collections = new ArrayList();
    if (getModel() != null) {
        Object obj = getModel();
        IADTObject focusObject = null;
        if (obj instanceof IStructure) {
            if (obj instanceof IGraphElement) {
                if (((IGraphElement) obj).isFocusAllowed())
                    focusObject = (IStructure) obj;
            }
        } else if (obj instanceof IField) {
            focusObject = (IField) obj;
        } else if (obj instanceof IModel) {
            focusObject = (IModel) obj;
            collections.add(focusObject);
            return collections;
        } else if (obj instanceof IType) {
            if (obj instanceof IGraphElement) {
                if (((IGraphElement) obj).isFocusAllowed()) {
                    focusObject = (IType) obj;
                }
            }
        } else if (obj instanceof IGraphElement) {
            if (((IGraphElement) obj).isFocusAllowed()) {
                focusObject = (IADTObject) obj;
                collections.add(focusObject);
                return collections;
            }
        }
        if (focusObject != null) {
            RootHolder holder = new RootHolder(focusObject);
            collections.add(holder);
            return collections;
        }
    }
    return collections;
}
Also used : IModel(org.eclipse.wst.xsd.ui.internal.adt.facade.IModel) IGraphElement(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement) IADTObject(org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject) ArrayList(java.util.ArrayList) IADTObject(org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject) IStructure(org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure) IField(org.eclipse.wst.xsd.ui.internal.adt.facade.IField) RootHolder(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.RootHolder) IType(org.eclipse.wst.xsd.ui.internal.adt.facade.IType)

Aggregations

IStructure (org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure)6 ArrayList (java.util.ArrayList)4 IField (org.eclipse.wst.xsd.ui.internal.adt.facade.IField)4 List (java.util.List)3 IType (org.eclipse.wst.xsd.ui.internal.adt.facade.IType)3 Iterator (java.util.Iterator)2 IGraphElement (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement)2 IADTObject (org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject)2 IModel (org.eclipse.wst.xsd.ui.internal.adt.facade.IModel)2 EditPart (org.eclipse.gef.EditPart)1 ISelection (org.eclipse.jface.viewers.ISelection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 RedefineCategoryAdapter (org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter)1 XSDComplexTypeDefinitionAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter)1 XSDModelGroupDefinitionAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter)1 XSDRedefineAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter)1 IHolderEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.IHolderEditPart)1 RootContentEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart)1 StructureEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart)1