Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IClasspathEntry


            IClasspathContainer containerSuggestion) throws CoreException {
        if (IvyClasspathUtil.isIvyClasspathContainer(containerPath)) {
            IClasspathEntry[] ice = containerSuggestion.getClasspathEntries();
            IPackageFragmentExtraInfo ei = IvyPlugin.getDefault().getPackageFragmentExtraInfo();
            for (int i = 0; i < ice.length; i++) {
                IClasspathEntry entry = ice[i];
                IPath path = entry.getSourceAttachmentPath();
                String entryPath = entry.getPath().toPortableString();
                ei.setSourceAttachmentPath(containerPath, entryPath, path);
                ei.setSourceAttachmentRootPath(containerPath, entryPath, path);
                ei.setJavaDocLocation(containerPath, entryPath, IvyClasspathUtil
                        .getLibraryJavadocLocation(entry));
            }
View Full Code Here


                String moduleName = moduleId.getName();
                ModuleRevisionId moduleRevisionId = (ModuleRevisionId) dependencies.get(moduleName);
                if (moduleRevisionId != null) {
                    IJavaProject project = (IJavaProject) idToJProject.get(moduleId);
                    if (project != null && project.exists()) {
                        IClasspathEntry entry = JavaCore.newProjectEntry(project.getPath());
                        if (entry != null && !paths.contains(entry)) {
                            paths.add(entry);
                        }
                        usedProject = true;
                    }
View Full Code Here

        }
       
        String separator = System.getProperty("path.separator");
        StringBuffer classpath = new StringBuffer();
        for (int i = 0, n = classpathEntries.size(); i < n; i++) {
            IClasspathEntry entry = classpathEntries.get(i);
            if (i >0) {
                classpath.append(separator);
            }
            classpath.append(entry.getPath().toFile().toURI().getPath());
        }
       
        return classpath.toString();
    }
View Full Code Here

     
      Bundle bundle;
      URL pluginURL,jarURL,localURL;

      boolean add;
      IClasspathEntry icp=null;
      for (int j=0;j<arrL.size();j++){
        bundle=Platform.getBundle(CommonNames.CORE_PATH);
        pluginURL = bundle.getEntry("/");
        add=true;
        icp=(IClasspathEntry)arrL.get(j);
        //remove 'core' jars
        for (int i=0;i<elements_core.length;i++){
          jarURL= new URL(pluginURL,elements_core[i].getValue());
          localURL=Platform.asLocalURL(jarURL);
          if(((icp).equals(JavaCore.newLibraryEntry(new Path(localURL.getPath()), null, null)))||
              icp.getPath().toString().toLowerCase().endsWith("derby.jar")||
              icp.getPath().toString().toLowerCase().endsWith("derbynet.jar")||
              icp.getPath().toString().toLowerCase().endsWith("derbyclient.jar")||
              icp.getPath().toString().toLowerCase().endsWith("derbytools.jar")){
            add=false;
          }
        }
        if(!add){
          arrL.remove(j);
View Full Code Here

        }
       
        String separator = System.getProperty("path.separator");
        StringBuffer classpath = new StringBuffer();
        for (int i = 0, n = classpathEntries.size(); i < n; i++) {
            IClasspathEntry entry = classpathEntries.get(i);
            if (i >0) {
                classpath.append(separator);
            }
            classpath.append(entry.getPath().toFile().toURI().getPath());
        }
       
        return classpath.toString();
    }
View Full Code Here

    sampleSrcFolder.copy(workspaceFolder, EFS.NONE, null);
  }

  public IClasspathEntry ensureSourceFolder(IJavaProject javaProject) throws JavaModelException {
    IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
    IClasspathEntry sampleSrc = null;
    for (int i = 0; i < classpathEntries.length; i++) {
      if(classpathEntries[i].getEntryKind() != IClasspathEntry.CPE_SOURCE)
        continue;// we are interested only in source folders
      String folderName = classpathEntries[i].getPath().lastSegment();
      if(folderName.equals(SAMPLE_SRC)) {
View Full Code Here

     
      IJavaProject javaProject = JavaCore.create(project);
      IClasspathEntry[] oldClasspath = javaProject.getRawClasspath();
      IClasspathEntry[] newClasspath = new IClasspathEntry[oldClasspath.length+1];
      System.arraycopy(oldClasspath, 0, newClasspath, 0, oldClasspath.length);
      IClasspathEntry gwtUserJarEntry = JavaCore.newVariableEntry(Util.getGwtUserLibPath(), null, null);
      IClasspathAttribute attr = JavaCore.newClasspathAttribute("org.eclipse.jst.component.dependency", "/WEB-INF/lib");
      gwtUserJarEntry = JavaCore.newVariableEntry(gwtUserJarEntry.getPath(), null, null, new IAccessRule[0], new IClasspathAttribute[] {attr}, false);
      newClasspath[oldClasspath.length] = gwtUserJarEntry;
      javaProject.setRawClasspath(newClasspath, monitor);

    } catch (JavaModelException e) {
      // the jar is already in the classpath. 
View Full Code Here

      IJavaProject javaProject = JavaCore.create(project);
      IClasspathEntry[] oldClasspath = javaProject.getRawClasspath();
      IClasspathEntry[] newClasspath = new IClasspathEntry[oldClasspath.length + 1];
      System.arraycopy(oldClasspath, 0, newClasspath, 0, oldClasspath.length);
      IClasspathEntry gwtuserJarEntry = JavaCore.newVariableEntry(Util.getGwtUserLibPath(), null, null);
      gwtuserJarEntry = JavaCore.newVariableEntry(gwtuserJarEntry.getPath(), null, null, new IAccessRule[0], new IClasspathAttribute[0], false);
      newClasspath[oldClasspath.length] = gwtuserJarEntry;
      javaProject.setRawClasspath(newClasspath, monitor);

    } catch (CoreException e) {
      // the jar is already in the classpath.
View Full Code Here

      IJavaProject javaProject = JavaCore.create(project);
      IClasspathEntry[] oldClasspath = javaProject.getRawClasspath();
      IClasspathEntry[] newClasspath = new IClasspathEntry[oldClasspath.length + 1];
      System.arraycopy(oldClasspath, 0, newClasspath, 0, oldClasspath.length);
      IClasspathEntry gwtServletJarEntry = JavaCore.newVariableEntry(Util.getGwtServletLibPath(), null, null);
      IClasspathAttribute attr = JavaCore.newClasspathAttribute("org.eclipse.jst.component.dependency", "/WEB-INF/lib");
      gwtServletJarEntry = JavaCore.newVariableEntry(gwtServletJarEntry.getPath(), null, null, new IAccessRule[0], new IClasspathAttribute[] { attr }, false);
      newClasspath[oldClasspath.length] = gwtServletJarEntry;
      javaProject.setRawClasspath(newClasspath, monitor);

    } catch (JavaModelException e) {
      // the jar is already in the classpath.
View Full Code Here

  }

  public static IClasspathEntry getGwtLibraryEntry(IJavaProject javaProject) throws JavaModelException {

    IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
    IClasspathEntry entry = null;
    for (IClasspathEntry iClasspathEntry : classpathEntries) {
      if (Constants.GWT_LIBRARY_CLASSPATH.isPrefixOf(iClasspathEntry.getPath())) {
        entry = iClasspathEntry;
        break;
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IClasspathEntry

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.