Added
Link Here
|
1 |
/* |
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 |
* |
4 |
* Copyright 2010 Oracle and/or its affiliates. All rights reserved. |
5 |
* |
6 |
* Oracle and Java are registered trademarks of Oracle and/or its affiliates. |
7 |
* Other names may be trademarks of their respective owners. |
8 |
* |
9 |
* The contents of this file are subject to the terms of either the GNU |
10 |
* General Public License Version 2 only ("GPL") or the Common |
11 |
* Development and Distribution License("CDDL") (collectively, the |
12 |
* "License"). You may not use this file except in compliance with the |
13 |
* License. You can obtain a copy of the License at |
14 |
* http://www.netbeans.org/cddl-gplv2.html |
15 |
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the |
16 |
* specific language governing permissions and limitations under the |
17 |
* License. When distributing the software, include this License Header |
18 |
* Notice in each file and include the License file at |
19 |
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this |
20 |
* particular file as subject to the "Classpath" exception as provided |
21 |
* by Oracle in the GPL Version 2 section of the License file that |
22 |
* accompanied this code. If applicable, add the following below the |
23 |
* License Header, with the fields enclosed by brackets [] replaced by |
24 |
* your own identifying information: |
25 |
* "Portions Copyrighted [year] [name of copyright owner]" |
26 |
* |
27 |
* If you wish your version of this file to be governed by only the CDDL |
28 |
* or only the GPL Version 2, indicate your decision by adding |
29 |
* "[Contributor] elects to include this software in this distribution |
30 |
* under the [CDDL or GPL Version 2] license." If you do not indicate a |
31 |
* single choice of license, a recipient has the option to distribute |
32 |
* your version of this file under either the CDDL, the GPL Version 2 or |
33 |
* to extend the choice of license to its licensees as provided above. |
34 |
* However, if you add GPL Version 2 code and therefore, elected the GPL |
35 |
* Version 2 license, then the option applies only if the new code is |
36 |
* made subject to such option by the copyright holder. |
37 |
* |
38 |
* Contributor(s): |
39 |
* |
40 |
* Portions Copyrighted 2010 Sun Microsystems, Inc. |
41 |
*/ |
42 |
|
43 |
package org.netbeans.modules.web.jsfapi.spi.components; |
44 |
|
45 |
import java.util.Set; |
46 |
import org.netbeans.modules.web.api.webmodule.WebModule; |
47 |
import org.netbeans.modules.web.jsfapi.api.JSFVersion; |
48 |
import org.openide.filesystems.FileObject; |
49 |
|
50 |
/** |
51 |
* This interface allows providing support for JSF component libraries. It can be used |
52 |
* to extend a web module and JSF framework with a JSF suite, to find out whether a web |
53 |
* module is already extended by a JSF component library, or to retrieve a JSF suite's |
54 |
* specific configuration thru the {@link JsfComponentCustomizer}. |
55 |
* |
56 |
* <p>Instances of this class are registered in the {@value |
57 |
* org.netbeans.modules.web.jsfapi.spi.components.JsfComponentProvider#COMPONENTS_PATH} |
58 |
* in the module layer, see {@link Registration}.</p> |
59 |
* |
60 |
* @author Martin Fousek <marfous@netbeans.org> |
61 |
*/ |
62 |
public interface JsfComponentImplementation { |
63 |
|
64 |
/** |
65 |
* Returns the name of this JSF component library. |
66 |
* |
67 |
* @return the name; never {@code null}. |
68 |
*/ |
69 |
public String getName(); |
70 |
|
71 |
/** |
72 |
* Returns the description of this JSF component library. |
73 |
* |
74 |
* @return the description. |
75 |
*/ |
76 |
public String getDescription(); |
77 |
|
78 |
/** |
79 |
* Called to extend the given web module and JSF framework with the JSF |
80 |
* component library corresponding to this implementation. |
81 |
* |
82 |
* @param webModule the web module to be extended; never null. |
83 |
* @return the set of newly created files in the web module which should be opened. |
84 |
*/ |
85 |
public Set<FileObject> extend(WebModule webModule); |
86 |
|
87 |
/** |
88 |
* Returns for which version is the JSF component library designated. |
89 |
* <p> |
90 |
* By creating new project and choosing JSF framework are JSF suites filtered |
91 |
* out according to their {@link JSFVersion}. |
92 |
* |
93 |
* @return {@link JSFVersion} suitable for this JSF component library. |
94 |
*/ |
95 |
public JSFVersion getJsfVersion(); |
96 |
|
97 |
|
98 |
/** |
99 |
* Finds out if a given web module has already been extended with this JSF component library. |
100 |
* <p> |
101 |
* <b>This method should be as fast as possible.</b> |
102 |
* |
103 |
* @param webmodule the web module; never {@code null}. |
104 |
* @return {@code true} if the web module has already been extended with this JSF suite, |
105 |
* {@code false} otherwise. |
106 |
*/ |
107 |
public boolean isInWebModule(WebModule webModule); |
108 |
|
109 |
/** |
110 |
* Creates a {@link JsfComponentCustomizer} for this JSF component |
111 |
* library. |
112 |
* <p> |
113 |
* For new project is called with {@code null} parameter. In project customizer is called for |
114 |
* actual {@link WebModule}. |
115 |
* |
116 |
* @param webmodule the web module for which should be customizer adapted; null if the |
117 |
* project doesn't exist yet |
118 |
* @return a new customizer; can be <code>null</code> if the JSF suite doesn't |
119 |
* support that and no extending panel should be offered. |
120 |
*/ |
121 |
public JsfComponentCustomizer createJsfComponentCustomizer(WebModule webModule); |
122 |
|
123 |
/** |
124 |
* Performs actions needed for removal JSF component library form the web module. |
125 |
* |
126 |
* @param webModule the web module from which should be JSF component library removed; never null. |
127 |
*/ |
128 |
public void remove(WebModule webModule); |
129 |
|
130 |
} |