KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > spi > project > libraries > LibraryImplementation


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.spi.project.libraries;
21
22 import java.beans.PropertyChangeListener JavaDoc;
23 import java.net.URL JavaDoc;
24 import java.util.List JavaDoc;
25
26 /**
27  * Base SPI interface for library. This SPI class is used as a model by the libraries framework.
28  * The LibraryTypeProvider implementor should rather use
29  * org.netbeans.spi.project.libraries.support.LibrariesSupport.createLibraryImplementation
30  * factory method to create default LibraryImplementation than to implement this interface.
31  */

32 public interface LibraryImplementation {
33
34     String JavaDoc PROP_NAME = "name"; //NOI18N
35
String JavaDoc PROP_DESCRIPTION = "description"; //NOI18N
36
String JavaDoc PROP_CONTENT = "content"; //NOI18N
37

38     /**
39      * Returns type of library, the LibraryTypeProvider creates libraries
40      * of given unique type.
41      * @return String unique identifier, never returns null.
42      */

43     String JavaDoc getType();
44
45     /**
46      * Returns name of the library
47      * @return String unique name of the library, never returns null.
48      */

49     String JavaDoc getName();
50
51     /**
52      * Get a description of the library.
53      * The description provides more detailed information about the library.
54      * @return String the description or null if the description is not available
55      */

56     String JavaDoc getDescription();
57
58
59     /**
60      * Returns the resource name of the bundle which is used for localizing
61      * the name and description. The bundle is located using the system ClassLoader.
62      * @return String, the resource name of the bundle. If null in case when the
63      * name and description is not localized.
64      */

65     String JavaDoc getLocalizingBundle();
66
67     /**
68      * Returns List of resources contained in the given volume.
69      * The returned list is unmodifiable. To change the content of
70      * the given volume use setContent method.
71      * @param volumeType the type of volume for which the content should be returned.
72      * @return list of resource URLs (never null)
73      * @throws IllegalArgumentException if the library does not support given type of volume
74      */

75     List JavaDoc<URL JavaDoc> getContent(String JavaDoc volumeType) throws IllegalArgumentException JavaDoc;
76
77     /**
78      * Sets the name of the library, called by LibrariesStorage while reading the library
79      * @param name - the unique name of the library, can't be null.
80      */

81     void setName(String JavaDoc name);
82
83     /**
84      * Sets the description of the library, called by LibrariesStorage while reading the library
85      * The description is more detailed information about the library.
86      * @param text - the description of the library, may be null.
87      */

88     void setDescription(String JavaDoc text);
89
90     /**
91      * Sets the localizing bundle. The bundle is used for localizing the name and description.
92      * The bundle is located using the system ClassLoader.
93      * Called by LibrariesStorage while reading the library.
94      * @param resourceName of the bundle without extension, may be null.
95      */

96     void setLocalizingBundle(String JavaDoc resourceName);
97
98     /**
99      * Adds PropertyChangeListener
100      * @param l - the PropertyChangeListener
101      */

102     void addPropertyChangeListener(PropertyChangeListener JavaDoc l);
103
104     /**
105      * Removes PropertyChangeListener
106      * @param l - - the PropertyChangeListener
107      */

108     void removePropertyChangeListener(PropertyChangeListener JavaDoc l);
109
110     /**
111      * Sets content of given volume
112      * @param volumeType the type of volume for which the content should be set
113      * @param path the list of resource URLs
114      * @throws IllegalArgumentException if the library does not support given volumeType
115      */

116     void setContent(String JavaDoc volumeType, List JavaDoc<URL JavaDoc> path) throws IllegalArgumentException JavaDoc;
117
118 }
119
Popular Tags