KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > deployment > common > api > J2eeLibraryTypeProvider


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.modules.j2ee.deployment.common.api;
21
22 import java.beans.Customizer JavaDoc;
23 import org.netbeans.spi.project.libraries.LibraryImplementation;
24 import org.netbeans.spi.project.libraries.LibraryTypeProvider;
25 import org.netbeans.spi.project.libraries.support.LibrariesSupport;
26 import org.openide.util.Lookup;
27 import org.openide.util.NbBundle;
28
29 /**
30  * The J2eeLibraryTypeProvider defines a j2ee library type and is responsible for
31  * creating new libraries of this type.
32  *
33  * @author Stepan Herold
34  * @since 1.5
35  */

36 public final class J2eeLibraryTypeProvider implements LibraryTypeProvider {
37     
38     /** J2ee library type */
39     public static final String JavaDoc LIBRARY_TYPE = "j2ee"; //NOI18N
40

41     /** Classpath volume type */
42     public static final String JavaDoc VOLUME_TYPE_CLASSPATH = "classpath"; //NOI18N
43
/** Source volume type */
44     public static final String JavaDoc VOLUME_TYPE_SRC = "src"; //NOI18N
45
/** Javadoc volume type */
46     public static final String JavaDoc VOLUME_TYPE_JAVADOC = "javadoc"; //NOI18N
47

48     public static final String JavaDoc[] VOLUME_TYPES = new String JavaDoc[] {
49         VOLUME_TYPE_CLASSPATH,
50         VOLUME_TYPE_SRC,
51         VOLUME_TYPE_JAVADOC
52     };
53
54     
55     /** Creates a new instance of J2eeLibraryTypeProvider */
56     public J2eeLibraryTypeProvider() {
57     }
58     
59     /**
60      * Returns the UI name of the LibraryType.
61      * This name is used in the UI while the libraryType is used as a system
62      * identifier.
63      * @return String the display name
64      */

65     public String JavaDoc getDisplayName() {
66         return NbBundle.getMessage(J2eeLibraryTypeProvider.class,"TXT_J2eeLibraryType"); //NOI18N
67
}
68
69     /**
70      * Get a j2ee library type identifier.
71      *
72      * @return the j2ee library type identifier.
73      */

74     public String JavaDoc getLibraryType() {
75         return LIBRARY_TYPE;
76     }
77
78     /**
79      * Return supported volume types: <code>classpath</code>, <code>javadoc</code>,
80      * <code>src</code>.
81      *
82      * @return support volume types.
83      */

84     public String JavaDoc[] getSupportedVolumeTypes() {
85         return VOLUME_TYPES;
86     }
87
88     /**
89      * Creates a new implementation of j2ee library type.
90      *
91      * @return the created library model, never null
92      */

93     public LibraryImplementation createLibrary() {
94         return LibrariesSupport.createLibraryImplementation(LIBRARY_TYPE, VOLUME_TYPES);
95     }
96
97     /**
98      * Does nothing now.
99      */

100     public void libraryDeleted(LibraryImplementation libraryImpl) {
101     }
102
103     /**
104      * Does nothing now.
105      */

106     public void libraryCreated(LibraryImplementation libraryImpl) {
107     }
108
109     /**
110      * Currently returns <code>null</code>.
111      */

112     public Customizer JavaDoc getCustomizer(String JavaDoc volumeType) {
113         return null;
114     }
115     
116     /**
117      * Returns empty lookup.
118      * @return empty lookup.
119      */

120     public Lookup getLookup() {
121         return Lookup.EMPTY;
122     }
123 }
124
Popular Tags