Search in sources :

Example 16 with IField

use of org.eclipse.wst.xsd.ui.internal.adt.facade.IField 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

IField (org.eclipse.wst.xsd.ui.internal.adt.facade.IField)16 IType (org.eclipse.wst.xsd.ui.internal.adt.facade.IType)6 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)4 IFieldFigure (org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure)4 IStructure (org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure)4 ArrayList (java.util.ArrayList)3 IADTObject (org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject)3 List (java.util.List)2 IFigure (org.eclipse.draw2d.IFigure)2 EditPart (org.eclipse.gef.EditPart)2 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)2 ElementReferenceDirectEditManager (org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ElementReferenceDirectEditManager)2 LabelCellEditorLocator (org.eclipse.wst.xsd.ui.internal.adt.design.directedit.LabelCellEditorLocator)2 LabelEditManager (org.eclipse.wst.xsd.ui.internal.adt.design.directedit.LabelEditManager)2 Annotation (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation)2 IGraphElement (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement)2 IModel (org.eclipse.wst.xsd.ui.internal.adt.facade.IModel)2 Iterator (java.util.Iterator)1 Label (org.eclipse.draw2d.Label)1 Point (org.eclipse.draw2d.geometry.Point)1