Example usage for org.eclipse.jdt.internal.core JavaProject getPerProjectInfo

List of usage examples for org.eclipse.jdt.internal.core JavaProject getPerProjectInfo

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core JavaProject getPerProjectInfo.

Prototype

public JavaModelManager.PerProjectInfo getPerProjectInfo() throws JavaModelException 

Source Link

Usage

From source file:com.google.gdt.eclipse.core.ClasspathUtilities.java

License:Open Source License

public static IClasspathEntry getNullableRawClasspathEntryForPackageFragmentRoot(IPackageFragmentRoot root)
        throws JavaModelException {

    IClasspathEntry rawEntry = null;/*from   www  .j av  a  2s  .c o m*/
    {
        JavaProject project = (JavaProject) root.getJavaProject();
        // force the reverse rawEntry cache to be populated
        project.getResolvedClasspath(true);
        @SuppressWarnings("rawtypes")
        Map rootPathToRawEntries = project.getPerProjectInfo().rootPathToRawEntries;
        if (rootPathToRawEntries != null) {
            rawEntry = (IClasspathEntry) rootPathToRawEntries.get(root.getPath());
        }
    }
    return rawEntry;
}

From source file:org.eclipse.xtext.xbase.ui.validation.XbaseUIValidator.java

License:Open Source License

protected IClasspathEntry getResolvedClasspathEntry(IJavaProject javaProject,
        /* @NonNull */ IPackageFragmentRoot root) throws JavaModelException {
    IClasspathEntry result = null;/*w  w w . ja v a  2s .  c  o  m*/
    JavaProject castedProject = (JavaProject) javaProject;
    castedProject.getResolvedClasspath(); // force the resolved entry cache to be populated
    @SuppressWarnings("rawtypes")
    Map rootPathToResolvedEntries = castedProject.getPerProjectInfo().rootPathToResolvedEntries;
    if (rootPathToResolvedEntries != null) {
        result = (IClasspathEntry) rootPathToResolvedEntries.get(root.getPath());
        if (result == null)
            result = (IClasspathEntry) rootPathToResolvedEntries.get(root.getJavaProject().getPath());
    }

    return result;
}

From source file:org.summer.dsl.xbase.ui.validation.XbaseUIValidator.java

License:Open Source License

@Nullable
protected IClasspathEntry getResolvedClasspathEntry(IJavaProject javaProject,
        @NonNull IPackageFragmentRoot root) throws JavaModelException {
    IClasspathEntry result = null;//  www.  ja  va  2s.  co m
    JavaProject castedProject = (JavaProject) javaProject;
    castedProject.getResolvedClasspath(); // force the resolved entry cache to be populated
    @SuppressWarnings("rawtypes")
    Map rootPathToResolvedEntries = castedProject.getPerProjectInfo().rootPathToResolvedEntries;
    if (rootPathToResolvedEntries != null) {
        result = (IClasspathEntry) rootPathToResolvedEntries.get(root.getPath());
        if (result == null)
            result = (IClasspathEntry) rootPathToResolvedEntries.get(root.getJavaProject().getPath());
    }

    return result;
}