Examples of makeAbsolute()


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

    if (filename != null) {
      final IPath filePath = new Path(filename);
      if ((filePath.segmentCount() > 1) && (ResourcesPlugin.getWorkspace().getRoot().getFile(filePath).exists())) {
        return ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
      }
      final IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(URIUtil.toURI(filePath.makeAbsolute()));
      for (int i = 0; (i < files.length) && (file == null); ++i) {
        if (files[i].exists()) {
          file = files[i];
          break;
        }
View Full Code Here

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

  public void run() {
    String fileName = getResolvedURL(getElement(), URI);

    if (fileName != null && fileName.length() > 0) {
      IPath includedPath = new Path(fileName);
      includedPath.makeAbsolute();

      IFile file = getFile(includedPath);
      if (file != null && file.exists()) {
        try {
          IDE.openEditor(getPage(), file);
View Full Code Here

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

    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IProject[] projects = workspaceRoot.getProjects();

    for (int i = 0, length = projects.length; i < length; i++) {
      IPath path = projects[i].getLocation();
      path = path.makeAbsolute();
      if (path != null && path.isPrefixOf(includedPath)) {
        // -1 so we still have the project path
        includedPath = includedPath.removeFirstSegments(path
            .segmentCount() - 1);
        return ResourcesPlugin.getWorkspace().getRoot().getFile(
View Full Code Here

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

    String fileName = getResolvedURL(getHostElement(), this._fileAttrName);
    if (fileName == null || fileName.length() == 0) {
      return null;
    }
        IPath includedPath = new Path(fileName);
        includedPath.makeAbsolute();

        IFile file = getFile(includedPath);
        if (file == null) {
          return null;
        }
View Full Code Here

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

    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IProject[] projects = workspaceRoot.getProjects();

    for (int i = 0, length = projects.length; i < length; i++) {
      IPath path = projects[i].getLocation();
      path = path.makeAbsolute();
      if (path != null && path.isPrefixOf(includedPath)) {
        // -1 so we still have the project path
        includedPath = includedPath.removeFirstSegments(path
            .segmentCount() - 1);
        return ResourcesPlugin.getWorkspace().getRoot().getFile(
View Full Code Here

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

   * @param filePath - the path to the file
   * @return the contents, null if the file could not be found
   */
  protected String getContents(String filePath) {
    IPath path = new Path(filePath);
    return FileContentCache.getInstance().getContents(path.makeAbsolute());
  }
}
View Full Code Here

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

  }
 
  private static String getStandaloneTLDURI(TLDDocument doc, IProject project) {
    Path p = new Path(doc.getBaseLocation());
    IPath webContentPath = ComponentCore.createComponent(project).getRootFolder().getUnderlyingFolder().getLocation();
    return getURIFromPath(p.makeAbsolute().makeRelativeTo(webContentPath.makeAbsolute()));   
  }

  private static String getTagDirURI(TLDDocument doc, IProject project) {
    Path p = new Path(doc.getBaseLocation());
    IVirtualComponent projectComp = ComponentCore.createComponent(project);
View Full Code Here

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

    String value = configuration.getAttribute(cfgAttr, "");

    if ("/".equals(value)) {
      IPath path = (IPath) proj.getResource().getLocation().clone();
      path.makeAbsolute();
      value = path.toOSString();
    } else {
      if (proj.getProject().getFolder(value).getRawLocation() == null) {
        throw new IllegalStateException(
            "raw location shouldn't be null");
View Full Code Here

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

    final IPath p = new Path(path);
    if (p.isAbsolute() && p.segmentCount() > 1) {
      return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
          .removeFirstSegments(1).makeAbsolute().toString());
    } else {
      return getBundledImageDescriptor(p.makeAbsolute().toString());
    }
  }

  /**
   * Returns an image for the image file at the given plug-in relative path.
View Full Code Here

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

    final IPath p = new Path(path);
    if (p.isAbsolute() && p.segmentCount() > 1) {
      return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
          .removeFirstSegments(1).makeAbsolute().toString());
    } else {
      return getBundledImageDescriptor(p.makeAbsolute().toString());
    }
  }

  /**
   * Returns an image for the image file at the given plug-in relative path.
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.