Skip to content

Commit c22dbac

Browse files
Merge pull request apache#8427 from NicolaIsotta/pf-ns
add new PrimeFaces and OmniFaces namespaces
2 parents 5780a4c + 6658b75 commit c22dbac

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

enterprise/web.jsf.editor/src/org/netbeans/modules/web/jsf/editor/facelets/FaceletsLibrarySupport.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,13 @@ public Enumeration<URL> findResources(String name) throws IOException {
404404

405405
Map<String, Library> libsMap = new HashMap<>();
406406
for (Library lib : processor.compiler.libraries) {
407-
lib.getValidNamespaces().forEach(namespace -> libsMap.put(namespace, lib));
407+
for (String namespace : lib.getValidNamespaces()) {
408+
Library currentLibrary = libsMap.get(namespace);
409+
// replace the current library only if the new one supports more namespaces
410+
if (currentLibrary == null || currentLibrary.getValidNamespaces().size() < lib.getValidNamespaces().size()) {
411+
libsMap.put(namespace, lib);
412+
}
413+
}
408414
}
409415

410416
//4. in case of JSF2.2 include pseudo-libraries (http://java.sun.com/jsf/passthrough, http://java.sun.com/jsf)

enterprise/web.jsfapi/src/org/netbeans/modules/web/jsfapi/api/DefaultLibraryInfo.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public enum DefaultLibraryInfo implements LibraryInfo {
8484
// PrimeFaces
8585
PRIMEFACES(
8686
sortedSet(
87+
"primefaces",
8788
"http://primefaces.org/ui"
8889
),
8990
"PrimeFaces",
@@ -96,6 +97,14 @@ public enum DefaultLibraryInfo implements LibraryInfo {
9697
"PrimeFaces Mobile",
9798
"pm"
9899
), //NOI18N
100+
PRIMEFACES_EXTENSIONS(
101+
sortedSet(
102+
"primefaces.extensions",
103+
"http://primefaces.org/ui/extensions"
104+
),
105+
"PrimeFaces Extensions",
106+
"pe"
107+
), //NOI18N
99108

100109
// JSF 2.2+
101110
JSF(
@@ -113,6 +122,16 @@ public enum DefaultLibraryInfo implements LibraryInfo {
113122
),
114123
"Passthrough",
115124
"p"
125+
), //NOI18N
126+
127+
// OmniFaces
128+
OMNIFACES(
129+
sortedSet(
130+
"omnifaces",
131+
"http://omnifaces.org/ui"
132+
),
133+
"OmniFaces",
134+
"o"
116135
); //NOI18N
117136

118137
private final Set<String> allValidNamespaces;

0 commit comments

Comments
 (0)