Package org.eclipse.jdt.launching

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry


  protected void collectExportedEntries(IJavaProject proj, List<IRuntimeClasspathEntry> runtimeEntries) throws CoreException {
    IClasspathEntry[] entries = proj.getRawClasspath();
    for (int i = 0; i < entries.length; i++) {
      IClasspathEntry entry = entries[i];
      if (entry.isExported()) {
        IRuntimeClasspathEntry rte = null;
        switch (entry.getEntryKind()) {
          case IClasspathEntry.CPE_CONTAINER:
            IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), proj);
            int kind = 0;
            switch (container.getKind()) {
              case IClasspathContainer.K_APPLICATION:
                kind = IRuntimeClasspathEntry.USER_CLASSES;
                break;
              case IClasspathContainer.K_SYSTEM:
                kind = IRuntimeClasspathEntry.BOOTSTRAP_CLASSES;
                break;
              case IClasspathContainer.K_DEFAULT_SYSTEM:
                kind = IRuntimeClasspathEntry.STANDARD_CLASSES;
                break;
            }
            rte = JavaRuntime.newRuntimeContainerClasspathEntry(entry.getPath(), kind, proj);
            break;
          case IClasspathEntry.CPE_LIBRARY:
            rte = JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath());
            rte.setSourceAttachmentPath(entry.getSourceAttachmentPath());
            rte.setSourceAttachmentRootPath(entry.getSourceAttachmentRootPath());
            break;
          case IClasspathEntry.CPE_PROJECT:
            String name = entry.getPath().segment(0);
            IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
            if (p.exists()) {
View Full Code Here


      for (int i = 0; i < entries.length; i++) {
        IRuntimeClasspathEntry[] temp = null;
        /**
         * we need to handle a special case for MAVEN_CONTAINER with workspace project.
         */
        IRuntimeClasspathEntry entryCur = entries[i];

        //We skip server runtime directly since we didn't need server runtime ,
        //and it will conflict with our Jetty bundle.
        if(isServerRuntimeContainer(entryCur)){
          continue;
View Full Code Here

          IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(cpe.getPath().segment(0));
          IJavaProject jp = JavaCore.create(p);

          IRuntimeClasspathEntry[] entries = JavaRuntime.resolveRuntimeClasspathEntry(new RuntimeClasspathEntry(cpe), jp);
          for (int j = 0; j < entries.length; j++) {
            IRuntimeClasspathEntry e =  entries[j];

            //skip test-classes for included maven project.
            boolean testClasses =  e.getLocation()!=null && e.getLocation().endsWith("test-classes");

            if (!(resolved.contains(e) || testClasses))
              resolved.add(e);

          }
          /**
           * end
           */
        } else {
          IRuntimeClasspathEntry e = new RuntimeClasspathEntry(cpe);
          if (!resolved.contains(e)) {
            resolved.add(e);
          }
        }
      }
View Full Code Here

  protected void collectExportedEntries(IJavaProject proj, List<IRuntimeClasspathEntry> runtimeEntries) throws CoreException {
    IClasspathEntry[] entries = proj.getRawClasspath();
    for (int i = 0; i < entries.length; i++) {
      IClasspathEntry entry = entries[i];
      if (entry.isExported()) {
        IRuntimeClasspathEntry rte = null;
        switch (entry.getEntryKind()) {
          case IClasspathEntry.CPE_CONTAINER:
            IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), proj);
            int kind = 0;
            switch (container.getKind()) {
              case IClasspathContainer.K_APPLICATION:
                kind = IRuntimeClasspathEntry.USER_CLASSES;
                break;
              case IClasspathContainer.K_SYSTEM:
                kind = IRuntimeClasspathEntry.BOOTSTRAP_CLASSES;
                break;
              case IClasspathContainer.K_DEFAULT_SYSTEM:
                kind = IRuntimeClasspathEntry.STANDARD_CLASSES;
                break;
            }
            rte = JavaRuntime.newRuntimeContainerClasspathEntry(entry.getPath(), kind, proj);
            break;
          case IClasspathEntry.CPE_LIBRARY:
            rte = JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath());
            rte.setSourceAttachmentPath(entry.getSourceAttachmentPath());
            rte.setSourceAttachmentRootPath(entry.getSourceAttachmentRootPath());
            break;
          case IClasspathEntry.CPE_PROJECT:
            String name = entry.getPath().segment(0);
            IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
            if (p.exists()) {
View Full Code Here

    IRuntimeClasspathEntry[] customClasspath = getCurrentCustomClasspath();
    try {
      List<String> mementos = new ArrayList<String>(
          customClasspath.length);
      for (int i = 0; i < customClasspath.length; i++) {
        IRuntimeClasspathEntry entry = customClasspath[i];
        mementos.add(entry.getMemento());
      }
      configuration.setAttribute(getCustomAttributeName(), mementos);
      configuration.doSave();
    } catch (CoreException e) {
      Plugin.statusDialog(
View Full Code Here

  private IRuntimeClasspathEntry[] getCurrentClasspath() {
    IRJRClasspathEntry[] user = fModel
        .getEntries(UserClassesClasspathModel.USER);
    List<IRuntimeClasspathEntry> entries = new ArrayList<IRuntimeClasspathEntry>(
        user.length);
    IRuntimeClasspathEntry entry;
    IRJRClasspathEntry userEntry;
    for (int i = 0; i < user.length; i++) {
      userEntry = user[i];
      entry = null;
      if (userEntry instanceof ClasspathEntry) {
        entry = ((ClasspathEntry) userEntry).getDelegate();
      } else if (userEntry instanceof IRuntimeClasspathEntry) {
        entry = (IRuntimeClasspathEntry) user[i];
      }
      if (entry != null) {
        entry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
        entries.add(entry);
      }
    }
    return (IRuntimeClasspathEntry[]) entries
        .toArray(new IRuntimeClasspathEntry[entries.size()]);
View Full Code Here

  private IRuntimeClasspathEntry[] getCurrentCustomClasspath() {
    IRJRClasspathEntry[] user = fModel
        .getEntries(UserClassesClasspathModel.CUSTOM);
    List<IRuntimeClasspathEntry> entries = new ArrayList<IRuntimeClasspathEntry>(
        user.length);
    IRuntimeClasspathEntry entry;
    IRJRClasspathEntry userEntry;
    for (int i = 0; i < user.length; i++) {
      userEntry = user[i];
      entry = null;
      if (userEntry instanceof ClasspathEntry) {
        entry = ((ClasspathEntry) userEntry).getDelegate();
      } else if (userEntry instanceof IRuntimeClasspathEntry) {
        entry = (IRuntimeClasspathEntry) user[i];
      }
      if (entry != null) {
        entry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
        entries.add(entry);
      }
    }
    return (IRuntimeClasspathEntry[]) entries
        .toArray(new IRuntimeClasspathEntry[entries.size()]);
View Full Code Here

          true);
      IRuntimeClasspathEntry[] entries = JavaRuntime
          .computeUnresolvedRuntimeClasspath(wc);
      if (classpath.length == entries.length) {
        for (int i = 0; i < entries.length; i++) {
          IRuntimeClasspathEntry entry = entries[i];
          if (!entry.equals(classpath[i])) {
            return false;
          }
        }
        return true;
      }
View Full Code Here

      for (int i = 0; i < entries.length; i++) {
        IRuntimeClasspathEntry[] temp = null;
        /**
         * we need to handle a special case for MAVEN_CONTAINER with workspace project.
         */
        IRuntimeClasspathEntry entryCur = entries[i];

        //We skip server runtime directly since we didn't need server runtime ,
        //and it will conflict with our Jetty bundle.
        if(isServerRuntimeContainer(entryCur)){
          continue;
View Full Code Here

          IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(cpe.getPath().segment(0));
          IJavaProject jp = JavaCore.create(p);

          IRuntimeClasspathEntry[] entries = JavaRuntime.resolveRuntimeClasspathEntry(new RuntimeClasspathEntry(cpe), jp);
          for (int j = 0; j < entries.length; j++) {
            IRuntimeClasspathEntry e =  entries[j];

            if (!(resolved.contains(e) ))
              resolved.add(e);

          }
          /**
           * end
           */
        } else {
          IRuntimeClasspathEntry e = new RuntimeClasspathEntry(cpe);
          if (!resolved.contains(e)) {
            resolved.add(e);
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.launching.IRuntimeClasspathEntry

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.