Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath.segmentCount()


            // TODO: URI validation?
            if (false && actualValue.indexOf('#') < 0 && actualValue.indexOf(":/") == -1 && CMUtil.isHTML(edec)) { //$NON-NLS-1$ //$NON-NLS-2$
              IStructuredDocumentRegion start = ((IDOMNode) node).getStartStructuredDocumentRegion();
              if (start != null && start.getFirstRegion().getTextLength() == 1) {
                IPath basePath = new Path(((IDOMNode) node).getModel().getBaseLocation());
                if (basePath.segmentCount() > 1) {
                  IPath path = ModuleCoreSupport.resolve(basePath, actualValue);
                  IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
                  if (found == null || !found.isAccessible()) {
                    rgnType = REGION_VALUE;
                    state = ErrorState.RESOURCE_NOT_FOUND;
View Full Code Here


    if (node instanceof IDOMNode) {
      IStructuredModel model = ((IDOMNode) node).getModel();
      String baseLocation = model.getBaseLocation();
      if (!baseLocation.equals(IModelManager.UNMANAGED_MODEL)) {
        IPath path = new Path(baseLocation);
        if (path.segmentCount() > 1) {
          IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
          if (project.isAccessible()) {
            String key = createPreferenceKey(path);
            IEclipsePreferences preferences = new ProjectScope(project).getNode(JSPCorePlugin.getDefault().getBundle().getSymbolicName());
            type = preferences.get(key, DEFAULT_MIMETYPE);
View Full Code Here

   * @return
   */
  IPath getCurrentBaseLocation() {
    IPath baseLocation = null;
    IPath path = getCurrentParserPath();
    if (path == null || path.segmentCount() < 2)
      return path;
    baseLocation = ResourcesPlugin.getWorkspace().getRoot().getFile(path).getLocation();
    if (baseLocation == null) {
      baseLocation = path;
    }
View Full Code Here

        reporter.addMessage(fMessageOriginator, message);
      }
      else if (DeploymentDescriptorPropertyCache.getInstance().getURLMapping(file.getFullPath(), fileValue) == null) {
        IPath testPath = FacetModuleCoreSupport.resolve(file.getFullPath(), fileValue);
        if (testPath.segmentCount() > 1) {
          IFile testFile = file.getWorkspace().getRoot().getFile(testPath);
          addDependsOn(testFile);
          if (!testFile.isAccessible()) {
            if (fSeverityIncludeFileMissing != ValidationMessage.IGNORE) {
              // File not found
View Full Code Here

  private IFile getFile(IStructuredModel model) {
    if (model != null) {
      String location = model.getBaseLocation();
      if (location != null) {
        IPath path = new Path(location);
        if (!path.toFile().exists() && path.segmentCount() > 1) {
          return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
        }
      }
    }
    return null;
View Full Code Here

  private IFile getFile(IStructuredModel model) {
    IFile result = null;
    String location = model.getBaseLocation();
    if (location != null) {
      IPath path = new Path(location);
      if (path.segmentCount() > 1) {
        result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      }
    }
    return result;
  }
View Full Code Here

      if (_dump_NCDFE)
        e.printStackTrace();
    }
    if (result == null) {
      IPath root = getLocalRoot(path);
      result = path.removeFirstSegments(root.segmentCount()).makeAbsolute();
    }
    return result;
  }

  /**
 
View Full Code Here

            // TODO: URI validation?
            if (false && actualValue.indexOf('#') < 0 && actualValue.indexOf(":/") == -1 && CMUtil.isHTML(edec)) { //$NON-NLS-1$ //$NON-NLS-2$
              IStructuredDocumentRegion start = ((IDOMNode) node).getStartStructuredDocumentRegion();
              if (start != null && start.getFirstRegion().getTextLength() == 1) {
                IPath basePath = new Path(((IDOMNode) node).getModel().getBaseLocation());
                if (basePath.segmentCount() > 1) {
                  IPath path = ModuleCoreSupport.resolve(basePath, actualValue);
                  IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
                  if (found == null || !found.isAccessible()) {
                    rgnType = REGION_VALUE;
                    state = ErrorState.RESOURCE_NOT_FOUND;
View Full Code Here

              baseLocation = file.getAbsolutePath();
            }
            else {
              IPath basePath = new Path(model.getBaseLocation());
              IResource derivedResource = null;
              if (basePath.segmentCount() > 1)
                derivedResource = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
              else
                derivedResource = ResourcesPlugin.getWorkspace().getRoot().getProject(basePath.segment(0));
              IPath derivedPath = derivedResource.getLocation();
              if (derivedPath != null) {
View Full Code Here

      if (_dump_NCDFE)
        e.printStackTrace();
    }
    if (result == null) {
      IPath root = getLocalRoot(path);
      result = path.removeFirstSegments(root.segmentCount()).makeAbsolute();
    }
    return result;
  }

  /**
 
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.