use of org.eclipse.xsd.XSDTypeDefinition in project webtools.sourceediting by eclipse.
the class XSDSchemaAdapter method getTypes.
public List getTypes() {
if (types == null) {
types = new ArrayList();
XSDSchema schema = (XSDSchema) target;
List concreteComponentList = new ArrayList();
for (Iterator i = schema.getContents().iterator(); i.hasNext(); ) {
XSDConcreteComponent component = (XSDConcreteComponent) i.next();
if (component instanceof XSDTypeDefinition) {
concreteComponentList.add(component);
}
}
populateAdapterList(concreteComponentList, types);
}
return types;
}
use of org.eclipse.xsd.XSDTypeDefinition in project webtools.sourceediting by eclipse.
the class XSDSchemaAdapter method getComplexTypes.
/**
* @param schema
* @return
*/
public List getComplexTypes(XSDSchema schema, boolean showFromIncludes) {
List allTypes = schema.getTypeDefinitions();
List list = new ArrayList();
for (Iterator i = allTypes.iterator(); i.hasNext(); ) {
XSDTypeDefinition td = (XSDTypeDefinition) i.next();
if (td instanceof XSDComplexTypeDefinition) {
XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) td;
if (shouldShowComponent(ct, schema, showFromIncludes)) {
list.add(ct);
}
}
}
List adapterList = new ArrayList();
populateAdapterList(list, adapterList);
return adapterList;
}
use of org.eclipse.xsd.XSDTypeDefinition in project webtools.sourceediting by eclipse.
the class XSDSchemaAdapter method getSimpleTypes.
public List getSimpleTypes(XSDSchema schema, boolean showFromIncludes) {
List allTypes = schema.getTypeDefinitions();
List list = new ArrayList();
for (Iterator i = allTypes.iterator(); i.hasNext(); ) {
XSDTypeDefinition td = (XSDTypeDefinition) i.next();
if (td instanceof XSDSimpleTypeDefinition) {
XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) td;
if (shouldShowComponent(st, schema, showFromIncludes)) {
list.add(st);
}
}
}
List adapterList = new ArrayList();
populateAdapterList(list, adapterList);
return adapterList;
}
use of org.eclipse.xsd.XSDTypeDefinition in project webtools.sourceediting by eclipse.
the class UpdateComplexTypeDerivationBy method execute.
public void execute() {
super.execute();
try {
beginRecording(complexType.getElement());
XSDTypeDefinition originalBaseType = complexType.getBaseType();
if (derivation.equals(XSDConstants.EXTENSION_ELEMENT_TAG)) {
complexType.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL);
} else if (derivation.equals(XSDConstants.RESTRICTION_ELEMENT_TAG)) {
complexType.setDerivationMethod(XSDDerivationMethod.RESTRICTION_LITERAL);
}
complexType.setBaseTypeDefinition(originalBaseType);
} finally {
endRecording();
}
}
use of org.eclipse.xsd.XSDTypeDefinition in project webtools.sourceediting by eclipse.
the class UpdateTypeReferenceAndManageDirectivesCommand method execute.
public void execute() {
try {
beginRecording(concreteComponent.getElement());
XSDComponent td = computeComponent();
if (td != null && td instanceof XSDTypeDefinition) {
UpdateTypeReferenceCommand command = new UpdateTypeReferenceCommand(concreteComponent, (XSDTypeDefinition) td);
command.execute();
XSDDirectivesManager.removeUnusedXSDImports(concreteComponent.getSchema());
}
} catch (Exception e) {
} finally {
endRecording();
}
}
Aggregations