xsd.updateElement(); return xsd;
schemaElement.setAttribute("xmlns", namespaceText.getText()); xsdSchema.updateElement(); setErrorMessage(null); oldPrefixValue = newPrefix;
protected static void ensureSchemaElement(XSDSchema schema) { Document document = schema.getDocument(); Element schemaElement = document.getDocumentElement(); if (schemaElement == null) { String targetNamespace = getDefaultNamespace(schema); schema.setTargetNamespace(targetNamespace); Map qNamePrefixToNamespaceMap = schema.getQNamePrefixToNamespaceMap(); qNamePrefixToNamespaceMap.put("tns", targetNamespace); if (XSDEditorPlugin.getDefault().isQualifyXMLSchemaLanguage()) { String prefix = XSDEditorPlugin.getDefault().getXMLSchemaPrefix(); schema.setSchemaForSchemaQNamePrefix(prefix); qNamePrefixToNamespaceMap.put(prefix, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); } else { qNamePrefixToNamespaceMap.put(null, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); } schema.updateElement(); ensureXMLDirective(document); } }
protected void doSave(Writer writer, Map<?, ?> options) throws IOException { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { Document document = xsdSchema.getDocument(); if (document == null) { xsdSchema.updateDocument(); document = xsdSchema.getDocument(); } if (xsdSchema.getElement() == null) { xsdSchema.updateElement(); } doSerialize(writer, document, options); } }
protected void doSave(Writer writer, Map<?, ?> options) throws IOException { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { Document document = xsdSchema.getDocument(); if (document == null) { xsdSchema.updateDocument(); document = xsdSchema.getDocument(); } if (xsdSchema.getElement() == null) { xsdSchema.updateElement(); } doSerialize(writer, document, options); } }
protected void doWrite( FeatureTypeInfo[] featureTypeInfos, OutputStream output, Operation describeFeatureType) throws IOException { // create the schema Object request = describeFeatureType.getParameters()[0]; DescribeFeatureTypeRequest req = DescribeFeatureTypeRequest.adapt(request); XSDSchema schema = schemaBuilder.build(featureTypeInfos, req.getBaseURL()); // serialize schema.updateElement(); final String encoding = gs.getSettings().getCharset(); XSDResourceImpl.serialize(output, schema.getElement(), encoding); }
public void run(){ if(fSelectedComponent == null){ return; } if(fSelectedComponent.getSchema() == null){ getSchema().updateElement(true); } DocumentImpl doc = (DocumentImpl) fSelectedComponent.getElement().getOwnerDocument(); doc.getModel().beginRecording( this, RefactoringWizardMessages.MakeAnonymousTypeGlobalAction_text); MakeAnonymousTypeGlobalCommand command = new MakeAnonymousTypeGlobalCommand( fSelectedComponent, getNewDefaultName()); command.run(); doc.getModel().endRecording(this); }
private void buildSchemaContent( FeatureTypeInfo featureTypeMeta, XSDSchema schema, XSDFactory factory, String baseUrl) throws IOException { if (!findTypeInSchema(featureTypeMeta, schema, factory)) { // build the type manually FeatureType featureType = featureTypeMeta.getFeatureType(); if (featureTypeMeta.isCircularArcPresent() && this.getClass().equals(GML3.class)) { featureType = new CurveTypeWrapper(featureType); } XSDComplexTypeDefinition xsdComplexType = buildComplexSchemaContent(featureType, schema, factory); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(featureTypeMeta.getName()); element.setTargetNamespace(featureTypeMeta.getNamespace().getURI()); synchronized (Schemas.class) { // this call changes the global schemas too, need to be synchronized element.setSubstitutionGroupAffiliation(getFeatureElement()); } element.setTypeDefinition(xsdComplexType); schema.getContents().add(element); schema.updateElement(); } }
@Override protected void doSave(OutputStream os, Map<?, ?> options) throws IOException { if (os instanceof URIConverter.WriteableOutputStream) { doSave(((URIConverter.WriteableOutputStream)os).asWriter(), options); } else { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { Document document = xsdSchema.getDocument(); if (document == null) { xsdSchema.updateDocument(); document = xsdSchema.getDocument(); } if (xsdSchema.getElement() == null) { xsdSchema.updateElement(); } doSerialize(os, document, options); } } }
@Override protected void doSave(OutputStream os, Map<?, ?> options) throws IOException { if (os instanceof URIConverter.WriteableOutputStream) { doSave(((URIConverter.WriteableOutputStream)os).asWriter(), options); } else { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { Document document = xsdSchema.getDocument(); if (document == null) { xsdSchema.updateDocument(); document = xsdSchema.getDocument(); } if (xsdSchema.getElement() == null) { xsdSchema.updateElement(); } doSerialize(os, document, options); } } }
public void run1() { if(fSelectedComponent == null){ return; } if(fSelectedComponent.getSchema() == null){ getSchema().updateElement(true); } MakeTypeGlobalProcessor processor = new MakeTypeGlobalProcessor(fSelectedComponent, getNewDefaultName()); RenameRefactoring refactoring = new RenameRefactoring(processor); try { RefactoringWizard wizard = new RenameRefactoringWizard( refactoring, RefactoringWizardMessages.RenameComponentWizard_defaultPageTitle, // TODO: provide correct strings RefactoringWizardMessages.RenameComponentWizard_inputPage_description, null); RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard); op.run(XSDEditorPlugin.getShell(), wizard.getDefaultPageTitle()); //triggerBuild(); } catch (InterruptedException e) { // do nothing. User action got cancelled } }
schema.updateElement(); schema.updateElement();
xsdSchema.updateElement();
xsdSchema.updateElement();
getSchema().updateElement(true);
container.getSchema().updateElement(true); formatChild(elementDecl.getElement());