Package org.eclipse.wst.xml.core.internal.provisional.document

Examples of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument


          selectedVersions.remove(selectedNamespaceDefinition);
        }

        if (getMasterPart() instanceof NamespacesMasterPart) {
          StructuredTextViewer textView = getConfigEditor().getTextViewer();
          IDOMDocument doc = getConfigEditor().getDomDocument();
          doc.getModel().beginRecording(textView);

          NamespacesMasterPart namespaceMaster = (NamespacesMasterPart) getMasterPart();
          namespaceMaster.updateXsdVersion();
          doc.getModel().endRecording(textView);
        }
      }
    });
  }
View Full Code Here


        if (model == null) {
          model = StructuredModelManager.getModelManager()
              .getModelForRead(file);
        }
        if (model != null) {
          IDOMDocument document = ((DOMModelImpl) model)
              .getDocument();
          if (document != null
              && document.getDocumentElement() != null) {
            String namespaceUri = document.getDocumentElement()
                .getNamespaceURI();
            if (applyNamespaceFilter(file, namespaceUri)) {
              detectedFiles.add(file);
            }
          }
View Full Code Here

  }

  @Override
  protected void createNewElement() {
    if (parentElement != null) {
      IDOMDocument document = (IDOMDocument) parentElement.getOwnerDocument();
      IDOMElement childElement = (IDOMElement) document.createElement(inputName);
      IDOMModel model = document.getModel();
      if (model != null) {
        model.beginRecording(this);
        parentElement.appendChild(childElement);
        processor.insertDefaultAttributes(childElement);
        id = IntegrationSchemaConstants.ELEM_CHANNEL
View Full Code Here

  }

  protected void addXsdDefinition(INamespaceDefinition definition) {
    if (!existsInConfiguration(definition)) {
      StructuredTextViewer textView = getConfigEditor().getTextViewer();
      IDOMDocument doc = getConfigEditor().getDomDocument();
      doc.getModel().beginRecording(textView);

      if (rootElement == null) {
        // Create a beans element and add the default namespace
        rootElement = doc.createElement(BeansSchemaConstants.ELEM_BEANS);
        doc.appendChild(rootElement);

        INamespaceDefinition defNamespace = NamespaceUtils.getDefaultNamespaceDefinition();
        if (defNamespace != null) {
          if (!xsdViewer.getChecked(defNamespace)) {
            xsdViewer.setChecked(defNamespace, true);
          }
          rootElement.setAttribute(ConfigCoreUtils.ATTR_DEFAULT_NAMESPACE, defNamespace.getNamespaceURI());
        }
        rootElement.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$ //$NON-NLS-2$
      }

      // Check again so we don't add the default namespace twice
      if (!existsInConfiguration(definition)) {
        rootElement.setAttribute(
            ConfigCoreUtils.ATTR_NAMESPACE_PREFIX
                + definition.getNamespacePrefix(getConfigEditor().getResourceFile()),
            definition.getNamespaceURI());
      }

      selectedNamespaces.add(definition);
      updateXsdVersion();
      doc.getModel().endRecording(textView);
    }
  }
View Full Code Here

  }

  protected void removeXsdDefinition(INamespaceDefinition definition) {
    if (existsInConfiguration(definition)) {
      StructuredTextViewer textView = getConfigEditor().getTextViewer();
      IDOMDocument doc = getConfigEditor().getDomDocument();
      doc.getModel().beginRecording(textView);

      rootElement.removeAttribute(ConfigCoreUtils.ATTR_NAMESPACE_PREFIX
          + definition.getNamespacePrefix(getConfigEditor().getResourceFile()));
      Attr attr = rootElement.getAttributeNode(ConfigCoreUtils.ATTR_DEFAULT_NAMESPACE);
      if (attr != null && attr.getNodeValue().equals(definition.getNamespaceURI())) {
        rootElement.removeAttributeNode(attr);
      }
      selectedNamespaces.remove(definition);
      updateXsdVersion();
      doc.getModel().endRecording(textView);
    }
  }
View Full Code Here

    try {
      IStructuredModel model = domDocument.getModel();
      IModelManager modelManager = model.getModelManager();
      copiedModel = (IDOMModel) modelManager.createNewInstance(model);
      IDOMDocument copiedDocument = copiedModel.getDocument();
      createInput(copiedDocument);
    }
    catch (IOException e) {
      StatusHandler.log(new Status(IStatus.ERROR, ConfigUiPlugin.PLUGIN_ID, Messages
          .getString("AbstractConfigWizard.ERROR_INITIALIZING_WIZARD"), e)); //$NON-NLS-1$
View Full Code Here

  }

  @Override
  public void execute() {
    if (targetAnchor != null) {
      IDOMDocument document = (IDOMDocument) transitionAttr.getOwnerDocument();
      IDOMModel model = document.getModel();
      model.beginRecording(this);
      oldTargetElement.removeAttribute(transitionAttr.getName());
      targetElement.setAttribute(attr, id);
      model.endRecording(this);
    }
View Full Code Here

  }

  @Override
  public void execute() {
    if (sourceAnchor != null) {
      IDOMDocument document = (IDOMDocument) transitionAttr.getOwnerDocument();
      IDOMModel model = document.getModel();
      model.beginRecording(this);
      oldSourceElement.removeAttribute(transitionAttr.getName());
      sourceElement.setAttribute(attr, id);
      model.endRecording(this);
    }
View Full Code Here

  }

  private Set<OccurrenceLocation> findBeanReference(String beanName, BeansValidationContext context)
      throws BadLocationException {
    Set<OccurrenceLocation> result = new HashSet<OccurrenceLocation>();
    IDOMDocument document = editor.getDomDocument();
    if (document != null) {
      NodeList nodes = document.getDocumentElement().getChildNodes();
      for (int i = 0; i < nodes.getLength(); i++) {
        result.addAll(findBeanReference(beanName, nodes.item(i), context));
      }
    }
    return result;
View Full Code Here

    return false;
  }

  @Override
  public void execute() {
    IDOMDocument document = (IDOMDocument) sourceElement.getOwnerDocument();
    IDOMModel model = document.getModel();
    if (model != null) {
      model.beginRecording(this);
      IDOMElement transition = (IDOMElement) document.createElement(WebFlowSchemaConstants.ELEM_TRANSITION);
      transition.setPrefix(ConfigCoreUtils.getPrefixForNamespaceUri(document, WebFlowSchemaConstants.URI));
      sourceElement.appendChild(transition);
      processor.insertDefaultAttributes(transition);
      formatter.formatNode(transition);
      formatter.formatNode(sourceElement);
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.