use of org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList in project webtools.sourceediting by eclipse.
the class XSDAttributeSearchListProvider method populateComponentList.
public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm) {
// now we traverse the types already defined within the visible schemas
// we do this in addition to the component search since this should execute
// very quickly and there's a good chance the user wants to select a time that's
// already imported/included
// TODO (cs) ensure we don't add duplicates when we proceed to use the search list
//
List visitedSchemas = new ArrayList();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, IXSDSearchConstants.ATTRIBUTE_META_NAME);
visitor.visitSchema(schema, true);
visitedSchemas.addAll(visitor.getVisitedSchemas());
}
// finally we call the search API's to do a potentially slow search
if (scope != null) {
populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas));
}
}
use of org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList in project webtools.sourceediting by eclipse.
the class AddXSDRedefinedAttributeGroupAction method buildComponentsList.
protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList) {
List attributeGroups = xsdRedefine.getIncorporatedSchema().getAttributeGroupDefinitions();
Iterator iterator = attributeGroups.iterator();
while (iterator.hasNext()) {
XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) iterator.next();
String attributeGroupDefinitionName = attributeGroupDefinition.getName();
if (!redefinedComponentsNames.contains(attributeGroupDefinitionName)) {
componentList.add(attributeGroupDefinition);
}
}
}
use of org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList in project webtools.sourceediting by eclipse.
the class XSDTypesSearchListProvider method populateComponentList.
public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm) {
// first we add the 'built in' types
//
XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext(); ) {
XSDTypeDefinition td = (XSDTypeDefinition) i.next();
if (builtInFilter == null || !builtInFilter.shouldFilterOut(td)) {
list.add(td);
}
}
// now we traverse the types already defined within the visible schemas
// we do this in addition to the component search since this should execute
// very quickly and there's a good chance the user wants to select a time
// that's
// already imported/included
// TODO (cs) ensure we don't add duplicates when we proceed to use the
// search list
//
List visitedSchemas = new ArrayList();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
QualifiedName kind = showComplexTypes ? IXSDSearchConstants.TYPE_META_NAME : IXSDSearchConstants.SIMPLE_TYPE_META_NAME;
ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, kind);
visitor.visitSchema(schema, true);
visitedSchemas.addAll(visitor.getVisitedSchemas());
}
//
if (scope != null) {
populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas));
}
}
use of org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList in project webtools.sourceediting by eclipse.
the class XSDElementsSearchListProvider method populateComponentList.
public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm) {
// now we traverse the types already defined within the visible schemas
// we do this in addition to the component search since this should execute
// very quickly and there's a good chance the user wants to select a time that's
// already imported/included
// TODO (cs) ensure we don't add duplicates when we proceed to use the search list
//
List visitedSchemas = new ArrayList();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, IXSDSearchConstants.ELEMENT_META_NAME);
visitor.visitSchema(schema, true);
visitedSchemas.addAll(visitor.getVisitedSchemas());
}
// finally we call the search API's to do a potentially slow search
if (scope != null) {
populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas));
}
}
use of org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList in project webtools.sourceediting by eclipse.
the class AddXSDRedefinedModelGroupAction method buildComponentsList.
protected void buildComponentsList(XSDRedefine xsdRedefine, Set redefinedComponentsNames, IComponentList componentList) {
List modelGroupList = xsdRedefine.getIncorporatedSchema().getModelGroupDefinitions();
Iterator iterator = modelGroupList.iterator();
while (iterator.hasNext()) {
XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) iterator.next();
String modelGroupDefinitionName = modelGroupDefinition.getName();
if (!redefinedComponentsNames.contains(modelGroupDefinitionName)) {
componentList.add(modelGroupDefinition);
}
}
}
Aggregations