Examples of IRuntimeClasspathEntry


Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

            JavaRuntime.computeUnresolvedRuntimeClasspath(proj),
            configuration);

    // Remove JRE entry/entries.

    IRuntimeClasspathEntry stdJreEntry = JavaRuntime
        .computeJREEntry(configuration);
    IRuntimeClasspathEntry projJreEntry = JavaRuntime.computeJREEntry(proj);
    List<IRuntimeClasspathEntry> entryList = new ArrayList<IRuntimeClasspathEntry>(
        entries.length);

    for (int i = 0; i < entries.length; i++) {
      IRuntimeClasspathEntry entry = entries[i];
      if (entry.equals(stdJreEntry))
        continue;
      if (entry.equals(projJreEntry))
        continue;
      entryList.add(entry);
    }

    // Resolve the entries to actual file/folder locations.
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

    return false;
  }
  private Set<String> searchUserClass(IRuntimeClasspathEntry[] entries) {
    Set<String> locations = new LinkedHashSet<String>();
    for (int i = 0; i < entries.length; i++) {
      IRuntimeClasspathEntry entry = entries[i];
      if (entry.getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
        String location = entry.getLocation();
        if (location != null) {
          locations.add(location);
        }
      }
    }
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

    }else{

      IRuntimeClasspathEntry[] entries = resolveOutputLocations(project);
      List<IRuntimeClasspathEntry> entryList = new ArrayList<IRuntimeClasspathEntry>(entries.length);
      for (int j = 0; j < entries.length; j++) {
        IRuntimeClasspathEntry e =  entries[j];

        if (!(entryList.contains(e))){
          entryList.add(e);
        }
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

            JavaRuntime.computeUnresolvedRuntimeClasspath(proj),
            configuration);

    // Remove JRE entry/entries.

    IRuntimeClasspathEntry stdJreEntry = JavaRuntime
        .computeJREEntry(configuration);
    IRuntimeClasspathEntry projJreEntry = JavaRuntime.computeJREEntry(proj);
    List<IRuntimeClasspathEntry> entryList = new ArrayList<IRuntimeClasspathEntry>(
        entries.length);

    for (int i = 0; i < entries.length; i++) {
      IRuntimeClasspathEntry entry = entries[i];
      if (entry.equals(stdJreEntry))
        continue;
      if (entry.equals(projJreEntry))
        continue;
      entryList.add(entry);
    }

    // Resolve the entries to actual file/folder locations.
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

  /* (non-Javadoc)
   * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
   */
  public Image getImage(Object element) {
    IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry)element;
    IResource resource = entry.getResource();
    switch (entry.getType()) {
      case IRuntimeClasspathEntry.PROJECT:
        IJavaElement proj = JavaCore.create(resource);
        if(proj == null) {
          return PlatformUI.getWorkbench().getSharedImages().getImage(SharedImages.IMG_OBJ_PROJECT_CLOSED);
        }
        else {
          return lp.getImage(proj);
        }
      case IRuntimeClasspathEntry.ARCHIVE:
        if (resource instanceof IContainer) {
          return lp.getImage(resource);
        }
        if(resource !=  null && resource.getRawLocation().toFile().isDirectory()){
          return PlatformUI.getWorkbench().getSharedImages().getImage(
              org.eclipse.ui.ISharedImages.IMG_OBJ_FOLDER);
        }

        boolean external = resource == null;
        boolean source = true ;//(entry.getSourceAttachmentPath() != null && !Path.EMPTY.equals(entry.getSourceAttachmentPath()));
        String key = null;
        if (external) {
          IPath path = entry.getPath();
          if (path != null)
          {
            File file = path.toFile();
            if (file.exists() && file.isDirectory()) {
              key = ISharedImages.IMG_OBJS_PACKFRAG_ROOT;
            } else {
              key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE;
            }
          }

        } else {
          if (source) {
            key = ISharedImages.IMG_OBJS_JAR_WITH_SOURCE;
          } else {
            key = ISharedImages.IMG_OBJS_JAR;
          }
        }
        return JavaUI.getSharedImages().getImage(key);
      case IRuntimeClasspathEntry.VARIABLE:
        return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_ENV_VAR);
      case IRuntimeClasspathEntry.CONTAINER:
                return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_LIBRARY);
      case IRuntimeClasspathEntry.OTHER:
        IRuntimeClasspathEntry delegate = entry;
        if (entry instanceof ClasspathEntry) {
          delegate = ((ClasspathEntry)entry).getDelegate();
        }
        Image image = lp.getImage(delegate);
        if (image != null) {
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

  /* (non-Javadoc)
   * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
   */
  public String getText(Object element) {
    IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry)element;
    switch (entry.getType()) {
      case IRuntimeClasspathEntry.PROJECT:
        IResource res = entry.getResource();
        IJavaElement proj = JavaCore.create(res);
        if(proj == null) {
          return entry.getPath().lastSegment();
        }
        else {
          return lp.getText(proj);
        }
      case IRuntimeClasspathEntry.ARCHIVE:
        IPath path = entry.getPath();
        if (path == null) {
                    return MessageFormat.format("Invalid path: {0}", new Object[]{"null"}); //$NON-NLS-1$
                }
                if (!path.isAbsolute() || !path.isValidPath(path.toString())) {
          return MessageFormat.format("Invalid path: {0}", new Object[]{path.toOSString()});
        }
        String[] segments = path.segments();
        StringBuffer displayPath = new StringBuffer();
        if (segments.length > 0) {
          String device = path.getDevice();
          if (device != null) {
            displayPath.append(device);
            displayPath.append(File.separator);
          }
          for (int i = 0; i < segments.length -1; i++) {
            displayPath.append(segments[i]).append(File.separator);
          }
          displayPath.append(segments[segments.length - 1]);

          //getDevice means that's a absolute path.
          if(path.getDevice() != null && !path.toFile().exists()){
            displayPath.append(" (missing) ");
          }
        } else {
          displayPath.append(path.toOSString());
        }
        return displayPath.toString();
      case IRuntimeClasspathEntry.VARIABLE:
        path = entry.getPath();
        IPath srcPath = entry.getSourceAttachmentPath();
        StringBuffer buf = new StringBuffer(path.toString());
        if (srcPath != null) {
          buf.append(" ["); //$NON-NLS-1$
          buf.append(srcPath.toString());
          IPath rootPath = entry.getSourceAttachmentRootPath();
          if (rootPath != null) {
            buf.append(IPath.SEPARATOR);
            buf.append(rootPath.toString());
          }
          buf.append(']');
        }
        // append JRE name if we can compute it
        if (path.equals(new Path(JavaRuntime.JRELIB_VARIABLE)) && fLaunchConfiguration != null) {
          try {
            IVMInstall vm = JavaRuntime.computeVMInstall(fLaunchConfiguration);
            buf.append(" - "); //$NON-NLS-1$
            buf.append(vm.getName());
          } catch (CoreException e) {
          }
        }
        return buf.toString();
      case IRuntimeClasspathEntry.CONTAINER:
        path = entry.getPath();
        if (fLaunchConfiguration != null) {
          try {
            IJavaProject project = null;
            try {
              project = JavaRuntime.getJavaProject(fLaunchConfiguration);
            } catch (CoreException e) {
            }
            if (project == null) {
            } else {
              IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
              if (container != null) {
                if(container.getDescription().startsWith("Persisted container")){
                  return container.getPath().toString();
                }else{
                  return container.getDescription();
                }
              }
            }
          } catch (CoreException e) {
          }
        }
        return entry.getPath().toString();
      case IRuntimeClasspathEntry.OTHER:
        IRuntimeClasspathEntry delegate = entry;
        if (entry instanceof ClasspathEntry) {
          delegate = ((ClasspathEntry)entry).getDelegate();
        }
        String name = lp.getText(delegate);
        if (name == null || name.length() == 0) {
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

  public IRuntimeClasspathEntry getDelegate() {
    return entry;
  }

  public boolean hasChildren() {
    IRuntimeClasspathEntry delegate = getDelegate();
    if (delegate.getType() == IRuntimeClasspathEntry.ARCHIVE) {
      return false;
    } else {
      return true;
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

  }

  public IRJRClasspathEntry[] getChildren(ILaunchConfiguration configuration) {

    try {
      IRuntimeClasspathEntry delegate = getDelegate();
      if (delegate.getType() == IRuntimeClasspathEntry.PROJECT) {
        List<IRuntimeClasspathEntry> childs;
        IResource ir = delegate.getResource();
        IJavaProject project = JavaCore.create(ir.getProject());
        childs = RunJettyRunClasspathUtil
            .getProjectClasspathsForUserlibs(project, maven);
        return create(childs, maven);

      } else if (delegate.getType() == IRuntimeClasspathEntry.CONTAINER) {

        // Note: 2011/12/14 Tony:
        // Here the reason we also handle the webapplication container
        // for maven resolving issue is,
        // the web app is impossible to have project as web app .

        // In general case , WTP resolved jars in WEB-INF/lib ,
        // when we have M2E to resolved pom file , sometimes it will
        // load dependency in WEBAPP Container ,

        // yep , it's weird , I mean it should only use existing M2E
        // Container ,
        // but it does happened in some case , I decide to check the
        // project entry in WEB APP Conainer.

        // There shouldn't be proejct entrys in general case, so it
        // should be working fine.
        if (RunJettyRunClasspathResolver.isM2EMavenContainer(delegate)
            || RunJettyRunClasspathResolver
                .isWebAppContainer(delegate)) {
          IClasspathContainer container = JavaCore
              .getClasspathContainer(delegate.getPath(),
                  delegate.getJavaProject());
          if (container == null) {
            return null;
          }
          IClasspathEntry[] cpes = container.getClasspathEntries();
          if (cpes == null) {
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

  private IRJRClasspathEntry[] create(IRuntimeClasspathEntry[] entries,
      boolean maven) {
    ClasspathEntry[] cps = new ClasspathEntry[entries.length];
    for (int i = 0; i < entries.length; i++) {
      IRuntimeClasspathEntry childEntry = entries[i];
      cps[i] = new ClasspathEntry(childEntry, this);
      cps[i].setMaven(maven);
      cps[i].setCustom(custom);
    }
    return cps;
View Full Code Here

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry

  /* (non-Javadoc)
   * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
   */
  public Image getImage(Object element) {
    IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry)element;
    IResource resource = entry.getResource();
    switch (entry.getType()) {
      case IRuntimeClasspathEntry.PROJECT:
        IJavaElement proj = JavaCore.create(resource);
        if(proj == null) {
          return PlatformUI.getWorkbench().getSharedImages().getImage(SharedImages.IMG_OBJ_PROJECT_CLOSED);
        }
        else {
          return lp.getImage(proj);
        }
      case IRuntimeClasspathEntry.ARCHIVE:
        if (resource instanceof IContainer) {
          return lp.getImage(resource);
        }
        if(resource !=  null && resource.getRawLocation().toFile().isDirectory()){
          return PlatformUI.getWorkbench().getSharedImages().getImage(
              org.eclipse.ui.ISharedImages.IMG_OBJ_FOLDER);
        }

        boolean external = resource == null;
        boolean source = true ;//(entry.getSourceAttachmentPath() != null && !Path.EMPTY.equals(entry.getSourceAttachmentPath()));
        String key = null;
        if (external) {
          IPath path = entry.getPath();
          if (path != null)
          {
            File file = path.toFile();
            if (file.exists() && file.isDirectory()) {
              key = ISharedImages.IMG_OBJS_PACKFRAG_ROOT;
            } else if (source) {
                          key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE_WITH_SOURCE;
            } else {
              key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE;
            }
          }

        } else {
          if (source) {
            key = ISharedImages.IMG_OBJS_JAR_WITH_SOURCE;
          } else {
            key = ISharedImages.IMG_OBJS_JAR;
          }
        }
        return JavaUI.getSharedImages().getImage(key);
      case IRuntimeClasspathEntry.VARIABLE:
        return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_ENV_VAR);
      case IRuntimeClasspathEntry.CONTAINER:
                return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_LIBRARY);
      case IRuntimeClasspathEntry.OTHER:
        IRuntimeClasspathEntry delegate = entry;
        if (entry instanceof ClasspathEntry) {
          delegate = ((ClasspathEntry)entry).getDelegate();
        }
        Image image = lp.getImage(delegate);
        if (image != null) {
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.