Examples of trimSegments()


Examples of org.eclipse.emf.common.util.URI.trimSegments()

      int count = 1;
      for (int i = 0; (i = className.indexOf('.', i)) != -1; ++i)
      {
        ++count;
      }
      uri = uri.trimSegments(count);

      URL manifestURL = null;
 
      // For an archive URI, check for the path in the archive.
      //
View Full Code Here

Examples of org.eclipse.emf.common.util.URI.trimSegments()

        // Trim off the "bin" or "runtime" segment.
        //
        String lastSegment = uri.lastSegment();
        if ("bin".equals(lastSegment) || "runtime".equals(lastSegment))
        {
          uri = uri.trimSegments(1);
        }
        uri = uri.appendSegments(relativePath);
        manifestURL = new URL(uri.toString());
      }
             
View Full Code Here

Examples of org.eclipse.emf.common.util.URI.trimSegments()

    if (obj == null) {
      text = NO_EXERCISE_LABEL;
    } else if (obj instanceof Resource) {
      Resource res = (Resource) obj;
      URI uri = res.getURI();
      text = uri.lastSegment() + NAME_PATH_SEPARATOR + toPath(uri.trimSegments(1));
//      Exercise ex = res.getExercise();
//      text = (ex != null ? getText(ex) : res.getURI().toString());
    } else if (obj instanceof Exercise) {
//      JexResource res = JexUiPlugin.getPlugin().getExerciseManager().getExerciseResource((Exercise)obj);
//      String exText = (res != null ? res.getURI().toString() : null);
View Full Code Here

Examples of org.eclipse.emf.common.util.URI.trimSegments()

    } else if (uri == null || s.startsWith("/")) {
      uri = URI.createPlatformResourceURI(s);
    } else if (s.startsWith("#")) {
      uri = uri.appendFragment(s.substring(1));
    } else {
      uri = uri.trimSegments(1).appendSegment(s);
    }
    return uri;
  }
 
  //
View Full Code Here

Examples of org.eclipse.emf.common.util.URI.trimSegments()

            for (String path : def.getPreviewClasspathEntries()) {
              try {
                URI cpUri = URI.createURI(path);
                if (cpUri.isPlatformResource()) {
                  if (cpUri.lastSegment().equals("*")) {
                    cpUri = cpUri.trimSegments(1);
                    Path cpPath = new Path(cpUri.toPlatformString(true));
                    IWorkspaceRoot root = jp.getProject().getWorkspace().getRoot();
                    IFolder f = root.getFolder(cpPath);
                    if (f.exists()) {
                      for (IResource r : f.members()) {
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.