Package org.eclipse.php.internal.core.documentModel

Examples of org.eclipse.php.internal.core.documentModel.DOMModelForPHP


      IStructuredModel structuredModel = null;
      structuredModel = modelManager.getExistingModelForRead(viewer
          .getDocument());
      if (structuredModel != null) {
        try {
          DOMModelForPHP domModelForPHP = (DOMModelForPHP) structuredModel;
          try {
            // Find the structured document region:
            IStructuredDocument document = (IStructuredDocument) domModelForPHP
                .getDocument().getStructuredDocument();
            IStructuredDocumentRegion sdRegion = document
                .getRegionAtCharacterOffset(offset);
            if (sdRegion == null) { // empty file case
              return false;
View Full Code Here


      IStructuredModel structuredModel = null;
      structuredModel = modelManager.getExistingModelForRead(viewer
          .getDocument());
      if (structuredModel != null) {
        try {
          DOMModelForPHP domModelForPHP = (DOMModelForPHP) structuredModel;
          try {
            // Find the structured document region:
            IStructuredDocument document = (IStructuredDocument) domModelForPHP
                .getDocument().getStructuredDocument();
            IStructuredDocumentRegion sdRegion = document
                .getRegionAtCharacterOffset(offset);
            if (sdRegion == null) { // empty file case
              return false;
View Full Code Here

    try {
      if (document instanceof IStructuredDocument) {
        IStructuredDocument structuredDocument = (IStructuredDocument) document;
        structuredModel = StructuredModelManager.getModelManager()
            .getExistingModelForRead(document);
        DOMModelForPHP doModelForPHP = (DOMModelForPHP) structuredModel;

        IProject project = this.project;
        if (doModelForPHP != null) {
          project = getProject(doModelForPHP);
        }
View Full Code Here

    IStructuredModel structuredModel = null;
    if (document instanceof IStructuredDocument) {
      try {
        structuredModel = StructuredModelManager.getModelManager()
            .getExistingModelForRead(document);
        DOMModelForPHP doModelForPHP = (DOMModelForPHP) structuredModel;
        project = getProject(doModelForPHP);
      } finally {
        if (structuredModel != null) {
          structuredModel.releaseFromRead();
        }
View Full Code Here

    try {
      if (document instanceof IStructuredDocument) {
        IStructuredDocument structuredDocument = (IStructuredDocument) document;
        structuredModel = StructuredModelManager.getModelManager()
            .getExistingModelForRead(document);
        DOMModelForPHP doModelForPHP = (DOMModelForPHP) structuredModel;

        IProject project = this.project;
        if (doModelForPHP != null) {
          project = getProject(doModelForPHP);
        }
View Full Code Here

            return preferences;
          } catch (Exception e) {
          }
          return null;
        }
        DOMModelForPHP doModelForPHP = (DOMModelForPHP) structuredModel;

        IProject project = getProject(doModelForPHP);
        if (project == null) {
          Logger.logException(new IllegalStateException(
              "Cann't resolve file name")); //$NON-NLS-1$
View Full Code Here

    IStructuredModel structuredModel = null;
    try {
      IProject project = null;
      structuredModel = StructuredModelManager.getModelManager()
          .getExistingModelForRead(document);
      DOMModelForPHP doModelForPHP = (DOMModelForPHP) structuredModel;
      project = getProject(doModelForPHP);
      newline = PHPModelUtils.getLineSeparator(project);
    } catch (Exception e) {
      PHPUiPlugin.log(e);
    } finally {
View Full Code Here

    return useTab;
  }

  private boolean verifyValidity(IDocument document) {
    if (fLastDocument != document) {
      DOMModelForPHP editorModel = null;
      try {
        editorModel = (DOMModelForPHP) StructuredModelManager
            .getModelManager().getExistingModelForRead(document);

        // The PHPMergeViewer can be used outside Editor.
        // E.g. the preview page.
        // In those cases, the editroModel is null.
        // Do the check and return in null case.
        if (editorModel == null) {
          return false;
        }

        String baseLocation = editorModel.getBaseLocation();
        // The baseLocation may be a path on disk or relative to the
        // workspace root. Don't translate on-disk paths to
        // in-workspace resources.
        IPath basePath = new Path(baseLocation);
        IFile file = null;
        if (basePath.segmentCount() > 1) {
          file = ResourcesPlugin.getWorkspace().getRoot()
              .getFile(basePath);
          if (!file.exists()) {
            file = null;
          }
        }
        if (file == null) {
          return false;
        }

        IProject project = file.getProject();
        if (fLastProject != project) {
          fLastProject = project;
          verifyListening();
        }
      } finally {
        if (editorModel != null)
          editorModel.releaseFromRead();
      }
    }

    if (fLastDocument != document || preferencesChanged) {
      String useTab = preferencesSupport.getPreferencesValue(
View Full Code Here

    return super.getAdapterFactories();
  }

  // Creating the PHPModel
  public IStructuredModel newModel() {
    return new DOMModelForPHP();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.documentModel.DOMModelForPHP

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.