|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.api.project.libraries; import org.netbeans.api.project.libraries.Library; import org.netbeans.spi.project.libraries.LibraryImplementation; import org.netbeans.spi.project.libraries.LibraryProvider; import org.openide.util.Lookup; import org.openide.util.LookupListener; import org.openide.util.LookupEvent; import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.util.*; // XXX make getLibraries return Set not array /** * LibraryManager provides registry of the installed libraries. * LibraryManager can be used to list all installed libraries or to * query library by its system name. */ public final class LibraryManager { public static final String PROP_LIBRARIES = "libraries"; //NOI18N private static LibraryManager instance; private Lookup.Result result; private Collection currentStorages = new ArrayList (); private PropertyChangeListener plistener; private PropertyChangeSupport listeners; private Collection cache; private LibraryManager () { this.listeners = new PropertyChangeSupport(this); } /** * Returns library by its name. * @param name of the library, must not be null * @return library or null if the library is not found */ public Library getLibrary(String name) { assert name != null; Library[] libs = this.getLibraries(); for (int i = 0; i < libs.length; i++) { if (name.equals(libs[i].getName())) { return libs[i]; } } return null; } /** * List all library defined in the IDE. * * @return Library[] library definitions never |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.