This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/master by this push: new 320d811 Add Plugin for BootsFaces in order to support <b:dataTable (#2357) 320d811 is described below commit 320d811dabb29fd4a27a9cdfacfcdf20957a30b5 Author: Thomas Oster <ma...@thomas-oster.de> AuthorDate: Tue Oct 13 19:24:02 2020 +0200 Add Plugin for BootsFaces in order to support <b:dataTable (#2357) * Add Plugin for BootsFaces in order to support <b:dataTable * requested changes * removed empty layer.xml --- enterprise/web.bootsfaces/build.xml | 25 +++++ enterprise/web.bootsfaces/manifest.mf | 6 ++ .../web.bootsfaces/nbproject/project.properties | 18 ++++ .../nbproject/project.xml | 100 ++++++------------- .../bootsfaces/BootsFacesTagFeatureProvider.java | 108 +++++++++++++++++++++ .../modules/web/bootsfaces/Bundle.properties | 19 ++++ .../web/bootsfaces/resources/Bundle.properties | 22 +++++ enterprise/web.jsfapi/nbproject/project.xml | 1 + 8 files changed, 227 insertions(+), 72 deletions(-) diff --git a/enterprise/web.bootsfaces/build.xml b/enterprise/web.bootsfaces/build.xml new file mode 100644 index 0000000..733a522 --- /dev/null +++ b/enterprise/web.bootsfaces/build.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<project basedir="." default="build" name="enterprise/web.bootsfaces"> + <description>Builds, tests, and runs the project org.netbeans.modules.web.bootsfaces</description> + <import file="../../nbbuild/templates/projectized.xml"/> +</project> diff --git a/enterprise/web.bootsfaces/manifest.mf b/enterprise/web.bootsfaces/manifest.mf new file mode 100644 index 0000000..aecda36 --- /dev/null +++ b/enterprise/web.bootsfaces/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: org.netbeans.modules.web.bootsfaces +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/bootsfaces/resources/Bundle.properties +OpenIDE-Module-Specification-Version: 1.82 +AutoUpdate-Show-In-Client: true +OpenIDE-Module-Provides: org.netbeans.modules.web.jsf.complib diff --git a/enterprise/web.bootsfaces/nbproject/project.properties b/enterprise/web.bootsfaces/nbproject/project.properties new file mode 100644 index 0000000..0f4ec98 --- /dev/null +++ b/enterprise/web.bootsfaces/nbproject/project.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +javac.source=1.8 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/enterprise/web.jsfapi/nbproject/project.xml b/enterprise/web.bootsfaces/nbproject/project.xml similarity index 57% copy from enterprise/web.jsfapi/nbproject/project.xml copy to enterprise/web.bootsfaces/nbproject/project.xml index 6102a98..ea09ca7 100644 --- a/enterprise/web.jsfapi/nbproject/project.xml +++ b/enterprise/web.bootsfaces/nbproject/project.xml @@ -23,24 +23,15 @@ <type>org.netbeans.modules.apisupport.project</type> <configuration> <data xmlns="http://www.netbeans.org/ns/nb-module-project/3"> - <code-name-base>org.netbeans.modules.web.jsfapi</code-name-base> + <code-name-base>org.netbeans.modules.web.bootsfaces</code-name-base> <module-dependencies> <dependency> - <code-name-base>org.netbeans.api.annotations.common</code-name-base> - <build-prerequisite/> - <compile-dependency/> - <run-dependency> - <release-version>1</release-version> - <specification-version>1.17</specification-version> - </run-dependency> - </dependency> - <dependency> <code-name-base>org.netbeans.api.java.classpath</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> <release-version>1</release-version> - <specification-version>1.27</specification-version> + <specification-version>1.30</specification-version> </run-dependency> </dependency> <dependency> @@ -48,102 +39,92 @@ <build-prerequisite/> <compile-dependency/> <run-dependency> - <specification-version>1.21</specification-version> - </run-dependency> - </dependency> - <dependency> - <code-name-base>org.netbeans.modules.csl.api</code-name-base> - <build-prerequisite/> - <compile-dependency/> - <run-dependency> - <release-version>2</release-version> - <specification-version>2.10</specification-version> + <specification-version>1.24</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.netbeans.modules.csl.types</code-name-base> + <code-name-base>org.netbeans.modules.java.project</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> <release-version>1</release-version> - <specification-version>1.0</specification-version> + <specification-version>1.62</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.netbeans.modules.editor.document</code-name-base> + <code-name-base>org.netbeans.modules.project.libraries</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <specification-version>1.3</specification-version> + <release-version>1</release-version> + <specification-version>1.49</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.netbeans.modules.editor.indent</code-name-base> + <code-name-base>org.netbeans.modules.project.libraries.ui</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <release-version>2</release-version> - <specification-version>1.22</specification-version> + <release-version>1</release-version> + <specification-version>1.49</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.netbeans.modules.editor.lib</code-name-base> + <code-name-base>org.netbeans.modules.projectapi</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <release-version>3</release-version> - <specification-version>4.0</specification-version> + <release-version>1</release-version> + <specification-version>1.42</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.netbeans.modules.html.editor.lib</code-name-base> + <code-name-base>org.netbeans.modules.web.jsfapi</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <release-version>3</release-version> - <specification-version>3.0</specification-version> + <release-version>1</release-version> + <specification-version>1.14</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.netbeans.modules.parsing.api</code-name-base> + <code-name-base>org.openide.filesystems</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <release-version>1</release-version> <specification-version>9.0</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.netbeans.modules.projectapi</code-name-base> + <code-name-base>org.openide.loaders</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <release-version>1</release-version> - <specification-version>1.34</specification-version> + <specification-version>7.61</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.netbeans.modules.web.common</code-name-base> + <code-name-base>org.openide.nodes</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <specification-version>1.49</specification-version> + <specification-version>7.27</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.openide.filesystems</code-name-base> + <code-name-base>org.openide.util.ui</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <specification-version>9.0</specification-version> + <specification-version>9.3</specification-version> </run-dependency> </dependency> <dependency> - <code-name-base>org.openide.loaders</code-name-base> + <code-name-base>org.openide.util</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> - <specification-version>7.61</specification-version> + <specification-version>9.3</specification-version> </run-dependency> </dependency> <dependency> @@ -151,36 +132,11 @@ <build-prerequisite/> <compile-dependency/> <run-dependency> - <specification-version>8.5</specification-version> + <specification-version>8.13</specification-version> </run-dependency> </dependency> </module-dependencies> - <test-dependencies> - <test-type> - <name>unit</name> - <test-dependency> - <code-name-base>org.netbeans.libs.junit4</code-name-base> - <compile-dependency/> - </test-dependency> - <test-dependency> - <code-name-base>org.netbeans.modules.projectapi.nb</code-name-base> - </test-dependency> - </test-type> - </test-dependencies> - <friend-packages> - <friend>org.icesoft.netbeans.icefaces.palette</friend> - <friend>org.netbeans.modules.maven.j2ee</friend> - <friend>org.netbeans.modules.web.freeform</friend> - <friend>org.netbeans.modules.web.jsf</friend> - <friend>org.netbeans.modules.web.jsf.editor</friend> - <friend>org.netbeans.modules.web.jsf.icefaces</friend> - <friend>org.netbeans.modules.web.jsf.richfaces</friend> - <friend>org.netbeans.modules.web.jsf20</friend> - <friend>org.netbeans.modules.web.primefaces</friend> - <friend>org.netbeans.modules.web.project</friend> - <package>org.netbeans.modules.web.jsfapi.api</package> - <package>org.netbeans.modules.web.jsfapi.spi</package> - </friend-packages> + <public-packages/> </data> </configuration> </project> diff --git a/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/BootsFacesTagFeatureProvider.java b/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/BootsFacesTagFeatureProvider.java new file mode 100644 index 0000000..4bb8230 --- /dev/null +++ b/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/BootsFacesTagFeatureProvider.java @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.modules.web.bootsfaces; + +import java.util.Collection; +import java.util.Collections; +import org.netbeans.modules.web.jsfapi.api.Attribute; +import org.netbeans.modules.web.jsfapi.api.Library; +import org.netbeans.modules.web.jsfapi.api.Tag; +import org.netbeans.modules.web.jsfapi.api.TagFeature; +import org.netbeans.modules.web.jsfapi.spi.TagFeatureProvider; +import org.openide.util.lookup.ServiceProvider; + +/** + * {@link TagFeatureProvider} for BootsFaces. + * + * @author toster + */ +@ServiceProvider(service = TagFeatureProvider.class) +public class BootsFacesTagFeatureProvider implements TagFeatureProvider { + + private static final String BOOTSFACES_UI_NAMESPACE = "http://bootsfaces.net/ui"; //NOI18N + + private static final String VALUE = "value"; //NOI18N + private static final String VAR = "var"; //NOI18N + + @Override + public <T extends TagFeature> Collection<T> getFeatures(final Tag tag, Library library, Class<T> clazz) { + if (clazz.equals(TagFeature.IterableTagPattern.class)) { + final BootsFacesTagFeatureProvider.IterableTag iterableTag = resolveIterableTag(library, tag); + if (iterableTag != null) { + return Collections.singleton(clazz.cast(new TagFeature.IterableTagPattern() { + @Override + public Attribute getVariable() { + return tag.getAttribute(iterableTag.getVariableAtribute()); + } + + @Override + public Attribute getItems() { + return tag.getAttribute(iterableTag.getItemsAtribute()); + } + })); + } + + } + return Collections.emptyList(); + } + + private BootsFacesTagFeatureProvider.IterableTag resolveIterableTag(Library library, Tag tag) { + for (BootsFacesTagFeatureProvider.IterableTag iterableTag : BootsFacesTagFeatureProvider.IterableTag.values()) { + if (library.getNamespace() != null + && iterableTag.getNamespace() != null + && library.getNamespace().equalsIgnoreCase(iterableTag.getNamespace())) { + return iterableTag; + } + } + return null; + } + + private enum IterableTag { + + DATA_TABLE(BOOTSFACES_UI_NAMESPACE, "dataTable", VALUE, VAR); //NOI18N + + private final String namespace; + private final String name; + private final String itemsAtribute; + private final String variableAtribute; + + private IterableTag(String namespace, String name, String itemsAtribute, String variableAtribute) { + this.namespace = namespace; + this.name = name; + this.itemsAtribute = itemsAtribute; + this.variableAtribute = variableAtribute; + } + + public String getNamespace() { + return namespace; + } + + public String getName() { + return name; + } + + public String getItemsAtribute() { + return itemsAtribute; + } + + public String getVariableAtribute() { + return variableAtribute; + } + } +} diff --git a/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/Bundle.properties b/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/Bundle.properties new file mode 100644 index 0000000..4ecab48 --- /dev/null +++ b/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/Bundle.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +LBL_Library_Name=bootsfaces +LBL_BootsFaces_Description=a powerful and lightweight JSF framework based on Bootstrap 3 and jQuery UI that lets you develop Front-end Enterprise Applications fast and easy diff --git a/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/resources/Bundle.properties b/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/resources/Bundle.properties new file mode 100644 index 0000000..7ccebeb --- /dev/null +++ b/enterprise/web.bootsfaces/src/org/netbeans/modules/web/bootsfaces/resources/Bundle.properties @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +OpenIDE-Module-Display-Category=Java Web and EE +OpenIDE-Module-Name=BootsFaces +OpenIDE-Module-Long-Description=\ + This module fixes autocomplete in BootsFaces xhtml templates for b:dataTable and other tags which create a scoped variable +OpenIDE-Module-Short-Description=BootsFaces + diff --git a/enterprise/web.jsfapi/nbproject/project.xml b/enterprise/web.jsfapi/nbproject/project.xml index 6102a98..40e2969 100644 --- a/enterprise/web.jsfapi/nbproject/project.xml +++ b/enterprise/web.jsfapi/nbproject/project.xml @@ -177,6 +177,7 @@ <friend>org.netbeans.modules.web.jsf.richfaces</friend> <friend>org.netbeans.modules.web.jsf20</friend> <friend>org.netbeans.modules.web.primefaces</friend> + <friend>org.netbeans.modules.web.bootsfaces</friend> <friend>org.netbeans.modules.web.project</friend> <package>org.netbeans.modules.web.jsfapi.api</package> <package>org.netbeans.modules.web.jsfapi.spi</package> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org For additional commands, e-mail: commits-help@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists