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

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


      }

      IFile file = (IFile) marker.getResource();
      model = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead(file);
      if (model != null) {
        IDOMDocument document = model.getDocument();
        if (document != null) {
          NodeList nodes = document.getChildNodes();
          IDOMNode node = findMatchedBean(nodes, beanName);
          return findNodeInfo(node, attrName, attrValue);
        }
      }
    }
View Full Code Here


    try {
      modelForRead = (DOMModelImpl) modelManager.getModelForRead(beanFile);
      originalDocument = modelForRead.getDocument();

      DOMModelImpl copiedModel = (DOMModelImpl) modelManager.createNewInstance(modelForRead);
      IDOMDocument copiedDocument = copiedModel.getDocument();

      newBean = (IDOMElement) copiedDocument.importNode(existingNode, true);
    }
    catch (IOException e) {
      StatusHandler.log(new Status(IStatus.ERROR, WizardPlugin.PLUGIN_ID, "Failed to create bean node.", e));
    }
    catch (CoreException e) {
View Full Code Here

      IEditorPart editor = IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),
          beanFile);

      IModelManager modelManager = StructuredModelManager.getModelManager();
      model = (DOMModelImpl) modelManager.getModelForEdit(beanFile);
      IDOMDocument document = model.getDocument();

      model.beginRecording(this);

      Node nextSibling = null;
      IDOMElement parentNode;

      if (existingBean != null) {
        nextSibling = existingBean.getNextSibling();
        parentNode = (IDOMElement) existingBean.getParentNode();
        parentNode.removeChild(existingBean);
      }
      else {
        parentNode = (IDOMElement) document.getDocumentElement();
      }

      IDOMElement bean = (IDOMElement) document.importNode(newBean, true);
      if (nextSibling != null) {
        parentNode.insertBefore(bean, nextSibling);
      }
      else {
        parentNode.appendChild(bean);
View Full Code Here

    try {
      modelForRead = (DOMModelImpl) modelManager.getModelForRead(beanFile);
      originalDocument = modelForRead.getDocument();

      DOMModelImpl copiedModel = (DOMModelImpl) modelManager.createNewInstance(modelForRead);
      IDOMDocument copiedDocument = copiedModel.getDocument();

      newBean = (IDOMElement) copiedDocument.createElementNS(NamespaceUtils.DEFAULT_NAMESPACE_URI,
          BeansSchemaConstants.ELEM_BEAN);
    }
    catch (IOException e) {
      StatusHandler.log(new Status(IStatus.ERROR, WizardPlugin.PLUGIN_ID, "Failed to create bean node.", e));
    }
View Full Code Here

    return new OsgiCompendiumMasterPart(page, parent);
  }

  @Override
  public AbstractConfigDetailsPart getDetailsPage(Object key) {
    IDOMDocument doc = getFormPage().getEditor().getDomDocument();
    if (ConfigCoreUtils.getSchemaVersion(doc, OsgiSchemaConstants.URI).compareTo(new Version("2.0")) >= 0) { //$NON-NLS-1$
      return new OsgiCompendiumDetailsPart(getMasterPart(), OsgiMasterDetailsBlock.DOCS_SPRINGOSGI_20);
    }
    else {
      return new OsgiCompendiumDetailsPart(getMasterPart(), OsgiMasterDetailsBlock.DOCS_SPRINGOSGI);
View Full Code Here

  public void doSave(IProgressMonitor monitor) {
    try {
      this.isCurrentlySaving = true;
      model.aboutToChangeModel();
      // reattach root node from document
      IDOMDocument document = ((DOMModelImpl) model).getDocument();
      Node root = document.getDocumentElement();
      document.replaceChild(diagram.getNode(), root);

      formatElement(monitor);
      model.changedModel();
      model.save();
      getCommandStack().markSaveLocation();
View Full Code Here

        try {
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          model.aboutToChangeModel();

          // reattach root node from document
          IDOMDocument document = ((DOMModelImpl) model)
              .getDocument();
          Node root = document.getDocumentElement();
          document.replaceChild(diagram.getNode(), root);

          formatElement(monitor);
          model.changedModel();
          model.save(out);
          file.create(new ByteArrayInputStream(out.toByteArray()),
View Full Code Here

          model = StructuredModelManager.getModelManager()
              .getModelForEdit(this.file);

        }
        if (model != null) {
          IDOMDocument document = ((DOMModelImpl) model)
              .getDocument();
          this.diagram = new WebflowState(webflowEditorInput
              .getConfig());
          IDOMNode root = (IDOMNode) document.getDocumentElement();
          IDOMNode rootClone = (IDOMNode) root.cloneNode(true);
          webflowEditorInput.initLineNumbers(root, rootClone);
          this.diagram
              .init(rootClone, webflowEditorInput.getConfig());
        }
View Full Code Here

      model = StructuredModelManager.getModelManager().getModelForRead(file);

      if (model == null) {
        return null;
      }
      IDOMDocument document = ((DOMModelImpl) model).getDocument();
      MultiTextEdit multiEdit = new MultiTextEdit();
      NodeList nodes = document.getElementsByTagName("bean");
      for (int i = 0; i < nodes.getLength(); i++) {
        Set<TextEdit> edits = createConstructorTextEdits(nodes.item(i), affectedElement, newName, file);
        if (edits != null) {
          multiEdit.addChildren(edits.toArray(new TextEdit[edits.size()]));
        }
View Full Code Here

      model = StructuredModelManager.getModelManager().getModelForRead(file);

      if (model == null) {
        return null;
      }
      IDOMDocument document = ((DOMModelImpl) model).getDocument();
      MultiTextEdit multiEdit = new MultiTextEdit();
      NodeList nodes = document.getElementsByTagName("bean");
      for (int j = 0; j < affectedElements.length; j++) {
        for (int i = 0; i < nodes.getLength(); i++) {
          Set<TextEdit> edits = createMethodTextEdits(nodes.item(i), affectedElements[j], newNames[j], file);
          if (edits != null) {
            multiEdit.addChildren(edits.toArray(new TextEdit[edits.size()]));
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.