Example usage for org.eclipse.jdt.internal.core UserLibrary getEntries

List of usage examples for org.eclipse.jdt.internal.core UserLibrary getEntries

Introduction

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

Prototype

public IClasspathEntry[] getEntries() 

Source Link

Usage

From source file:com.cisco.surf.jenkow.ide.config.UserLibConfigurator.java

License:Open Source License

private IClasspathContainer getClasspathContainer(final String name, final File jarFileOrDir)
        throws JavaModelException {
    List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
    if (isDefined(name)) {
        UserLibrary userLibrary = new UserLibraryManager().getUserLibrary(name);
        Collections.addAll(list, userLibrary.getEntries());
    }//from ww w. j a  v a2 s  . co m
    return createClasspathContainer(name, getClasspathEntries(jarFileOrDir, list));
}

From source file:net.rim.ejde.internal.util.WorkspaceDependencyUtils.java

License:Open Source License

/**
*
*//*ww w.j  a  v  a  2s.  co m*/
static public IClasspathEntry[] getClasspathEntriesForUserLibrary(String userLibrary) {
    IClasspathEntry[] result = null;

    UserLibraryManager userLibMgr = JavaModelManager.getUserLibraryManager();
    UserLibrary rimLibs = userLibMgr.getUserLibrary(userLibrary);

    if (null == rimLibs)
        return new IClasspathEntry[] {};

    result = rimLibs.getEntries();

    if (0 < result.length)
        return result;

    return new IClasspathEntry[] {};
}

From source file:org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig.java

License:Open Source License

/**
 * Resolve the referenced user libraries into a collection of classpath entries that reference
 * physical libraries. /*from   w  ww  .ja v  a  2 s . c o  m*/
 * 
 * @return the classpath entries contributed by the referenced user libraries
 */

public synchronized Collection<IClasspathEntry> resolve() {
    final List<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
    final UserLibraryManager userLibraryManager = JavaModelManager.getUserLibraryManager();

    for (String libraryName : this.libraryNames) {
        final UserLibrary userLibrary = userLibraryManager.getUserLibrary(libraryName);

        if (userLibrary != null) {
            for (IClasspathEntry cpe : userLibrary.getEntries()) {
                entries.add(cpe);
            }
        }
    }

    return Collections.unmodifiableCollection(entries);
}

From source file:org.jboss.ide.eclipse.archives.jdt.integration.model.ArchiveLibFileSetImpl.java

License:Open Source License

private synchronized void prime() {
    if (entries == null) {
        UserLibrary lib = JavaModelManager.getUserLibraryManager().getUserLibrary(getFileSetDelegate().getId());
        if (lib != null) {
            entries = lib.getEntries();
            ArrayList<FileWrapper> list = new ArrayList<FileWrapper>();
            FileWrapper fw;/*from  w w  w .  j  a  v a  2s.  c  o  m*/
            for (int i = 0; i < entries.length; i++) {
                fw = new FileWrapper(entries[i].getPath().toFile(), entries[i].getPath(),
                        getRootArchiveRelativePath(), entries[i].getPath().lastSegment());
                list.add(fw);
            }
            wrappers = (FileWrapper[]) list.toArray(new FileWrapper[list.size()]);
        } else {
            entries = new IClasspathEntry[] {};
            wrappers = new FileWrapper[] {};
        }
    }
}