KickJava   Java API By Example, From Geeks To Geeks.

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


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.Customizer JavaDoc;
23 import org.openide.util.Lookup;
24
25 /**
26  * SPI interface for provider of library type.
27  * The LibraryTypeProvider is responsible for creating new libraries of given type
28  * and for supplying the customizers of library's volumes.
29  */

30 public interface LibraryTypeProvider extends Lookup.Provider {
31
32     /**
33      * Returns the UI name of the LibraryType.
34      * This name is used in the UI while the libraryType is used as a system
35      * identifier.
36      * @return String the display name
37      */

38     public String JavaDoc getDisplayName ();
39
40     /**
41      * Get a unique identifier for the library type.
42      * For example, <code>j2se</code>.
43      * @return the unique library type identifier, never null
44      */

45     public String JavaDoc getLibraryType ();
46
47     /**
48      * Get identifiers for the volume types supported by the libraries created by this provider.
49      * For example, <code>classpath</code>, <code>javadoc</code>, or <code>src</code>.
50      * @return support volume type identifiers, never null, may be an empty array.
51      */

52     public String JavaDoc[] getSupportedVolumeTypes ();
53
54     /**
55      * Creates a new empty library implementation.
56      * @return the created library model, never null
57      */

58     public LibraryImplementation createLibrary ();
59
60
61     /**
62      * This method is called by the libraries framework when the library was deleted.
63      * If the LibraryTypeProvider implementation requires clean of
64      * additional settings (e.g. remove properties in the build.properties)
65      * it should be done in this method.
66      * @param libraryImpl
67      */

68     public void libraryDeleted (LibraryImplementation libraryImpl);
69
70
71     /**
72      * This method is called by the libraries framework when the library was created
73      * and fully initialized (all its properties have to be read).
74      * If the LibraryTypeProvider implementation requires initialization of
75      * additional settings (e.g. adding properties into the build.properties)
76      * it should be done in this method.
77      *
78      */

79     public void libraryCreated (LibraryImplementation libraryImpl);
80
81     /**
82      * Returns customizer for given volume's type.
83      * The object of the LibraryImplementation type is
84      * passed to the customizer's setObject method.
85      * The customized object describes the library created by this
86      * provider, but the customizer cannot assume that the customized
87      * object is of the same type as the object created by {@link #createLibrary}.
88      * @param volumeType a type of volume listed in {@link #getSupportedVolumeTypes}
89      * @return a customizer (must extend {@link javax.swing.JComponent})
90      */

91     public Customizer JavaDoc getCustomizer (String JavaDoc volumeType);
92     
93 }
94
Popular Tags