Search in sources :

Example 6 with IComponentList

use of org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList in project webtools.sourceediting by eclipse.

the class AddXSDRedefinedComplexTypeAction method buildComponentsList.

protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList) {
    List typeDefinitions = xsdRedefine.getIncorporatedSchema().getTypeDefinitions();
    Iterator iterator = typeDefinitions.iterator();
    while (iterator.hasNext()) {
        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) iterator.next();
        String typeDefinitionName = typeDefinition.getName();
        if (typeDefinition instanceof XSDComplexTypeDefinition && !redefinedComponentsNames.contains(typeDefinitionName)) {
            componentList.add(typeDefinition);
        }
    }
}
Also used : Iterator(java.util.Iterator) List(java.util.List) IComponentList(org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList) XSDComplexTypeDefinition(org.eclipse.xsd.XSDComplexTypeDefinition) XSDTypeDefinition(org.eclipse.xsd.XSDTypeDefinition)

Example 7 with IComponentList

use of org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList in project webtools.sourceediting by eclipse.

the class AddXSDRedefinedSimpleTypeAction method buildComponentsList.

protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList) {
    List typeDefinitions = xsdRedefine.getIncorporatedSchema().getTypeDefinitions();
    Iterator iterator = typeDefinitions.iterator();
    while (iterator.hasNext()) {
        XSDTypeDefinition typeDefinition = (XSDTypeDefinition) iterator.next();
        String typeDefinitionName = typeDefinition.getName();
        if (typeDefinition instanceof XSDSimpleTypeDefinition && !redefinedComponentsNames.contains(typeDefinitionName)) {
            componentList.add(typeDefinition);
        }
    }
}
Also used : XSDSimpleTypeDefinition(org.eclipse.xsd.XSDSimpleTypeDefinition) Iterator(java.util.Iterator) List(java.util.List) IComponentList(org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList) XSDTypeDefinition(org.eclipse.xsd.XSDTypeDefinition)

Aggregations

List (java.util.List)7 IComponentList (org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList)7 Iterator (java.util.Iterator)5 ArrayList (java.util.ArrayList)3 XSDSchema (org.eclipse.xsd.XSDSchema)3 XSDTypeDefinition (org.eclipse.xsd.XSDTypeDefinition)3 QualifiedName (org.eclipse.wst.common.core.search.pattern.QualifiedName)1 XSDAttributeGroupDefinition (org.eclipse.xsd.XSDAttributeGroupDefinition)1 XSDComplexTypeDefinition (org.eclipse.xsd.XSDComplexTypeDefinition)1 XSDModelGroupDefinition (org.eclipse.xsd.XSDModelGroupDefinition)1 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)1