Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Path


    return true;
  }

  private static File getImageFile(long id) {
    IPath path = new Path(Activator.getDefault().getStateLocation().toOSString());
    path = path.append(ICONS_FOLDER);
    File root = new File(path.toOSString());
    if (!root.exists())
      root.mkdir();

    path = path.append(id + ".ico");

    return new File(path.toOSString());
  }
View Full Code Here


        IJavaProject project = getJavaProject();
        if (project == null) {
            return null;
        }
        IPath path = new Path(rootPath);
        if (path.isAbsolute()) {
            IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace()
                .getRoot();
            IResource resource = workspaceRoot.findMember(path);
            IPackageFragmentRoot root1;
            if (resource == null) {
View Full Code Here

                int libLength = libraries.length;

                IClasspathEntry[] entries = new IClasspathEntry[sourceLength
                    + libLength];
                for (int i = 0; i < sourceLength; i++) {
                    IPath sourcePath = new Path(sourceFolders[i]);
                    int segmentCount = sourcePath.segmentCount();
                    if (segmentCount > 0) {
                        // create folder and its parents
                        IContainer container = project;
                        for (int j = 0; j < segmentCount; j++) {
                            IFolder folder = container.getFolder(new Path(
                                sourcePath.segment(j)));
                            if (!folder.exists()) {
                                folder.create(true, true, null);
                            }
                            container = folder;
                        }
                    }

                    // create source entry
                    entries[i] = JavaCore.newSourceEntry(
                        projectPath.append(sourcePath), new IPath[0],
                        new IPath[0], null);
                }

                for (int i = 0; i < libLength; i++) {
                    String lib = libraries[i];
                    if (lib.startsWith("JCL")) {
                        // ensure JCL variables are set
                         try {
                            setUpJCLClasspathVariables(compliance);
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }

                    if (lib.indexOf(File.separatorChar) == -1
                        && lib.charAt(0) != '/'
                        && lib.equals(lib.toUpperCase())) { // all upper case is a var
                        char[][] vars = CharOperation.splitOn(',', lib
                            .toCharArray());
                        entries[sourceLength + i] = JavaCore.newVariableEntry(
                            new Path(new String(vars[0])), vars.length > 1
                                ? new Path(new String(vars[1]))
                                : null, vars.length > 2
                                ? new Path(new String(vars[2]))
                                : null);
                    } else {
                        IPath libPath = new Path(lib);
                        if (!libPath.isAbsolute() && libPath.segmentCount() > 0
                            && libPath.getFileExtension() == null) {
                            project.getFolder(libPath).create(true, true, null);
                            libPath = projectPath.append(libPath);
                        }
                        entries[sourceLength + i] = JavaCore.newLibraryEntry(
                            libPath, null, null, ClasspathEntry.getAccessRules(
                                new IPath[0], new IPath[0]),
                            new IClasspathAttribute[0], false);
                    }
                }

                // create project's output folder
                IPath outputPath = new Path(projectOutput);
                if (outputPath.segmentCount() > 0) {
                    IFolder output = project.getFolder(outputPath);
                    if (!output.exists()) {
                        output.create(true, true, null);
                    }
                }
View Full Code Here

        options.put(CompilerOptions.OPTION_TargetPlatform, version);
        javaProject.setOptions(options);

        // replace JCL_LIB with JCL15_LIB, and JCL_SRC with JCL15_SRC
        IClasspathEntry[] classpath = javaProject.getRawClasspath();
        IPath jclLib = new Path(jclLibString);
        for (int i = 0, length = classpath.length; i < length; i++) {
            IClasspathEntry entry = classpath[i];
            if (entry.getPath().equals(jclLib)) {
                classpath[i] = JavaCore.newVariableEntry(
                    new Path(newJclLibString), null, entry
                        .getSourceAttachmentRootPath(), entry.getAccessRules(),
                    new IClasspathAttribute[0], entry.isExported());
                break;
            }
        }
View Full Code Here

    /**
     * Returns the IPath to the external java class library (e.g. jclMin.jar)
     */
    protected IPath getExternalJCLPath() {
        return new Path(getExternalJCLPathString(""));
    }
View Full Code Here

    }
    /**
     * Returns the IPath to the external java class library (e.g. jclMin.jar)
     */
    protected IPath getExternalJCLPath(String compliance) {
        return new Path(getExternalJCLPathString(compliance));
    }
View Full Code Here

    private IClasspathEntry[] createDroolsLibraryEntries(IJavaProject project) {
        List jarNames = getJarNames();
        List list = new ArrayList();
        for (int i = 0; i < jarNames.size(); i++) {
            Path path = new Path((String) jarNames.get(i));
            list.add(JavaCore.newLibraryEntry(
                path, path, null));
        }
        return (IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]);
    }
View Full Code Here

    }

    private List getJarNames() {
        String s = getDroolsLocation();
        List list = new ArrayList();
        File file = (new Path(s)).toFile();
        addJarNames(file, list);
        return list;
    }
View Full Code Here

        project.setRawClasspath((IClasspathEntry[]) list
            .toArray(new IClasspathEntry[list.size()]), null);
    }

    private IPath getClassPathContainerPath() {
        return new Path("DROOLS/" + getDroolsNamePref());
    }
View Full Code Here

    }

    IPath canonicalPath = null;
    try {
      canonicalPath =
        new Path(new File(externalPath.toOSString()).getCanonicalPath());
    } catch (IOException e) {
      // default to original path
//      if (JavaModelManager.VERBOSE) {
//        System.out.println("JAVA MODEL - Canonical path is original path (IOException)");
//      }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.Path

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.