Examples of IModelManager


Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

    }

    private IStructuredModel createModel(String contentTypeID)
    {

        IModelManager manager = StructuredModelManager.getModelManager();
        return manager.createUnManagedStructuredModelFor(contentTypeID);

    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

      beansElement.appendChild(childNodeCopies.get(i));
    }
  }

  private Element getBeansXmlElement(IFile xmlConfigFile) throws CoreException {
    IModelManager modelManager = StructuredModelManager.getModelManager();
    try {
      model = modelManager.getModelForEdit(xmlConfigFile);
    }
    catch (CoreException e) {
      throw new CoreException(new Status(Status.ERROR, ConfigUiPlugin.PLUGIN_ID,
          "Could not open model for editing"));
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

    if (viewer == null)
      return null;

    IndexedRegion node = null;
    IModelManager mm = StructuredModelManager.getModelManager();
    IStructuredModel model = null;
    if (mm != null)
      model = mm.getExistingModelForRead(viewer.getDocument());
    try {
      if (model != null) {
        int lastOffset = documentOffset;
        node = model.getIndexedRegion(documentOffset);
        while (node == null && lastOffset >= 0) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

    this.domDocument = domDocument;
    this.namespaceUri = namespaceUri;

    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
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

   * Returns an instance of the model manager. You *must* call
   * {@link IStructuredModel#releaseFromEdit()} on the instance when you are
   * done with it.
   */
  public static IStructuredModel getModel(IMarker marker) throws CoreException {
    IModelManager modelManager = StructuredModelManager.getModelManager();

    try {
      return modelManager.getModelForEdit((IFile) marker.getResource());
    }
    catch (IOException e) {
      throw new CoreException(new Status(Status.ERROR, BestPracticesPluginConstants.PLUGIN_ID,
          "Could not create model for resource", e));
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

    this(Messages.getString("ModifyBeanWizard.TITLE")); //$NON-NLS-1$
    this.beanFile = beanFile;
    this.existingBean = existingNode;
    this.fileBrowsingEnabled = false;

    IModelManager modelManager = StructuredModelManager.getModelManager();
    DOMModelImpl modelForRead = null;
    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) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

    DOMModelImpl model = null;
    try {
      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;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

    return true;
  }

  public void setBeanFile(IFile beanFile) {
    this.beanFile = beanFile;
    IModelManager modelManager = StructuredModelManager.getModelManager();
    DOMModelImpl modelForRead = null;

    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);
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

          if (resource instanceof IFile) {
            selectedFile = (IFile) resource;
            int startLine = bean.getElementStartLine() - 1;
            int endLine = bean.getElementEndLine();

            IModelManager modelManager = StructuredModelManager.getModelManager();
            DOMModelImpl modelForRead = null;
            try {
              modelForRead = (DOMModelImpl) modelManager.getModelForRead(selectedFile);
              IStructuredDocument document = modelForRead.getStructuredDocument();
              int startOffset = document.getLineOffset(startLine);
              int endOffset = document.getLineOffset(endLine);

              if (startOffset == endOffset) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IModelManager

    return null;
  }

  private IndexedRegion getNode(IDocument document, int documentOffset) {
    IndexedRegion node = null;
    IModelManager mm = StructuredModelManager.getModelManager();
    IStructuredModel model = null;
    if (mm != null)
      model = mm.getExistingModelForRead(document);
    try {
      if (model != null) {
        int lastOffset = documentOffset;
        node = model.getIndexedRegion(documentOffset);
        while (node == null && lastOffset >= 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.