JBoss Rich Faces SVN: r17196 - root/ui/core/trunk/api/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-23 15:47:46 -0400 (Sun, 23 May 2010)
New Revision: 17196
Modified:
root/ui/core/trunk/api/src/main/java/org/richfaces/component/AbstractAttachQueue.java
root/ui/core/trunk/api/src/main/java/org/richfaces/component/AbstractQueue.java
Log:
Queue redesign & fixes
Modified: root/ui/core/trunk/api/src/main/java/org/richfaces/component/AbstractAttachQueue.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/component/AbstractAttachQueue.java 2010-05-23 19:46:04 UTC (rev 17195)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/component/AbstractAttachQueue.java 2010-05-23 19:47:46 UTC (rev 17196)
@@ -54,6 +54,8 @@
public static final String COMPONENT_TYPE = "org.richfaces.AttachQueue";
+ public static final String COMPONENT_FAMILY = "org.richfaces.AttachQueue";
+
public static final String QUEUE_ID_ATTRIBUTE = "queueId";
private transient List<UIComponent> componentsToAssociate;
@@ -83,7 +85,7 @@
@Override
public String getFamily() {
- return null;
+ return COMPONENT_FAMILY;
}
private static void immediateAssociateWith(UIComponent component, String queueId) {
Modified: root/ui/core/trunk/api/src/main/java/org/richfaces/component/AbstractQueue.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/component/AbstractQueue.java 2010-05-23 19:46:04 UTC (rev 17195)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/component/AbstractQueue.java 2010-05-23 19:47:46 UTC (rev 17196)
@@ -21,13 +21,13 @@
*/
package org.richfaces.component;
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
-import javax.faces.component.UIComponentBase;
-
/**
* @author Nick Belaevski
*
@@ -74,4 +74,7 @@
@Attribute
public abstract boolean isIgnoreDupResponses();
+
+ @Attribute
+ public abstract String getName();
}
15 years, 7 months
JBoss Rich Faces SVN: r17195 - root.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-23 15:46:04 -0400 (Sun, 23 May 2010)
New Revision: 17195
Modified:
root/pom.xml
Log:
https://jira.jboss.org/browse/RF-7983
Modified: root/pom.xml
===================================================================
--- root/pom.xml 2010-05-23 19:45:36 UTC (rev 17194)
+++ root/pom.xml 2010-05-23 19:46:04 UTC (rev 17195)
@@ -36,7 +36,8 @@
<module>commons/${commons.svn.dir}</module>
<module>core/${core.svn.dir}</module>
<module>cdk/${cdk.svn.dir}</module>
- <module>ui/core/${ui.svn.dir}</module>
+ <module>ui/core/${ui.core.svn.dir}</module>
+ <module>ui/misc/${ui.misc.svn.dir}</module>
<!--<module>ui-sandbox</module>-->
<module>examples</module>
<!--<module>examples-sandbox/${examples-sandbox.svn.dir}</module>-->
@@ -59,7 +60,8 @@
<core.svn.dir>trunk</core.svn.dir>
<commons.svn.dir>trunk</commons.svn.dir>
<cdk.svn.dir>trunk</cdk.svn.dir>
- <ui.svn.dir>trunk</ui.svn.dir>
+ <ui.core.svn.dir>trunk</ui.core.svn.dir>
+ <ui.misc.svn.dir>trunk</ui.misc.svn.dir>
<ui-sandbox.svn.dir>trunk</ui-sandbox.svn.dir>
<examples-sandbox.svn.dir>trunk</examples-sandbox.svn.dir>
<doc.svn.dir>trunk</doc.svn.dir>
15 years, 7 months
JBoss Rich Faces SVN: r17194 - root/ui/misc/trunk/ui/src/main/java/org/richfaces/function.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-23 15:45:36 -0400 (Sun, 23 May 2010)
New Revision: 17194
Modified:
root/ui/misc/trunk/ui/src/main/java/org/richfaces/function/RichFunction.java
Log:
https://jira.jboss.org/browse/RF-7983
Modified: root/ui/misc/trunk/ui/src/main/java/org/richfaces/function/RichFunction.java
===================================================================
--- root/ui/misc/trunk/ui/src/main/java/org/richfaces/function/RichFunction.java 2010-05-23 19:40:45 UTC (rev 17193)
+++ root/ui/misc/trunk/ui/src/main/java/org/richfaces/function/RichFunction.java 2010-05-23 19:45:36 UTC (rev 17194)
@@ -24,12 +24,12 @@
import java.util.Set;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils;
+import org.richfaces.cdk.annotations.Function;
/**
* Created 20.03.2008
@@ -37,15 +37,22 @@
* @since 3.2
*/
-public class RichFunction {
+public final class RichFunction {
+ private RichFunction() {
+ //utility class constructor
+ }
+
private static UIComponent findComponent(FacesContext context, String id) {
if (id != null) {
if (context != null) {
- UIViewRoot root = context.getViewRoot();
+ UIComponent contextComponent = UIComponent.getCurrentComponent(context);
+ if (contextComponent == null) {
+ contextComponent = context.getViewRoot();
+ }
- if (root != null) {
- UIComponent component = RendererUtils.getInstance().findComponentFor(root, id);
+ if (contextComponent != null) {
+ UIComponent component = RendererUtils.getInstance().findComponentFor(contextComponent, id);
if (component != null) {
return component;
@@ -57,21 +64,24 @@
return null;
}
+ @Function
public static String clientId(String id) {
FacesContext context = FacesContext.getCurrentInstance();
UIComponent component = findComponent(context, id);
return component != null ? component.getClientId(context) : null;
}
+ @Function
public static String component(String id) {
String element = element(id);
if (element != null) {
- return element + ".component";
+ return "jQuery.RichFaces.$(" + clientId(id) + ")";
}
return null;
}
+ @Function
public static String element(String id) {
String clientId = clientId(id);
if (clientId != null) {
@@ -81,6 +91,7 @@
return null;
}
+ @Function
public static UIComponent findComponent(String id) {
return findComponent(FacesContext.getCurrentInstance(), id);
}
@@ -90,7 +101,9 @@
* @param rolesObject
* @return
*/
+ @Function
public static boolean isUserInRole(Object rolesObject) {
+ //TODO nick - AjaxRendererUtils split text by commas and whitespace, what is the right variant?
Set<String> rolesSet = AjaxRendererUtils.asSet(rolesObject);
if (rolesSet != null) {
FacesContext facesContext = FacesContext.getCurrentInstance();
15 years, 7 months
JBoss Rich Faces SVN: r17193 - in root/ui: misc and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-23 15:40:45 -0400 (Sun, 23 May 2010)
New Revision: 17193
Added:
root/ui/misc/
root/ui/misc/branches/
root/ui/misc/tags/
root/ui/misc/trunk/
root/ui/misc/trunk/bom/
root/ui/misc/trunk/bom/pom.xml
root/ui/misc/trunk/lgpl.txt
root/ui/misc/trunk/parent/
root/ui/misc/trunk/parent/pom.xml
root/ui/misc/trunk/pom.xml
root/ui/misc/trunk/readme.txt
root/ui/misc/trunk/ui/
root/ui/misc/trunk/ui/pom.xml
root/ui/misc/trunk/ui/src/
root/ui/misc/trunk/ui/src/main/
root/ui/misc/trunk/ui/src/main/java/
root/ui/misc/trunk/ui/src/main/java/org/
Log:
https://jira.jboss.org/browse/RF-7983
Added: root/ui/misc/trunk/bom/pom.xml
===================================================================
--- root/ui/misc/trunk/bom/pom.xml (rev 0)
+++ root/ui/misc/trunk/bom/pom.xml 2010-05-23 19:40:45 UTC (rev 17193)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>2-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-misc-bom</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: Miscellanous BOM</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <richfaces.core.api.version>4.0.0-SNAPSHOT</richfaces.core.api.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-bom</artifactId>
+ <version>${richfaces.core.api.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-misc-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
Added: root/ui/misc/trunk/lgpl.txt
===================================================================
--- root/ui/misc/trunk/lgpl.txt (rev 0)
+++ root/ui/misc/trunk/lgpl.txt 2010-05-23 19:40:45 UTC (rev 17193)
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Added: root/ui/misc/trunk/parent/pom.xml
===================================================================
--- root/ui/misc/trunk/parent/pom.xml (rev 0)
+++ root/ui/misc/trunk/parent/pom.xml 2010-05-23 19:40:45 UTC (rev 17193)
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>2-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-misc-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: Miscellanous Parent</name>
+ <packaging>pom</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-misc-bom</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <version>1.0-beta-2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added: root/ui/misc/trunk/pom.xml
===================================================================
--- root/ui/misc/trunk/pom.xml (rev 0)
+++ root/ui/misc/trunk/pom.xml 2010-05-23 19:40:45 UTC (rev 17193)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>2-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-misc-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: Miscellanous Aggregator</name>
+
+ <modules>
+ <module>bom</module>
+ <module>parent</module>
+ <module>ui</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Added: root/ui/misc/trunk/readme.txt
===================================================================
Added: root/ui/misc/trunk/ui/pom.xml
===================================================================
--- root/ui/misc/trunk/ui/pom.xml (rev 0)
+++ root/ui/misc/trunk/ui/pom.xml 2010-05-23 19:40:45 UTC (rev 17193)
@@ -0,0 +1,113 @@
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-misc-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-misc-ui</artifactId>
+ <name>Richfaces UI Components: Miscellanous UI</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <!-- runtime -->
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <!-- todo remove this dependency or move to test scope -->
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JSF with dependencies -->
+ <dependency>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- tests -->
+ <dependency>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <!-- todo api? -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>htmlunit-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Copied: root/ui/misc/trunk/ui/src/main/java/org (from rev 16894, branches/community/3.3.X/ui/functions/src/main/java/org)
15 years, 7 months
JBoss Rich Faces SVN: r17192 - in root: core/trunk/impl/src/main/java/org/ajax4jsf/renderkit and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-23 13:53:50 -0400 (Sun, 23 May 2010)
New Revision: 17192
Added:
root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java
root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueueRegistry.java
root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java
root/ui/core/trunk/api/src/main/resources/META-INF/queue-prender-listener.faces-config.xml
root/ui/core/trunk/api/src/test/resources/org/richfaces/component/nonQueue.xhtml
root/ui/core/trunk/api/src/test/resources/org/richfaces/component/queue.xhtml
Removed:
root/core/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java
root/core/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java
root/core/trunk/impl/src/main/resources/META-INF/prerenderview-listener.faces-config.xml
root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/nonQueue.xhtml
root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/queue.xhtml
Modified:
root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java
root/ui/core/trunk/api/src/test/java/org/richfaces/component/QueueRendererTest.java
Log:
Queue redesign & fixes
Deleted: root/core/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java 2010-05-22 00:13:51 UTC (rev 17191)
+++ root/core/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java 2010-05-23 17:53:50 UTC (rev 17192)
@@ -1,78 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Nick Belaevski
- * @since 3.3.0
- */
-public final class QueueRegistry {
- private static final String REGISTRY_ATTRIBUTE_NAME = QueueRegistry.class.getName();
- private Map<String, Object> queuesData = new LinkedHashMap<String, Object>();
- private QueueRegistry() {
- }
-
- public static QueueRegistry getInstance(FacesContext context) {
- ExternalContext externalContext = context.getExternalContext();
- Map<String, Object> requestMap = externalContext.getRequestMap();
- QueueRegistry registry = (QueueRegistry) requestMap.get(REGISTRY_ATTRIBUTE_NAME);
-
- if (registry == null) {
- registry = new QueueRegistry();
- requestMap.put(REGISTRY_ATTRIBUTE_NAME, registry);
- }
-
- return registry;
- }
-
- public void registerQueue(FacesContext context, String clientName, Object data) {
- if (!containsQueue(clientName)) {
- queuesData.put(clientName, data);
- }else{
- context.getExternalContext().log("Queue with name '" + clientName + "' has already been registered");
- }
- }
-
- public void removeQueue(FacesContext context, String clientName) {
- if (!containsQueue(clientName)) {
- queuesData.remove(clientName);
- }
- }
-
- public boolean containsQueue(String name) {
- return queuesData.containsKey(name);
- }
-
- public Map<String, Object> getRegisteredQueues(FacesContext context) {
- return queuesData;
- }
-
- public boolean hasQueuesToEncode() {
- return !queuesData.isEmpty();
- }
-}
\ No newline at end of file
Modified: root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2010-05-22 00:13:51 UTC (rev 17191)
+++ root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2010-05-23 17:53:50 UTC (rev 17192)
@@ -1274,5 +1274,9 @@
public static final String VALIGN_ATTRIBUTE = "valign";
public static final String VALUE_ATTRIBUTE = "value";
public static final String WIDTH_ATTRIBUTE = "width";
+
+ public static final String REL_STYLESHEET = "stylesheet";
+ public static final String CSS_TYPE = "text/css";
+ public static final String JAVASCRIPT_TYPE = "text/javascript";
}
}
Deleted: root/core/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java 2010-05-22 00:13:51 UTC (rev 17191)
+++ root/core/trunk/impl/src/main/java/org/richfaces/context/PreRenderViewListener.java 2010-05-23 17:53:50 UTC (rev 17192)
@@ -1,190 +0,0 @@
-package org.richfaces.context;
-
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIOutput;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.PreRenderViewEvent;
-import javax.faces.event.SystemEvent;
-import javax.faces.event.SystemEventListener;
-
-import org.ajax4jsf.component.QueueRegistry;
-import org.ajax4jsf.javascript.ScriptUtils;
-
-/**
- * This class used for determining what standard resources should be encoded(queue, skinning etc.). Implements SystemEventListener
- * and reacts on PreRenderViewEvent
- *
- * @author amarkhel
- * @since 4.0
- */
-public class PreRenderViewListener implements SystemEventListener {
-
- private static final String MARKER_ATTRIBBUTE = "marker";
-
- private static final String FUNCTION_END = ");";
-
- private static final String FUNCTION_NAME = "RichFaces.queue.setQueueOptions(";
-
- private static final String SCRIPT_END = "</script>";
-
- private static final String SCRIPT_START = "<script type=\"text/javascript\">";
-
- private static final String QUEUE_RESOURCE = "richFacesQueueResource";
-
- private static final String VALUE_ATTRIBBUTE = "value";
-
- private static final String HEAD = "head";
-
- private static final String NAME_ATTRIBBUTE = "name";
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.event.SystemEventListener#isListenerForSource(java.lang.Object)
- */
- public boolean isListenerForSource(Object source) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.event.SystemEventListener#processEvent(javax.faces.event.SystemEvent)
- */
- public void processEvent(SystemEvent event) throws AbortProcessingException {
-
- if (event instanceof PreRenderViewEvent) {
- encodeQueueResource();
- }
- }
-
- private void encodeQueueResource() {
- FacesContext context = FacesContext.getCurrentInstance();
- if (QueueRegistry.getInstance(context).hasQueuesToEncode()) {
- StringBuilder sb = constructQueueScript(context);
- addQueueResourceToView(context, sb);
- }
- }
-
- private void addQueueResourceToView(FacesContext context, StringBuilder sb) {
- removeComponentResource(context, QUEUE_RESOURCE);
- HashMap<String, Object> hashMap = new HashMap<String, Object>();
- hashMap.put(MARKER_ATTRIBBUTE, QUEUE_RESOURCE);
- hashMap.put(VALUE_ATTRIBBUTE, sb.toString());
- addComponentResource(context, hashMap, null);
- }
-
- private StringBuilder constructQueueScript(FacesContext context) {
- StringBuilder sb = new StringBuilder(1024);
- sb.append(SCRIPT_START);
- sb.append(FUNCTION_NAME);
- sb.append("{");
- addParameter(context, sb);
- sb.append("}");
- sb.append(FUNCTION_END);
- sb.append(SCRIPT_END);
- return sb;
- }
-
- private void addParameter(FacesContext context, StringBuilder sb) {
- Map<String, Object> registeredQueues = QueueRegistry.getInstance(context).getRegisteredQueues(context);
- boolean firstElementAdded = false;
- for (Map.Entry<String, Object> queue : registeredQueues.entrySet()) {
- UIComponent queueComp = (UIComponent) queue.getValue();
- firstElementAdded = appendQueueName(sb, firstElementAdded, queue);
- appendQueueOptions(sb, queueComp);
- }
- }
-
- private void appendQueueOptions(StringBuilder sb, UIComponent queueComp) {
- boolean firstAttribbuteAdded = false;
- for (QueueOptions queueOption : QueueOptions.values()) {
- String attribbute = queueOption.name();
- if (shouldRenderOption(queueComp, attribbute)) {
- if (firstAttribbuteAdded) {
- sb.append(",");
- } else {
- firstAttribbuteAdded = true;
- }
- sb.append(attribbute);
- sb.append(":'");
- sb.append(queueComp.getAttributes().get(attribbute));
- sb.append("'");
- }
- }
- sb.append("}");
- }
-
- private boolean shouldRenderOption(UIComponent queueComp, String attribbute) {
- return queueComp.getAttributes().get(attribbute) != null
- && ScriptUtils.shouldRenderAttribute(attribbute, queueComp.getAttributes().get(attribbute));
- }
-
- private boolean appendQueueName(StringBuilder sb, boolean firstElementAdded, Map.Entry<String, Object> queue) {
- if (firstElementAdded) {
- sb.append(",");
- } else {
- firstElementAdded = true;
- }
- sb.append("'");
- sb.append(queue.getKey());
- sb.append("'");
- sb.append(":{");
- return firstElementAdded;
- }
-
- private void addComponentResource(FacesContext context, Map<String, Object> params, String rendererType){
- UIOutput output = new UIOutput();
- if(rendererType != null){
- output.setRendererType(rendererType);
- }
- for(Map.Entry<String, Object> parameter : params.entrySet()){
- output.getAttributes().put(parameter.getKey(), parameter.getValue());
- }
- context.getViewRoot().addComponentResource(context, output, HEAD);
- }
-
- private void removeComponentResource(FacesContext context, String resourceId){
- List<UIComponent> result = context.getViewRoot().getComponentResources(context, HEAD);
- for (UIComponent resource : result) {
- if(resource.getAttributes().get(MARKER_ATTRIBBUTE) != null){
- String resourceName = resource.getAttributes().get(MARKER_ATTRIBBUTE).toString();
- if (resourceName.equals(resourceId)) {
- context.getViewRoot().removeComponentResource(context, resource, HEAD);
- break;
- }
- }
- }
- }
- protected static enum QueueOptions {
- onbeforedomupdate, oncomplete, onerror, onevent, onrequestdequeue, onrequestqueue, onsubmit, requestDelay, timeout, status, queueId, ignoreDupResponses, requestGroupingId
-
- }
-
-}
\ No newline at end of file
Deleted: root/core/trunk/impl/src/main/resources/META-INF/prerenderview-listener.faces-config.xml
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/prerenderview-listener.faces-config.xml 2010-05-22 00:13:51 UTC (rev 17191)
+++ root/core/trunk/impl/src/main/resources/META-INF/prerenderview-listener.faces-config.xml 2010-05-23 17:53:50 UTC (rev 17192)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faces-config xmlns="http://java.sun.com/xml/ns/javaee" version="2.0">
- <name>richfaces</name>
- <application>
- <system-event-listener>
- <system-event-listener-class>org.richfaces.context.PreRenderViewListener</system-event-listener-class>
- <system-event-class>javax.faces.event.PreRenderViewEvent</system-event-class>
- </system-event-listener>
- </application>
-
-</faces-config>
\ No newline at end of file
Added: root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java (rev 0)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java 2010-05-23 17:53:50 UTC (rev 17192)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.SystemEvent;
+import javax.faces.event.SystemEventListener;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class QueuePreRenderViewListener implements SystemEventListener {
+
+ private static final String HEAD = "head";
+
+ private static final String QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE = "org.richfaces.QueueResourceComponentRenderer";
+
+ public boolean isListenerForSource(Object source) {
+ return true;
+ }
+
+ public void processEvent(SystemEvent event) throws AbortProcessingException {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIViewRoot viewRoot = context.getViewRoot();
+ List<UIComponent> resources = viewRoot.getComponentResources(context, HEAD);
+
+ boolean resourceExists = false;
+ for (UIComponent resourceComponent : resources) {
+ if (QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE.equals(resourceComponent.getRendererType()) &&
+ UIOutput.COMPONENT_FAMILY.equals(resourceComponent.getFamily())) {
+
+ resourceExists = true;
+ break;
+ }
+ }
+
+ if (!resourceExists) {
+ UIComponent queueResourceComponent = context.getApplication().createComponent(UIOutput.COMPONENT_TYPE);
+ queueResourceComponent.setRendererType(QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE);
+
+ viewRoot.addComponentResource(context, queueResourceComponent);
+ }
+ }
+
+}
Copied: root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueueRegistry.java (from rev 17186, root/core/trunk/impl/src/main/java/org/ajax4jsf/component/QueueRegistry.java)
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueueRegistry.java (rev 0)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueueRegistry.java 2010-05-23 17:53:50 UTC (rev 17192)
@@ -0,0 +1,88 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public final class QueueRegistry {
+
+ public static final String QUEUE_SCRIPT_CLIENT_ID = "org.richfaces.queue";
+
+ private static final Logger LOGGER = RichfacesLogger.COMPONENTS.getLogger();
+
+ private static final String REGISTRY_ATTRIBUTE_NAME = QueueRegistry.class.getName();
+ private Map<String, UIComponent> queuesData = new LinkedHashMap<String, UIComponent>();
+
+ private QueueRegistry() {
+ }
+
+ public static QueueRegistry getInstance(FacesContext context) {
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, Object> requestMap = externalContext.getRequestMap();
+ QueueRegistry registry = (QueueRegistry) requestMap.get(REGISTRY_ATTRIBUTE_NAME);
+
+ if (registry == null) {
+ registry = new QueueRegistry();
+ requestMap.put(REGISTRY_ATTRIBUTE_NAME, registry);
+ }
+
+ return registry;
+ }
+
+ public void registerQueue(String clientName, UIComponent component) {
+ if (!containsQueue(clientName)) {
+ queuesData.put(clientName, component);
+ } else {
+ LOGGER.warn("Queue with name '" + clientName + "' has already been registered");
+ }
+ }
+
+ public void removeQueue(String clientName) {
+ if (!containsQueue(clientName)) {
+ queuesData.remove(clientName);
+ }
+ }
+
+ public boolean containsQueue(String name) {
+ return queuesData.containsKey(name);
+ }
+
+ public Map<String, UIComponent> getRegisteredQueues() {
+ return queuesData;
+ }
+
+ public boolean hasQueuesToEncode() {
+ return !queuesData.isEmpty();
+ }
+}
\ No newline at end of file
Modified: root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java 2010-05-22 00:13:51 UTC (rev 17191)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java 2010-05-23 17:53:50 UTC (rev 17192)
@@ -35,9 +35,9 @@
import javax.faces.event.PreRemoveFromViewEvent;
import javax.faces.render.Renderer;
-import org.ajax4jsf.component.QueueRegistry;
import org.ajax4jsf.context.ContextInitParameters;
import org.richfaces.component.AbstractQueue;
+import org.richfaces.component.QueueRegistry;
import org.richfaces.log.RichfacesLogger;
import org.slf4j.Logger;
@@ -63,10 +63,10 @@
if (event instanceof PostAddToViewEvent) {
String name = findAndSetQueueName(comp);
if (name != null) {
- QueueRegistry.getInstance(context).registerQueue(context, name, comp);
+ QueueRegistry.getInstance(context).registerQueue(name, comp);
}
} else if (event instanceof PreRemoveFromViewEvent) {
- QueueRegistry.getInstance(context).removeQueue(context, getQueueName(comp));
+ QueueRegistry.getInstance(context).removeQueue(getQueueName(comp));
}
}
Added: root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java (rev 0)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java 2010-05-23 17:53:50 UTC (rev 17192)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.Renderer;
+
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.QueueRegistry;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@JsfRenderer(type = "org.richfaces.QueueResourceComponentRenderer", family = UIOutput.COMPONENT_FAMILY)
+public class QueueResourceComponentRenderer extends Renderer {
+
+ private static final String FUNCTION_NAME = "RichFaces.queue.setQueueOptions";
+
+ private final RendererUtils utils = RendererUtils.getInstance();
+
+ private enum QueueOptions {
+ onbeforedomupdate, oncomplete, onerror, onevent, onrequestdequeue, onrequestqueue, onsubmit,
+ requestDelay, timeout, status, queueId, ignoreDupResponses, requestGroupingId
+ }
+
+ private void appendOptions(UIComponent queue, Map<String, Object> optionsHash) {
+ Map<String, Object> attributes = queue.getAttributes();
+
+ for (QueueOptions option : QueueOptions.values()) {
+ String optionName = option.name();
+ Object value = attributes.get(optionName);
+ utils.addToScriptHash(optionsHash, optionName, value);
+ }
+ }
+
+ @Override
+ public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+ super.encodeEnd(context, component);
+
+ QueueRegistry registry = QueueRegistry.getInstance(context);
+ if (registry != null && registry.hasQueuesToEncode()) {
+ ResponseWriter writer = context.getResponseWriter();
+
+ writer.startElement(HTML.SCRIPT_ELEM, component);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE,
+ context.getExternalContext().encodeNamespace(QueueRegistry.QUEUE_SCRIPT_CLIENT_ID), null);
+ writer.writeAttribute(HTML.TYPE_ATTR, HTML.JAVASCRIPT_TYPE, null);
+
+ writer.writeText(FUNCTION_NAME, null);
+ writer.writeText("({", null);
+
+ Map<String,Object> queueOptionsMap = new LinkedHashMap<String, Object>();
+
+ boolean isFirst = true;
+ Map<String, UIComponent> registeredQueues = registry.getRegisteredQueues();
+ for (Entry<String, UIComponent> queueEntry : registeredQueues.entrySet()) {
+ if (isFirst) {
+ isFirst = false;
+ } else {
+ writer.writeText(",", null);
+ }
+
+ queueOptionsMap.clear();
+
+ String queueName = queueEntry.getKey();
+ UIComponent queue = queueEntry.getValue();
+
+ appendOptions(queue, queueOptionsMap);
+
+ ScriptUtils.writeToStream(writer, queueName);
+ writer.writeText(":", null);
+ ScriptUtils.writeToStream(writer, queueOptionsMap);
+ }
+
+ writer.writeText("});", null);
+
+ writer.endElement(HTML.SCRIPT_ELEM);
+ }
+ }
+}
Added: root/ui/core/trunk/api/src/main/resources/META-INF/queue-prender-listener.faces-config.xml
===================================================================
--- root/ui/core/trunk/api/src/main/resources/META-INF/queue-prender-listener.faces-config.xml (rev 0)
+++ root/ui/core/trunk/api/src/main/resources/META-INF/queue-prender-listener.faces-config.xml 2010-05-23 17:53:50 UTC (rev 17192)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ version="2.0">
+
+ <application>
+ <system-event-listener>
+ <system-event-listener-class>org.richfaces.component.QueuePreRenderViewListener</system-event-listener-class>
+ <system-event-class>javax.faces.event.PreRenderViewEvent</system-event-class>
+ </system-event-listener>
+ </application>
+</faces-config>
\ No newline at end of file
Modified: root/ui/core/trunk/api/src/test/java/org/richfaces/component/QueueRendererTest.java
===================================================================
--- root/ui/core/trunk/api/src/test/java/org/richfaces/component/QueueRendererTest.java 2010-05-22 00:13:51 UTC (rev 17191)
+++ root/ui/core/trunk/api/src/test/java/org/richfaces/component/QueueRendererTest.java 2010-05-23 17:53:50 UTC (rev 17192)
@@ -23,14 +23,18 @@
package org.richfaces.component;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
import org.jboss.test.faces.ApplicationServer;
import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+
+import com.gargoylesoftware.htmlunit.html.DomNode;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
/**
@@ -39,16 +43,15 @@
*/
public class QueueRendererTest{
- private static final String EXPECTED_QUEUE_SCRIPT = "'first':{requestDelay:'400',timeout:'100',ignoreDupResponses:'true'},'form':{requestDelay:'400'},'form:firstAttach':{timeout:'300',queueId:'form',requestGroupingId:'request'},'second':{requestDelay:'400',timeout:'100',ignoreDupResponses:'true'},'form:linkAttach':{timeout:'500',queueId:'second'},'form:secondAttach':{queueId:'form'}";
+ private static final String EXPECTED_QUEUE_SCRIPT = "RichFaces.queue.setQueueOptions({" +
+ "'first': {'requestDelay': 400, 'timeout': 100, 'ignoreDupResponses': true}," +
+ "'form': {'requestDelay': 400}," +
+ "'form:firstAttach': {'timeout': 300, 'queueId': 'form', 'requestGroupingId': 'request'}," +
+ "'second': {'requestDelay': 400, 'timeout': 100, 'ignoreDupResponses': true}," +
+ "'form:linkAttach': {'timeout': 500, 'queueId': 'second'}," +
+ "'form:secondAttach': {'queueId': 'form'}" +
+ "});";
- private static final String QUEUE_SCRIPT_MUST_BE_NOT_NULL = "Queue script must be not null";
-
- private static final String QUEUE_SCRIPT_MUST_BE_NULL = "Queue script must be null";
-
- private static final String SCRIPT = "</script>";
-
- private static final String RICH_FACES_QUEUE_SET_QUEUE_OPTIONS = "RichFaces.queue.setQueueOptions(";
-
protected HtmlPage page;
protected HtmlUnitEnvironment facesEnvironment;
@@ -59,8 +62,8 @@
facesEnvironment = new HtmlUnitEnvironment();
ApplicationServer facesServer = facesEnvironment.getServer();
- facesServer.addResource("/queue.xhtml", "org/ajax4jsf/component/queue.xhtml");
- facesServer.addResource("/nonQueue.xhtml", "org/ajax4jsf/component/nonQueue.xhtml");
+ facesServer.addResource("/queue.xhtml", "org/richfaces/component/queue.xhtml");
+ facesServer.addResource("/nonQueue.xhtml", "org/richfaces/component/nonQueue.xhtml");
facesEnvironment.start();
}
@@ -68,18 +71,17 @@
@After
public void tearDown() throws Exception {
this.page = null;
+
this.facesEnvironment.release();
this.facesEnvironment = null;
}
-
@Test
public void testQueue() throws Exception {
- page = renderView("/queue.jsf");
- String responseString = page.getWebResponse().getContentAsString();
- String queueScript = extractQueueScript(responseString);
- assertNotNull(queueScript, QUEUE_SCRIPT_MUST_BE_NOT_NULL);
- assertEquals(queueScript, EXPECTED_QUEUE_SCRIPT);
+ page = facesEnvironment.getPage("/queue.jsf");
+ String queueScript = extractQueueScript(page);
+ assertNotNull(queueScript, "Queue script must be not null");
+ assertEquals(dehydrate(EXPECTED_QUEUE_SCRIPT), dehydrate(queueScript));
/*String[] queueArray = queueScript.split("},");
//String[] queueNames = new String[queueArray.length];
//String[] queueOptions = new String[queueArray.length];
@@ -97,28 +99,32 @@
@Test
public void testPageWithoutQueue() throws Exception {
- page = renderView("/nonQueue.jsf");
- String responseString = page.getWebResponse().getContentAsString();
- String queueScript = extractQueueScript(responseString);
- assertNull(QUEUE_SCRIPT_MUST_BE_NULL, queueScript);
+ page = facesEnvironment.getPage("/nonQueue.jsf");
+ String queueScript = extractQueueScript(page);
+ assertNull("Queue script must be null", queueScript);
}
- private String extractQueueScript(String responseString) {
- String queueScript = null;
- if(responseString.lastIndexOf(RICH_FACES_QUEUE_SET_QUEUE_OPTIONS) != -1){
- queueScript = responseString.substring(responseString.lastIndexOf(RICH_FACES_QUEUE_SET_QUEUE_OPTIONS) + RICH_FACES_QUEUE_SET_QUEUE_OPTIONS.length() +1);
- if(queueScript.indexOf(SCRIPT) != -1){
- queueScript = queueScript.substring(0, queueScript.indexOf(SCRIPT) -3);
- }else{
- return null;
- }
+ private String dehydrate(String s) {
+ return s.replaceAll("\\s+", "");
+ }
+
+ private String getTextContent(HtmlElement element) {
+ StringBuilder sb = new StringBuilder();
+
+ for (DomNode node = element.getFirstChild(); node != null; node = node.getNextSibling()) {
+ sb.append(node.getNodeValue());
}
- return queueScript;
+
+ return sb.toString();
}
- protected HtmlPage renderView(String url) throws Exception {
- page = facesEnvironment.getPage(url);
- return page;
+ private String extractQueueScript(HtmlPage page) {
+ HtmlElement scriptElement = page.getElementById(QueueRegistry.QUEUE_SCRIPT_CLIENT_ID);
+ if (scriptElement != null) {
+ return getTextContent(scriptElement);
+ }
+ return null;
}
+
}
\ No newline at end of file
Deleted: root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/nonQueue.xhtml
===================================================================
--- root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/nonQueue.xhtml 2010-05-22 00:13:51 UTC (rev 17191)
+++ root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/nonQueue.xhtml 2010-05-23 17:53:50 UTC (rev 17192)
@@ -1,35 +0,0 @@
-<html xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
- <h:head>
- <title>Test queue page</title>
-
- <h:outputScript name="jsf.js" library="javax.faces" />
- <h:outputScript name="jquery.js" />
- <h:outputScript name="richfaces.js" />
- <h:outputScript name="richfaces-queue.js" />
-
- </h:head>
- <h:body>
- <h:form id="form">
- <a4j:ajax>
- <h:inputText />
-
- </a4j:ajax>
- <a4j:ajax event="valueChange">
- <h:panelGroup>
- <a4j:ajax event="valueChange">
- <h:inputText />
-
- <a4j:commandLink value="Link"/>
-
- </a4j:ajax>
- </h:panelGroup>
- </a4j:ajax>
- <h:commandButton value="G"/>
- </h:form>
-
- </h:body>
-</html>
\ No newline at end of file
Deleted: root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/queue.xhtml
===================================================================
--- root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/queue.xhtml 2010-05-22 00:13:51 UTC (rev 17191)
+++ root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/queue.xhtml 2010-05-23 17:53:50 UTC (rev 17192)
@@ -1,42 +0,0 @@
-<html xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
- <h:head>
- <title>Test queue page</title>
-
- <h:outputScript name="jsf.js" library="javax.faces" />
- <h:outputScript name="jquery.js" />
- <h:outputScript name="richfaces.js" />
- <h:outputScript name="richfaces-queue.js" />
-
- </h:head>
- <h:body>
- <a4j:queue name="first" ignoreDupResponses="true" timeout="100" requestDelay="400"/>
- <h:form id="form">
- <a4j:queue ignoreDupResponses="false" requestDelay="400"/>
- <a4j:ajax>
- <h:inputText />
-
- <a4j:attachQueue requestGroupingId="request" timeout="300" id="firstAttach" />
- </a4j:ajax>
- <a4j:queue name="second" ignoreDupResponses="true" timeout="100" requestDelay="400"/>
- <a4j:ajax event="valueChange">
- <h:panelGroup>
- <a4j:ajax event="valueChange">
- <h:inputText />
-
- <a4j:commandLink value="Link">
- <a4j:attachQueue name="second" timeout="500" id="linkAttach" />
- </a4j:commandLink>
-
- <a4j:attachQueue id="secondAttach" />
- </a4j:ajax>
- </h:panelGroup>
- </a4j:ajax>
- <h:commandButton value="G"/>
- </h:form>
-
- </h:body>
-</html>
\ No newline at end of file
Copied: root/ui/core/trunk/api/src/test/resources/org/richfaces/component/nonQueue.xhtml (from rev 17186, root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/nonQueue.xhtml)
===================================================================
--- root/ui/core/trunk/api/src/test/resources/org/richfaces/component/nonQueue.xhtml (rev 0)
+++ root/ui/core/trunk/api/src/test/resources/org/richfaces/component/nonQueue.xhtml 2010-05-23 17:53:50 UTC (rev 17192)
@@ -0,0 +1,35 @@
+<html xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <h:head>
+ <title>Test queue page</title>
+
+ <h:outputScript name="jsf.js" library="javax.faces" />
+ <h:outputScript name="jquery.js" />
+ <h:outputScript name="richfaces.js" />
+ <h:outputScript name="richfaces-queue.js" />
+
+ </h:head>
+ <h:body>
+ <h:form id="form">
+ <a4j:ajax>
+ <h:inputText />
+
+ </a4j:ajax>
+ <a4j:ajax event="valueChange">
+ <h:panelGroup>
+ <a4j:ajax event="valueChange">
+ <h:inputText />
+
+ <a4j:commandLink value="Link"/>
+
+ </a4j:ajax>
+ </h:panelGroup>
+ </a4j:ajax>
+ <h:commandButton value="G"/>
+ </h:form>
+
+ </h:body>
+</html>
\ No newline at end of file
Copied: root/ui/core/trunk/api/src/test/resources/org/richfaces/component/queue.xhtml (from rev 17186, root/ui/core/trunk/api/src/test/resources/org/ajax4jsf/component/queue.xhtml)
===================================================================
--- root/ui/core/trunk/api/src/test/resources/org/richfaces/component/queue.xhtml (rev 0)
+++ root/ui/core/trunk/api/src/test/resources/org/richfaces/component/queue.xhtml 2010-05-23 17:53:50 UTC (rev 17192)
@@ -0,0 +1,42 @@
+<html xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <h:head>
+ <title>Test queue page</title>
+
+ <h:outputScript name="jsf.js" library="javax.faces" />
+ <h:outputScript name="jquery.js" />
+ <h:outputScript name="richfaces.js" />
+ <h:outputScript name="richfaces-queue.js" />
+
+ </h:head>
+ <h:body>
+ <a4j:queue name="first" ignoreDupResponses="true" timeout="100" requestDelay="400"/>
+ <h:form id="form">
+ <a4j:queue ignoreDupResponses="false" requestDelay="400"/>
+ <a4j:ajax>
+ <h:inputText />
+
+ <a4j:attachQueue requestGroupingId="request" timeout="300" id="firstAttach" />
+ </a4j:ajax>
+ <a4j:queue name="second" ignoreDupResponses="true" timeout="100" requestDelay="400"/>
+ <a4j:ajax event="valueChange">
+ <h:panelGroup>
+ <a4j:ajax event="valueChange">
+ <h:inputText />
+
+ <a4j:commandLink value="Link">
+ <a4j:attachQueue name="second" timeout="500" id="linkAttach" />
+ </a4j:commandLink>
+
+ <a4j:attachQueue id="secondAttach" />
+ </a4j:ajax>
+ </h:panelGroup>
+ </a4j:ajax>
+ <h:commandButton value="G"/>
+ </h:form>
+
+ </h:body>
+</html>
\ No newline at end of file
15 years, 7 months
JBoss Rich Faces SVN: r17191 - in root/cdk/trunk/plugins: generator/src/main/java/org/richfaces/cdk/apt and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-21 20:13:51 -0400 (Fri, 21 May 2010)
New Revision: 17191
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestListener.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/TagModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventBean.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestEvent.java
Log:
CODING IN PROGRESS - issue RF-7789: Process JSF events.
https://jira.jboss.org/browse/RF-7789
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -30,6 +30,7 @@
import java.lang.annotation.Target;
import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
/**
* <p class="changed_added_4_0">
@@ -51,26 +52,38 @@
public static final String NAME = "org.richfaces.cdk.annotations.Event";
/**
- * <p class="changed_added_4_0"></p>
- * @return
+ * <p class="changed_added_4_0">
+ * The listener interface class that process annotated event. This is mandatory parameter.
+ * </p>
+ *
+ * @return name of listener interface
*/
- public Class<? extends FacesEvent> value();
+ public Class<? extends FacesListener> listener();
+
/**
* <p class="changed_added_4_0">
- * Name of the listener interface class.
+ * Name of the class that implements listener interface and wraps binding to the actual instance or process method.
* </p>
*
* @return name of generated listener interface..
*/
- public String listener() default "";
-
+ public String listenerWrapper() default "";
/**
* <p class="changed_added_4_0">
- * Name of the listener interface class.
+ * Name of the interface class that fires annotated events and accepts its listeners.
* </p>
*
* @return name of generated source interface..
*/
public String source() default "";
+ /**
+ * <p class="changed_added_4_0">
+ * View Description Language, JSP or Facelets, tags for event listeners, eg <foo:barListener>.
+ * </p>
+ *
+ * @return
+ */
+ public Tag[] tag() default { @Tag };
+
}
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -28,6 +28,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import javax.faces.event.FacesEvent;
+
/**
* <p class="changed_added_4_0">
* That annotation marks class as JSF component. The difference with JSF 2.0 @
@@ -132,7 +134,7 @@
*
* @return
*/
- public Event[] fires() default {};
+ public Class<? extends FacesEvent>[] fires() default {};
/**
* <p class="changed_added_4_0">
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -34,6 +34,7 @@
import org.richfaces.cdk.apt.processors.ConverterProcessor;
import org.richfaces.cdk.apt.processors.DescriptionProcessor;
import org.richfaces.cdk.apt.processors.DescriptionProcessorImpl;
+import org.richfaces.cdk.apt.processors.EventProcessor;
import org.richfaces.cdk.apt.processors.FunctionProcessor;
import org.richfaces.cdk.apt.processors.RendererProcessor;
import org.richfaces.cdk.apt.processors.TagLibProcessor;
@@ -64,6 +65,7 @@
setBinder.addBinding().to(ValidatorProcessor.class);
setBinder.addBinding().to(TagLibProcessor.class);
setBinder.addBinding().to(FunctionProcessor.class);
+ setBinder.addBinding().to(EventProcessor.class);
bind(Processor.class).to(CdkProcessor.class);
bind(AttributesProcessor.class).to(AttributesProcessorImpl.class);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Set;
+import javax.faces.event.FacesEvent;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.MirroredTypeException;
@@ -231,11 +232,11 @@
}
final void processEvents(TypeElement componentElement, ComponentModel component, JsfComponent annotation) {
- Event[] fires = annotation.fires();
+ Class<? extends FacesEvent>[] fires = annotation.fires();
- for (Event event : fires) {
+ for (Class<? extends FacesEvent> event : fires) {
try {
- component.addEvent(event.value().getName());
+// component.addEvent(event.value().getName());
} catch (MirroredTypesException mirror) {
for (TypeMirror eventType : mirror.getTypeMirrors()) {
component.addEvent(eventType.toString());
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -0,0 +1,82 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.apt.processors;
+
+import java.lang.annotation.Annotation;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.MirroredTypeException;
+
+import org.richfaces.cdk.CdkProcessingException;
+import org.richfaces.cdk.annotations.Event;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.EventModel;
+
+/**
+ * <p class="changed_added_4_0">This class processes annotations for FacesEvents.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class EventProcessor extends ProcessorBase implements CdkAnnotationProcessor {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.apt.processors.CdkAnnotationProcessor#getProcessedAnnotation()
+ */
+ @Override
+ public Class<? extends Annotation> getProcessedAnnotation() {
+ return Event.class;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.apt.processors.CdkAnnotationProcessor#process(javax.lang.model.element.Element, org.richfaces.cdk.model.ComponentLibrary)
+ */
+ @Override
+ public void process(Element element, ComponentLibrary library) throws CdkProcessingException {
+ if (ElementKind.CLASS.equals(element.getKind())) {
+ TypeElement eventType = (TypeElement) element;
+ Event event = eventType.getAnnotation(Event.class);
+ EventModel model = new EventModel();
+ model.setType(ClassName.parseName(eventType.getQualifiedName().toString()));
+ try {
+ model.setListenerInterface(ClassName.parseName(event.listener().toString()));
+ } catch (MirroredTypeException mirror) {
+ model.setListenerInterface(ClassName.parseName(mirror.getTypeMirror().toString()));
+ }
+ model.setSourceInterface(ClassName.parseName(event.source()));
+ model.setListenerWrapper(ClassName.parseName(event.listenerWrapper()));
+ for (Tag tag : event.tag()) {
+ if(!TagType.None.equals(tag.type())){
+ model.getTags().add(processTag(tag));
+ }
+ }
+ library.getEvents().add(model);
+ }
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/JsfSubComponent.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -24,6 +24,8 @@
import java.lang.annotation.Annotation;
+import javax.faces.event.FacesEvent;
+
import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.annotations.Event;
import org.richfaces.cdk.annotations.Facet;
@@ -86,9 +88,10 @@
return this.subcomponent.generate();
}
+ @SuppressWarnings("unchecked")
@Override
- public Event[] fires() {
- return new Event[0];
+ public Class<? extends FacesEvent>[] fires() {
+ return new Class[0];
}
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -38,25 +38,26 @@
}
protected void setTagInfo(Tag tag, ModelElementBase model) {
- TagModel tagModel = new TagModel();
if (!TagType.None.equals(tag.type())) {
- String name = tag.name();
- // TODO - move to validator.
- if (Strings.isEmpty(name)) {
- name = getNamingConventions().inferTagName(model.getId());
- }
- tagModel.setName(name);
- tagModel.setType(tag.type());
- tagModel.setTargetClass(ClassName.parseName(tag.handler()));
- tagModel.setBaseClass(ClassName.parseName(tag.baseClass()));
- tagModel.setGenerate(tag.generate());
+ TagModel tagModel = processTag(tag);
model.getTags().add(tagModel);
}
}
+ protected TagModel processTag(Tag tag) {
+ TagModel tagModel = new TagModel();
+ String name = tag.name();
+ tagModel.setName(name);
+ tagModel.setType(tag.type());
+ tagModel.setTargetClass(ClassName.parseName(tag.handler()));
+ tagModel.setBaseClass(ClassName.parseName(tag.baseClass()));
+ tagModel.setGenerate(tag.generate());
+ return tagModel;
+ }
+
protected void setClassNames(TypeElement componentElement, ModelElementBase modelElement,
String generatedClass) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -25,6 +25,12 @@
package org.richfaces.cdk.model;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+import org.richfaces.cdk.util.ComparatorUtils;
+
/**
* <p class="changed_added_4_0">That bean represent {@link javax.faces.event.FacesEvent} subclass that can be fired by
* component.</p>
@@ -33,11 +39,14 @@
*
*/
@SuppressWarnings("serial")
+@XmlType(name = "event-configType", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+(a)XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
public class EventModel implements ModelElement<EventModel> {
private String description;
private ClassName listenerInterface;
+ private ClassName listenerWrapper;
private ClassName sourceInterface;
- private ClassName tagHandler;
+ private final ModelCollection<TagModel> tags = ModelSet.<TagModel>create();
/**
* <p class="changed_added_4_0"></p>
@@ -111,20 +120,30 @@
/**
* <p class="changed_added_4_0"></p>
- * @return the tagHandler
+ * @return the listenerWrapper
*/
- public ClassName getTagHandler() {
- return tagHandler;
+ @Merge
+ public ClassName getListenerWrapper() {
+ return this.listenerWrapper;
}
/**
* <p class="changed_added_4_0"></p>
- * @param tagHandler the tagHandler to set
+ * @param listenerWrapper the listenerWrapper to set
*/
- public void setTagHandler(ClassName tagHandler) {
- this.tagHandler = tagHandler;
+ public void setListenerWrapper(ClassName listenerWrapper) {
+ this.listenerWrapper = listenerWrapper;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the tags
+ */
+ @Merge
+ public ModelCollection<TagModel> getTags() {
+ return this.tags;
+ }
+
@Override
public void merge(EventModel other) {
ComponentLibrary.merge(this, other);
@@ -136,7 +155,7 @@
@Override
public boolean same(EventModel other) {
- return null != getType() && getType().equals(other.getType());
+ return ComparatorUtils.nullSafeEquals(getType(), other.getType());
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/TagModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/TagModel.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/TagModel.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -25,6 +25,10 @@
package org.richfaces.cdk.model;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
import org.richfaces.cdk.annotations.TagType;
import org.richfaces.cdk.util.ComparatorUtils;
@@ -33,6 +37,8 @@
* @author asmirnov(a)exadel.com
*
*/
+@XmlType(name = "tag-configType", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+(a)XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
public class TagModel implements Named , ModelElement<TagModel> {
private static final long serialVersionUID = 3875718626199223087L;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -22,8 +22,23 @@
namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE),
@javax.xml.bind.annotation.XmlNs(prefix = "",
namespaceURI = ComponentLibrary.FACES_CONFIG_NAMESPACE)})
+@XmlJavaTypeAdapters({
+ @XmlJavaTypeAdapter(type = ClassName.class, value = ClassAdapter.class),
+ @XmlJavaTypeAdapter(type = AttributeModel.class, value = AttributeAdapter.class),
+ @XmlJavaTypeAdapter(type = PropertyModel.class, value = PropertyAdapter.class),
+ @XmlJavaTypeAdapter(type = FacesId.class, value = FacesIdAdapter.class),
+ @XmlJavaTypeAdapter(type = ComponentLibrary.class, value = FacesConfigAdapter.class)
+})
package org.richfaces.cdk.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
+import org.richfaces.cdk.xmlconfig.model.AttributeAdapter;
+import org.richfaces.cdk.xmlconfig.model.ClassAdapter;
+import org.richfaces.cdk.xmlconfig.model.FacesConfigAdapter;
+import org.richfaces.cdk.xmlconfig.model.FacesIdAdapter;
+import org.richfaces.cdk.xmlconfig.model.PropertyAdapter;
+
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventBean.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/EventBean.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -23,13 +23,18 @@
package org.richfaces.cdk.xmlconfig.model;
+import java.util.List;
+
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.TagModel;
+import com.google.common.collect.Lists;
+
/**
* <p class="changed_added_4_0"></p>
*
@@ -39,9 +44,10 @@
public class EventBean {
private String description;
private ClassName listenerInterface;
+ private ClassName listenerWrapper;
private ClassName sourceInterface;
- private ClassName tagHandler;
- private String type;
+ private ClassName type;
+ private List<TagModel> tags = Lists.newArrayList();
/**
* <p class="changed_added_4_0"></p>
@@ -49,7 +55,7 @@
* @return the type
*/
@XmlElement(name = "event-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
- public String getType() {
+ public ClassName getType() {
return type;
}
@@ -58,7 +64,7 @@
*
* @param type the type to set
*/
- public void setType(String type) {
+ public void setType(ClassName type) {
this.type = type;
}
@@ -103,6 +109,23 @@
/**
* <p class="changed_added_4_0"></p>
+ * @return the listenerWrapper
+ */
+ @XmlElement(name = "listener-wrapper-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public ClassName getListenerWrapper() {
+ return this.listenerWrapper;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param listenerWrapper the listenerWrapper to set
+ */
+ public void setListenerWrapper(ClassName listenerWrapper) {
+ this.listenerWrapper = listenerWrapper;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
*
* @return the sourceInterface
*/
@@ -123,21 +146,23 @@
/**
* <p class="changed_added_4_0"></p>
+ * @return the tags
+ */
+ /**
+ * <p class="changed_added_4_0"></p>
*
- * @return the tagHandler
+ * @return the tags
*/
- @XmlElement(name = "tag-handler-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
- @XmlJavaTypeAdapter(ClassAdapter.class)
- public ClassName getTagHandler() {
- return tagHandler;
+ @XmlElement(name = "tag", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public List<TagModel> getTags() {
+ return this.tags;
}
/**
* <p class="changed_added_4_0"></p>
- *
- * @param tagHandler the tagHandler to set
+ * @param tags the tags to set
*/
- public void setTagHandler(ClassName tagHandler) {
- this.tagHandler = tagHandler;
+ public void setTags(List<TagModel> tags) {
+ this.tags = tags;
}
}
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -35,6 +35,7 @@
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.SubComponent;
import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.test.event.TestEvent;
/**
* <p class="changed_added_4_0">
@@ -49,6 +50,7 @@
description=@Description(displayName="Test Component",largeIcon="large.gif",smallIcon="spall.png"),
generate="org.richfaces.cdk.test.component.UITestComponent",
facets=@Facet(name="caption"),
+ fires=TestEvent.class,
interfaces=ValueHolder.class,
components={
@SubComponent(type = "org.richfaces.cdk.test.TestHtmlAbbr",
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestEvent.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestEvent.java 2010-05-21 23:49:23 UTC (rev 17190)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestEvent.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -27,6 +27,9 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
+import org.richfaces.cdk.annotations.Event;
+import org.richfaces.cdk.annotations.Tag;
+
/**
* <p class="changed_added_4_0">
* </p>
@@ -34,6 +37,7 @@
* @author asmirnov(a)exadel.com
*
*/
+@Event(listener = TestListener.class, listenerWrapper = "org.richfaces.cdk.test.event.TestWrapper", source = "org.richfaces.cdk.test.event.TestSource", tag = @Tag(name = "testListener"))
public class TestEvent extends FacesEvent {
/**
@@ -59,8 +63,7 @@
*/
@Override
public boolean isAppropriateListener(FacesListener listener) {
- // TODO Auto-generated method stub
- return false;
+ return listener instanceof TestListener;
}
/*
@@ -70,8 +73,10 @@
*/
@Override
public void processListener(FacesListener listener) {
- // TODO Auto-generated method stub
-
+ if (listener instanceof TestListener) {
+ TestListener testListener= (TestListener) listener;
+ testListener.process(this);
+ }
}
}
Added: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestListener.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestListener.java (rev 0)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestListener.java 2010-05-22 00:13:51 UTC (rev 17191)
@@ -0,0 +1,37 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.test.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface TestListener extends FacesListener {
+
+ public void process(TestEvent event);
+
+}
Property changes on: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/event/TestListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
JBoss Rich Faces SVN: r17190 - in root/ui-sandbox: componentcontrol/trunk/api and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-21 19:49:23 -0400 (Fri, 21 May 2010)
New Revision: 17190
Modified:
root/ui-sandbox/componentcontrol/trunk/api/pom.xml
root/ui-sandbox/componentcontrol/trunk/bom/pom.xml
root/ui-sandbox/componentcontrol/trunk/parent/pom.xml
root/ui-sandbox/componentcontrol/trunk/ui/pom.xml
root/ui-sandbox/datascroller/trunk/api/pom.xml
root/ui-sandbox/datascroller/trunk/bom/pom.xml
root/ui-sandbox/datascroller/trunk/parent/pom.xml
root/ui-sandbox/datascroller/trunk/ui/pom.xml
root/ui-sandbox/pom.xml
root/ui-sandbox/tables/trunk/api/pom.xml
root/ui-sandbox/tables/trunk/bom/pom.xml
root/ui-sandbox/tables/trunk/impl/pom.xml
root/ui-sandbox/tables/trunk/parent/pom.xml
root/ui-sandbox/tables/trunk/ui/pom.xml
Log:
Updated to support jsf impl profiles
Modified: root/ui-sandbox/componentcontrol/trunk/api/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/api/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/componentcontrol/trunk/api/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -49,8 +49,8 @@
<!-- JSF with dependencies -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -76,8 +76,8 @@
<!-- tests -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: root/ui-sandbox/componentcontrol/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/bom/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/componentcontrol/trunk/bom/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>1</version>
+ <version>2-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/componentcontrol/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/parent/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/componentcontrol/trunk/parent/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>1</version>
+ <version>2-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/componentcontrol/trunk/ui/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/ui/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/componentcontrol/trunk/ui/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -53,8 +53,8 @@
<!-- JSF with dependencies -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -80,8 +80,8 @@
<!-- tests -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: root/ui-sandbox/datascroller/trunk/api/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/api/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/datascroller/trunk/api/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -49,8 +49,8 @@
<!-- JSF with dependencies -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -76,8 +76,8 @@
<!-- tests -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: root/ui-sandbox/datascroller/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/bom/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/datascroller/trunk/bom/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>1</version>
+ <version>2-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/datascroller/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/parent/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/datascroller/trunk/parent/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>1</version>
+ <version>2-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/datascroller/trunk/ui/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/datascroller/trunk/ui/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -50,8 +50,8 @@
<!-- JSF with dependencies -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -77,8 +77,8 @@
<!-- tests -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: root/ui-sandbox/pom.xml
===================================================================
--- root/ui-sandbox/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>1</version>
+ <version>2-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
@@ -34,13 +34,13 @@
<version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Components Sandbox Aggregator</name>
-
+
<modules>
<module>tables/trunk</module>
<module>datascroller/trunk</module>
<module>componentcontrol/trunk</module>
</modules>
-
+
<dependencyManagement>
<dependencies>
<dependency>
Modified: root/ui-sandbox/tables/trunk/api/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/api/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/tables/trunk/api/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -49,8 +49,8 @@
<!-- JSF with dependencies -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -76,8 +76,8 @@
<!-- tests -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: root/ui-sandbox/tables/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/bom/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/tables/trunk/bom/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>1</version>
+ <version>2-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/tables/trunk/impl/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/impl/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/tables/trunk/impl/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -43,8 +43,8 @@
<!-- JSF with dependencies -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -70,8 +70,8 @@
<!-- tests -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: root/ui-sandbox/tables/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/parent/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/tables/trunk/parent/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>1</version>
+ <version>2-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
@@ -80,15 +80,15 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
<scope>provided</scope>
</dependency>
<!-- Tests -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: root/ui-sandbox/tables/trunk/ui/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/ui/pom.xml 2010-05-21 22:25:43 UTC (rev 17189)
+++ root/ui-sandbox/tables/trunk/ui/pom.xml 2010-05-21 23:49:23 UTC (rev 17190)
@@ -50,8 +50,8 @@
<!-- JSF with dependencies -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -77,8 +77,8 @@
<!-- tests -->
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
15 years, 7 months
JBoss Rich Faces SVN: r17189 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-21 18:25:43 -0400 (Fri, 21 May 2010)
New Revision: 17189
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesComponent.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java
Log:
fix checkstyle errors
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesComponent.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesComponent.java 2010-05-21 19:35:20 UTC (rev 17188)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesComponent.java 2010-05-21 22:25:43 UTC (rev 17189)
@@ -1,6 +1,5 @@
package org.richfaces.cdk.model;
-import javax.faces.render.ClientBehaviorRenderer;
import org.richfaces.cdk.util.ComparatorUtils;
@@ -15,7 +14,7 @@
* <li>{@link Converter}</li>
* <li>{@link Validator}</li>
* <li>{@link ClientBehavior}</li>
- * <li>{@link ClientBehaviorRenderer}
+ * <li>{@link javax.faces.render.ClientBehaviorRenderer}
* </ul>
* @author asmirnov(a)exadel.com
*
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java 2010-05-21 19:35:20 UTC (rev 17188)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java 2010-05-21 22:25:43 UTC (rev 17189)
@@ -62,7 +62,7 @@
* @param id the id to set
*/
public void setId(FacesId id) {
- this.id = id;
+ this.id = id;
}
/**
15 years, 7 months
JBoss Rich Faces SVN: r17188 - in root/cdk/trunk/plugins/generator/src: main/java/org/richfaces/cdk/apt and 16 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-21 15:35:20 -0400 (Fri, 21 May 2010)
New Revision: 17188
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRendererModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelSet.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SimpleVisitor.java
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitIdAdapter.java
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtilsProvider.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EmptyAnnotationValueVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMakerModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMarkerRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/ModelElementBaseTemplateModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/PropertyModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/TagTemplateModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerGeneratorVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibWriter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BeanModelBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassName.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventName.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesComponent.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesId.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Named.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/PropertyBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/QNameComparator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateVisitorFactory.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/VisitorFactoryImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/HelperMethod.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstDeferredOrDynamicExpressionTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstEmptyTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstLiteralTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstStringTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/EqualityTestTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/ComplexType.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FragmentParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
Log:
optimise model
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/CdkClassLoader.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,15 +23,15 @@
package org.richfaces.cdk;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Set;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
/**
* <p class="changed_added_4_0">
* </p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,13 +22,17 @@
package org.richfaces.cdk;
-import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.common.collect.Maps;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Stage;
-import com.google.inject.name.Names;
+import static com.google.common.base.Preconditions.*;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.Writer;
+import java.nio.charset.Charset;
+import java.util.Collections;
+import java.util.Locale;
+import java.util.Map;
+
import org.richfaces.cdk.apt.AptModule;
import org.richfaces.cdk.generate.freemarker.FreeMakerModule;
import org.richfaces.cdk.generate.java.ClassGeneratorModule;
@@ -39,14 +43,12 @@
import org.richfaces.cdk.templatecompiler.TemplateModule;
import org.richfaces.cdk.xmlconfig.XmlModule;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.Collections;
-import java.util.Locale;
-import java.util.Map;
+import com.google.common.collect.Maps;
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Stage;
+import com.google.inject.name.Names;
/**
* @author asmirnov
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,18 +1,18 @@
package org.richfaces.cdk;
+import java.net.URI;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.InvalidNameException;
import org.richfaces.cdk.model.Name;
+import org.richfaces.cdk.model.RendererModel;
import org.richfaces.cdk.model.Name.Classifier;
-import org.richfaces.cdk.model.RendererModel;
import org.richfaces.cdk.util.Strings;
-import java.net.URI;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
-
/**
* <p class="changed_added_4_0">
* </p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -25,14 +25,16 @@
package org.richfaces.cdk.apt;
-import com.google.inject.Inject;
+import java.util.Set;
+
+import javax.tools.JavaCompiler.CompilationTask;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.LibraryBuilder;
import org.richfaces.cdk.Logger;
-import javax.tools.JavaCompiler.CompilationTask;
-import java.util.Set;
+import com.google.inject.Inject;
/**
* <p class="changed_added_4_0">
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,9 +23,8 @@
package org.richfaces.cdk.apt;
-import com.google.inject.AbstractModule;
-import com.google.inject.Singleton;
-import com.google.inject.multibindings.Multibinder;
+import javax.annotation.processing.Processor;
+
import org.richfaces.cdk.LibraryBuilder;
import org.richfaces.cdk.apt.processors.AttributesProcessor;
import org.richfaces.cdk.apt.processors.AttributesProcessorImpl;
@@ -40,7 +39,9 @@
import org.richfaces.cdk.apt.processors.TagLibProcessor;
import org.richfaces.cdk.apt.processors.ValidatorProcessor;
-import javax.annotation.processing.Processor;
+import com.google.inject.AbstractModule;
+import com.google.inject.Singleton;
+import com.google.inject.multibindings.Multibinder;
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,32 +1,33 @@
package org.richfaces.cdk.apt;
-import com.google.inject.Inject;
-import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.apt.SourceUtils.SuperTypeVisitor;
-import org.richfaces.cdk.model.ClassName;
-import org.richfaces.cdk.model.InvalidNameException;
-import org.richfaces.cdk.util.PropertyUtils;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
-import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.ElementFilter;
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import org.richfaces.cdk.Logger;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.InvalidNameException;
+import org.richfaces.cdk.util.PropertyUtils;
+
+import com.google.inject.Inject;
+
public class AptSourceUtils implements SourceUtils {
private static final Set<String> PROPERTIES =
new HashSet<String>(Arrays.asList("getEventNames", "getDefaultEventName", "getClientBehaviors", "getFamily"));
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,14 +23,11 @@
package org.richfaces.cdk.apt;
-import com.google.inject.Inject;
-import org.richfaces.cdk.CdkProcessingException;
-import org.richfaces.cdk.LibraryBuilder;
-import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.ModelBuilder;
-import org.richfaces.cdk.ModelValidator;
-import org.richfaces.cdk.apt.processors.CdkAnnotationProcessor;
-import org.richfaces.cdk.model.ComponentLibrary;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+import java.util.Collections;
+import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.ProcessingEnvironment;
@@ -41,12 +38,16 @@
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic.Kind;
-import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-import java.util.Collections;
-import java.util.Set;
+import org.richfaces.cdk.CdkProcessingException;
+import org.richfaces.cdk.LibraryBuilder;
+import org.richfaces.cdk.Logger;
+import org.richfaces.cdk.ModelBuilder;
+import org.richfaces.cdk.ModelValidator;
+import org.richfaces.cdk.apt.processors.CdkAnnotationProcessor;
+import org.richfaces.cdk.model.ComponentLibrary;
+import com.google.inject.Inject;
+
/**
* <p class="changed_added_4_0">
* Base class for all CDK Annotation processors. That class provides access to current CDK context and utility methods
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,18 +23,19 @@
package org.richfaces.cdk.apt;
-import com.google.inject.ProvidedBy;
-import org.richfaces.cdk.model.ClassName;
+import java.lang.annotation.Annotation;
+import java.util.List;
+import java.util.Set;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
-import java.lang.annotation.Annotation;
-import java.util.Set;
-import java.util.List;
+import org.richfaces.cdk.model.ClassName;
+import com.google.inject.ProvidedBy;
+
/**
* <p class="changed_added_4_0">This class provides utility methods to analayze java classes. This implementation uses APT API to get
* information about Java code.</p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtilsProvider.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtilsProvider.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtilsProvider.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,13 +23,13 @@
package org.richfaces.cdk.apt;
+import javax.annotation.processing.ProcessingEnvironment;
+
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Provider;
import com.google.inject.Singleton;
-import javax.annotation.processing.ProcessingEnvironment;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,35 +23,37 @@
package org.richfaces.cdk.apt;
-import com.google.inject.Inject;
-import org.richfaces.cdk.CdkClassLoader;
-import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.Output;
-import org.richfaces.cdk.Outputs;
-import org.richfaces.cdk.Source;
-import org.richfaces.cdk.Sources;
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
import javax.annotation.processing.Processor;
import javax.tools.Diagnostic;
-import javax.tools.Diagnostic.Kind;
import javax.tools.DiagnosticListener;
import javax.tools.JavaCompiler;
-import javax.tools.JavaCompiler.CompilationTask;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import javax.tools.ToolProvider;
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
+import javax.tools.Diagnostic.Kind;
+import javax.tools.JavaCompiler.CompilationTask;
+import org.richfaces.cdk.CdkClassLoader;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Logger;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.Source;
+import org.richfaces.cdk.Sources;
+
+import com.google.inject.Inject;
+
/**
* <p class="changed_added_4_0">
* </p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,10 +23,10 @@
package org.richfaces.cdk.apt.processors;
+import javax.lang.model.element.TypeElement;
+
import org.richfaces.cdk.model.BeanModelBase;
-import javax.lang.model.element.TypeElement;
-
/**
* <p class="changed_added_4_0">
* </p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,9 +1,19 @@
package org.richfaces.cdk.apt.processors;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.lang.model.element.AnnotationMirror;
+import javax.lang.model.element.AnnotationValue;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Name;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.MirroredTypeException;
+import javax.lang.model.type.MirroredTypesException;
+import javax.lang.model.type.TypeMirror;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.annotations.Attribute;
@@ -19,18 +29,10 @@
import org.richfaces.cdk.xmlconfig.CdkEntityResolver;
import org.richfaces.cdk.xmlconfig.FragmentParser;
-import javax.lang.model.element.AnnotationMirror;
-import javax.lang.model.element.AnnotationValue;
-import javax.lang.model.element.ExecutableElement;
-import javax.lang.model.element.Name;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.type.MirroredTypeException;
-import javax.lang.model.type.MirroredTypesException;
-import javax.lang.model.type.TypeMirror;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
public class AttributesProcessorImpl implements AttributesProcessor {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EmptyAnnotationValueVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EmptyAnnotationValueVisitor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EmptyAnnotationValueVisitor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,12 +22,13 @@
package org.richfaces.cdk.apt.processors;
+import java.util.List;
+
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.AnnotationValueVisitor;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
-import java.util.List;
/**
* @author akolonitsky
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,5 +1,9 @@
package org.richfaces.cdk.apt.processors;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.TypeElement;
+
import org.richfaces.cdk.NamingConventions;
import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.annotations.Tag;
@@ -11,10 +15,6 @@
import org.richfaces.cdk.model.TagModel;
import org.richfaces.cdk.util.Strings;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.Modifier;
-import javax.lang.model.element.TypeElement;
-
import com.google.inject.Inject;
import com.google.inject.Provider;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,17 +21,18 @@
package org.richfaces.cdk.apt.processors;
+import java.lang.annotation.Annotation;
+
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.JsfValidator;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.ValidatorModel;
-import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.TypeElement;
-import java.lang.annotation.Annotation;
-
/**
* @author akolonitsky
* @since Jan 13, 2010
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMakerModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMakerModule.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMakerModule.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -24,6 +24,7 @@
package org.richfaces.cdk.generate.freemarker;
import com.google.inject.AbstractModule;
+
import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMarkerRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMarkerRenderer.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/FreeMarkerRenderer.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -25,9 +25,10 @@
package org.richfaces.cdk.generate.freemarker;
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
@@ -35,9 +36,9 @@
import org.richfaces.cdk.model.ModelElementBase;
import org.richfaces.cdk.model.Trackable;
-import java.io.File;
-import java.io.IOException;
-import java.io.Writer;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
/**
* <p class="changed_added_4_0">Base class for all output file buildes that use FreeMarker as template engine.</p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/ModelElementBaseTemplateModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/ModelElementBaseTemplateModel.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/ModelElementBaseTemplateModel.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -25,24 +25,26 @@
package org.richfaces.cdk.generate.freemarker;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.ModelElementBase;
+import org.richfaces.cdk.model.PropertyBase;
+
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
+
import freemarker.ext.beans.BeanModel;
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
-import org.richfaces.cdk.model.ClassName;
-import org.richfaces.cdk.model.EventName;
-import org.richfaces.cdk.model.ModelElementBase;
-import org.richfaces.cdk.model.PropertyBase;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.TreeSet;
-
/**
* <p class="changed_added_4_0">
* </p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/PropertyModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/PropertyModel.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/PropertyModel.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -25,13 +25,14 @@
package org.richfaces.cdk.generate.freemarker;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.PropertyBase;
+import org.richfaces.cdk.util.Strings;
+
import freemarker.ext.beans.BeanModel;
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
-import org.richfaces.cdk.model.ClassName;
-import org.richfaces.cdk.model.PropertyBase;
-import org.richfaces.cdk.util.Strings;
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/TagTemplateModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/TagTemplateModel.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/freemarker/TagTemplateModel.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,6 +22,11 @@
package org.richfaces.cdk.generate.freemarker;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.ConverterModel;
@@ -31,11 +36,6 @@
import org.richfaces.cdk.model.TagModel;
import org.richfaces.cdk.model.ValidatorModel;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,8 +22,8 @@
package org.richfaces.cdk.generate.java;
-import com.google.inject.Inject;
-import freemarker.template.Configuration;
+import java.util.Collection;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
@@ -33,8 +33,10 @@
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.ComponentLibrary;
-import java.util.Collection;
+import com.google.inject.Inject;
+import freemarker.template.Configuration;
+
/**
* @author akolonitsky
* @since Jan 21, 2010
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -25,8 +25,8 @@
package org.richfaces.cdk.generate.java;
-import com.google.inject.Inject;
-import freemarker.template.Configuration;
+import java.util.Collection;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
@@ -36,8 +36,10 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
-import java.util.Collection;
+import com.google.inject.Inject;
+import freemarker.template.Configuration;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,8 +22,8 @@
package org.richfaces.cdk.generate.java;
-import com.google.inject.Inject;
-import freemarker.template.Configuration;
+import java.util.Collection;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
@@ -33,8 +33,10 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConverterModel;
-import java.util.Collection;
+import com.google.inject.Inject;
+import freemarker.template.Configuration;
+
/**
* @author akolonitsky
* @since Jan 20, 2010
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,8 +22,8 @@
package org.richfaces.cdk.generate.java;
-import com.google.inject.Inject;
-import freemarker.template.Configuration;
+import java.util.Collection;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
@@ -33,8 +33,10 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ValidatorModel;
-import java.util.Collection;
+import com.google.inject.Inject;
+import freemarker.template.Configuration;
+
/**
* @author akolonitsky
* @since Jan 15, 2010
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerGeneratorVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerGeneratorVisitor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerGeneratorVisitor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -25,8 +25,8 @@
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.ConverterModel;
-import org.richfaces.cdk.model.EmptyVisitor;
import org.richfaces.cdk.model.ModelElementBase;
+import org.richfaces.cdk.model.SimpleVisitor;
import org.richfaces.cdk.model.TagModel;
import org.richfaces.cdk.model.ValidatorModel;
@@ -36,7 +36,7 @@
* @author akolonitsky
* @since Feb 22, 2010
*/
-public class TagHandlerGeneratorVisitor extends EmptyVisitor<Boolean,Boolean> {
+public class TagHandlerGeneratorVisitor extends SimpleVisitor<Boolean,Boolean> {
private final TagHandlerClassGenerator tagGenerator;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerModule.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerModule.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,9 +22,10 @@
package org.richfaces.cdk.generate.java.taghandler;
+import org.richfaces.cdk.CdkWriter;
+
import com.google.inject.AbstractModule;
import com.google.inject.multibindings.Multibinder;
-import org.richfaces.cdk.CdkWriter;
/**
* @author akolonitsky
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -32,9 +32,9 @@
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.ConverterModel;
import org.richfaces.cdk.model.DescriptionGroup;
-import org.richfaces.cdk.model.EmptyVisitor;
import org.richfaces.cdk.model.FunctionModel;
import org.richfaces.cdk.model.PropertyBase;
+import org.richfaces.cdk.model.SimpleVisitor;
import org.richfaces.cdk.model.TagModel;
import org.richfaces.cdk.model.ValidatorModel;
import org.richfaces.cdk.model.RendererModel.Type;
@@ -44,14 +44,21 @@
* @author akolonitsky
* @since Feb 3, 2010
*/
-public class TaglibGeneratorVisitor extends EmptyVisitor<Boolean,ComponentLibrary> {
+public class TaglibGeneratorVisitor extends SimpleVisitor<Boolean,ComponentLibrary> {
private static final String COMPONENT = "component";
private static final String COMPONENT_TYPE = "component-type";
private static final String RENDERER_TYPE = "renderer-type";
private static final String HANDLER_CLASS = "handler-class";
+ /**
+ * <p class="changed_added_4_0">Generated document.
+ * IDEA - set document as visitor patameter, to reuse this object instance.</p>
+ */
private Document document = DocumentHelper.createDocument();
+ /**
+ * <p class="changed_added_4_0">faces-config element in document.</p>
+ */
private Element faceletTaglib;
@@ -75,9 +82,9 @@
faceletTaglib.addAttribute("xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd");
faceletTaglib.addAttribute("version", "2.0");
- faceletTaglib.addAttribute("id", componentLibrary.getTaglib().getShortName());
+ faceletTaglib.addAttribute("id", model.getTaglib().getShortName());
- faceletTaglib.addElement("namespace").addText(componentLibrary.getTaglib().getUri());
+ faceletTaglib.addElement("namespace").addText(model.getTaglib().getUri());
return null;
}
@@ -138,6 +145,7 @@
}
/**
+ * This method generates validator tag.
* <pre>
* <tag>
* <tag-name>formatValidator</tag-name>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,9 +23,10 @@
package org.richfaces.cdk.generate.taglib;
+import org.richfaces.cdk.CdkWriter;
+
import com.google.inject.AbstractModule;
import com.google.inject.multibindings.Multibinder;
-import org.richfaces.cdk.CdkWriter;
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibWriter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibWriter.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibWriter.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,7 +22,9 @@
package org.richfaces.cdk.generate.taglib;
-import com.google.inject.Inject;
+import java.io.IOException;
+import java.io.Writer;
+
import org.dom4j.Document;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
@@ -34,8 +36,7 @@
import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.model.ComponentLibrary;
-import java.io.IOException;
-import java.io.Writer;
+import com.google.inject.Inject;
/**
* @author akolonitsky
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BeanModelBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BeanModelBase.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BeanModelBase.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,7 +22,6 @@
package org.richfaces.cdk.model;
-import java.util.Collection;
import java.util.Comparator;
/**
@@ -35,7 +34,7 @@
public class BeanModelBase extends DescriptionGroupBase {
private final ModelCollection<PropertyBase> attributes =
- ModelCollection.<PropertyBase> create(new Comparator<PropertyBase>() {
+ ModelSet.<PropertyBase> create(new Comparator<PropertyBase>() {
@Override
public int compare(PropertyBase o1, PropertyBase o2) {
@@ -54,7 +53,7 @@
*
* @return the attributes
*/
- public Collection<PropertyBase> getAttributes() {
+ public ModelCollection<PropertyBase> getAttributes() {
return attributes;
}
@@ -67,7 +66,7 @@
* @return
*/
public PropertyBase getAttribute(final String name) {
- return attributes.find(new Named.NamedPredicate(name));
+ return attributes.find(new Named.NamePredicate(name));
}
public PropertyBase getOrCreateAttribute(String attributeName) {
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,136 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.richfaces.cdk.model;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class BehaviorRenderer implements ModelElement<BehaviorRenderer>, FacesComponent {
- private ClassName baseClass;
- private ClassName targetClass;
- private boolean generate;
- private FacesId id;
-
- public BehaviorRenderer(FacesId type) {
- this.id = type;
- }
-
- public BehaviorRenderer() {
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param id the id to set
- */
- public void setId(FacesId type) {
- this.id = type;
- }
-
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the id
- */
- public FacesId getId() {
- return id;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the targetClass
- */
- @Merge
- public ClassName getTargetClass() {
- return targetClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param targetClass the targetClass to set
- */
- public void setTargetClass(ClassName rendererClass) {
- this.targetClass = rendererClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the baseClass
- */
- @Merge
- public ClassName getBaseClass() {
- return this.baseClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param baseClass the baseClass to set
- */
- public void setBaseClass(ClassName baseClass) {
- this.baseClass = baseClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the generate
- */
- public boolean isGenerate() {
- return this.generate;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param generate the generate to set
- */
- public void setGenerate(boolean generate) {
- this.generate = generate;
- }
-
- @Override
- public void merge(BehaviorRenderer other) {
- ComponentLibrary.merge(this, other);
- }
-
- @Override
- public <R,D> R accept(Visitor<R,D> visitor, D data) {
- return visitor.visitBehaviorRenderer(this,data);
- }
-
- @Override
- public boolean same(BehaviorRenderer other) {
- if (null != getId() && null != other.getId()) {
- // Both types not null, compare them.
- return getId().equals(other.getId());
- }
- // one or both types are null, compare classes.
- if (null != getTargetClass() && getTargetClass().equals(other.getTargetClass())) {
- return true;
- }
- return false;
- }
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRendererModel.java (from rev 17182, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRendererModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRendererModel.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -0,0 +1,136 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+
+package org.richfaces.cdk.model;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class BehaviorRendererModel implements ModelElement<BehaviorRendererModel>, FacesComponent {
+ private ClassName baseClass;
+ private ClassName targetClass;
+ private boolean generate;
+ private FacesId id;
+
+ public BehaviorRendererModel(FacesId type) {
+ this.id = type;
+ }
+
+ public BehaviorRendererModel() {
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param id the id to set
+ */
+ public void setId(FacesId type) {
+ this.id = type;
+ }
+
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the id
+ */
+ public FacesId getId() {
+ return id;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the targetClass
+ */
+ @Merge
+ public ClassName getTargetClass() {
+ return targetClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param targetClass the targetClass to set
+ */
+ public void setTargetClass(ClassName rendererClass) {
+ this.targetClass = rendererClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the baseClass
+ */
+ @Merge
+ public ClassName getBaseClass() {
+ return this.baseClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param baseClass the baseClass to set
+ */
+ public void setBaseClass(ClassName baseClass) {
+ this.baseClass = baseClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the generate
+ */
+ public boolean isGenerate() {
+ return this.generate;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param generate the generate to set
+ */
+ public void setGenerate(boolean generate) {
+ this.generate = generate;
+ }
+
+ @Override
+ public void merge(BehaviorRendererModel other) {
+ ComponentLibrary.merge(this, other);
+ }
+
+ @Override
+ public <R,D> R accept(Visitor<R,D> visitor, D data) {
+ return visitor.visitBehaviorRenderer(this,data);
+ }
+
+ @Override
+ public boolean same(BehaviorRendererModel other) {
+ if (null != getId() && null != other.getId()) {
+ // Both types not null, compare them.
+ return getId().equals(other.getId());
+ }
+ // one or both types are null, compare classes.
+ if (null != getTargetClass() && getTargetClass().equals(other.getTargetClass())) {
+ return true;
+ }
+ return false;
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRendererModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassName.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassName.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassName.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,10 +23,11 @@
package org.richfaces.cdk.model;
-import com.google.common.collect.ImmutableMap;
+import java.io.Serializable;
+
import org.richfaces.cdk.util.Strings;
-import java.io.Serializable;
+import com.google.common.collect.ImmutableMap;
/**
* <p class="changed_added_4_0">
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -59,22 +59,22 @@
"http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd";
private static final long serialVersionUID = -6055670836731899832L;
- private final ModelCollection<ComponentModel> components = ModelCollection.<ComponentModel> create();
+ private final ModelCollection<ComponentModel> components = ModelSet.<ComponentModel> create();
/**
* <p class="changed_added_4_0">
* JSF renderer associated with that library
* </p>
*/
- private final ModelCollection<RenderKitModel> renderKits = ModelCollection.<RenderKitModel> create();
+ private final ModelCollection<RenderKitModel> renderKits = ModelSet.<RenderKitModel> create();
- private final ModelCollection<ConverterModel> converters = ModelCollection.<ConverterModel> create();
+ private final ModelCollection<ConverterModel> converters = ModelSet.<ConverterModel> create();
- private final ModelCollection<ValidatorModel> validators = ModelCollection.<ValidatorModel> create();
+ private final ModelCollection<ValidatorModel> validators = ModelSet.<ValidatorModel> create();
- private final ModelCollection<ListenerModel> listeners = ModelCollection.<ListenerModel> create();
+ private final ModelCollection<ListenerModel> listeners = ModelSet.<ListenerModel> create();
- private final ModelCollection<FunctionModel> functions = ModelCollection.<FunctionModel> create();
+ private final ModelCollection<FunctionModel> functions = ModelSet.<FunctionModel> create();
private long lastModified = Long.MIN_VALUE;
@@ -83,9 +83,9 @@
* Application level events fired by the component
* </p>
*/
- private final ModelCollection<EventModel> events = ModelCollection.<EventModel> create();
+ private final ModelCollection<EventModel> events = ModelSet.<EventModel> create();
- private final ModelCollection<BehaviorModel> behaviors = ModelCollection.<BehaviorModel> create();
+ private final ModelCollection<BehaviorModel> behaviors = ModelSet.<BehaviorModel> create();
private ConfigExtension extension;
@@ -125,13 +125,13 @@
* @return
*/
public RenderKitModel addRenderKit(String renderKitId) {
- RenderKitModel.Id renderKitType = new RenderKitModel.Id(renderKitId);
+ FacesId renderKitType = new FacesId(renderKitId);
RenderKitModel renderKit = addRenderKit(renderKitType);
return renderKit;
}
- public RenderKitModel addRenderKit(RenderKitModel.Id renderKitType) {
+ public RenderKitModel addRenderKit(FacesId renderKitType) {
RenderKitModel renderKit = getRenderKit(renderKitType);
if (null == renderKit) {
@@ -148,7 +148,7 @@
*
* @return the components
*/
- public Collection<ComponentModel> getComponents() {
+ public ModelCollection<ComponentModel> getComponents() {
return components;
}
@@ -171,11 +171,11 @@
*
* @return the renderKits
*/
- public Collection<RenderKitModel> getRenderKits() {
+ public ModelCollection<RenderKitModel> getRenderKits() {
return renderKits;
}
- public RenderKitModel getRenderKit(RenderKitModel.Id id) {
+ public RenderKitModel getRenderKit(FacesId id) {
if (null != id) {
for (RenderKitModel renderKit : renderKits) {
if (id.equals(renderKit.getId())) {
@@ -186,14 +186,14 @@
return null;
}
- public void addRenderer(RenderKitModel.Id renderKitId, RendererModel rendererModel) {
+ public void addRenderer(FacesId renderKitId, RendererModel rendererModel) {
RenderKitModel renderKit = addRenderKit(renderKitId);
renderKit.getRenderers().add(rendererModel);
}
public void addRenderer(String renderKitId, RendererModel rendererModel) {
- this.addRenderer(new RenderKitModel.Id(renderKitId), rendererModel);
+ this.addRenderer(new FacesId(renderKitId), rendererModel);
}
public RendererModel getRenderer(String componentFamily, String componentType) {
@@ -238,7 +238,7 @@
*
* @return the converters
*/
- public Collection<ConverterModel> getConverters() {
+ public ModelCollection<ConverterModel> getConverters() {
return converters;
}
@@ -248,7 +248,7 @@
*
* @return the validators
*/
- public Collection<ValidatorModel> getValidators() {
+ public ModelCollection<ValidatorModel> getValidators() {
return validators;
}
@@ -258,7 +258,7 @@
*
* @return the behaviors
*/
- public Collection<BehaviorModel> getBehaviors() {
+ public ModelCollection<BehaviorModel> getBehaviors() {
return behaviors;
}
@@ -268,7 +268,7 @@
*
* @return the listeners
*/
- public Collection<ListenerModel> getListeners() {
+ public ModelCollection<ListenerModel> getListeners() {
return listeners;
}
@@ -278,7 +278,7 @@
*
* @return the events
*/
- public Collection<EventModel> getEvents() {
+ public ModelCollection<EventModel> getEvents() {
return events;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,7 +1,5 @@
package org.richfaces.cdk.model;
-import java.util.Collection;
-
import org.richfaces.cdk.model.RendererModel.Type;
/**
@@ -19,14 +17,14 @@
* Facets recognised by the component
* </p>
*/
- private final ModelCollection<FacetModel> facets = ModelCollection.<FacetModel>create();
+ private final ModelCollection<FacetModel> facets = ModelSet.<FacetModel>create();
/**
* <p class="changed_added_4_0">
* Application level events fired by the component
* </p>
*/
- private final ModelCollection<EventModel> events = ModelCollection.<EventModel>create();
+ private final ModelCollection<EventModel> events = ModelSet.<EventModel>create();
/**
* <p class="changed_added_4_0">
@@ -160,12 +158,12 @@
* <p class="changed_added_4_0"></p>
* @return the facets
*/
- public Collection<FacetModel> getFacets() {
+ public ModelCollection<FacetModel> getFacets() {
return facets;
}
public FacetModel getFacet(final String name) {
- return facets.find(new Named.NamedPredicate(name));
+ return facets.find(new Named.NamePredicate(name));
}
public FacetModel getOrCreateFacet(String name) {
@@ -182,7 +180,7 @@
* <p class="changed_added_4_0"></p>
* @return the events
*/
- public Collection<EventModel> getEvents() {
+ public ModelCollection<EventModel> getEvents() {
return events;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -24,11 +24,12 @@
package org.richfaces.cdk.model;
-import org.w3c.dom.Element;
+import java.util.List;
import javax.xml.bind.annotation.XmlAnyElement;
-import java.util.List;
+import org.w3c.dom.Element;
+
/**
* <p class="changed_added_4_0">That class represents all faces-config "extension" fields.</p>
*
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright , Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.richfaces.cdk.model;
-
-/**
- * Implementation for easy on inheritance.
- *
- * @author akolonitsky
- * @since Feb 22, 2010
- */
-public abstract class EmptyVisitor<R,D> implements Visitor<R,D>{
-
- public R visitComponentLibrary(ComponentLibrary model, D param) {
- return null;
- }
-
- public R visitComponent(ComponentModel model, D param) {
- return null;
- }
-
- public R visitConverter(ConverterModel model, D param) {
- return null;
- }
-
- public R visitValidator(ValidatorModel model, D param) {
- return null;
- }
-
- public R visitBehavior(BehaviorModel model, D param) {
- return null;
- }
-
- public R visitFacet(FacetModel model, D param) {
- return null;
- }
-
- public R visitEvent(EventModel model, D param) {
- return null;
- }
-
- public R visitBehaviorRenderer(BehaviorRenderer model, D param) {
- return null;
- }
-
- public R visitProperty(PropertyBase model, D param) {
- return null;
- }
-
- public R visitRenderKit(RenderKitModel model, D param) {
- return null;
- }
-
- public R visitRender(RendererModel model, D param) {
- return null;
- }
-
- public R visitListener(ListenerModel model, D param) {
- return null;
- }
-
- @Override
- public R visitFunction(FunctionModel model, D param) {
- // Do nothing
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public R visit(ModelElement model, D param) {
- return null;
- }
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventName.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventName.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventName.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,9 +23,10 @@
package org.richfaces.cdk.model;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlValue;
-import java.io.Serializable;
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesComponent.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesComponent.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesComponent.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,6 +1,12 @@
package org.richfaces.cdk.model;
+import javax.faces.render.ClientBehaviorRenderer;
+import org.richfaces.cdk.util.ComparatorUtils;
+
+import com.google.common.base.Predicate;
+
+
/**
* <p class="changed_added_4_0">This Interface describes all JSF objects that can be generated by cdk:</p>
* <ul>
@@ -16,8 +22,46 @@
*/
public interface FacesComponent {
+ /**
+ * <p class="changed_added_4_0">This predicate can be used to lookup component in {@link ModelCollection} by id.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+ public static final class ComponentPredicate implements Predicate<FacesComponent> {
+
+ private final FacesId id;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param id
+ */
+ public ComponentPredicate(FacesId id) {
+ this.id = id;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param name
+ */
+ public ComponentPredicate(String name) {
+ this.id = FacesId.parseId(name);
+ }
+
+ @Override
+ public boolean apply(FacesComponent input) {
+ return ComparatorUtils.nullSafeEquals(input.getId(), this.id);
+ }
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return
+ */
public FacesId getId();
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param id
+ */
public void setId(FacesId id);
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesId.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesId.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacesId.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,10 +23,10 @@
package org.richfaces.cdk.model;
+import java.io.Serializable;
+
import org.richfaces.cdk.util.Strings;
-import java.io.Serializable;
-
/**
* <p class="changed_added_4_0">This is a FacesId class that should be used to find JSF elements in {@link ComponentLibrary}</p>
*
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,213 +1,19 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
package org.richfaces.cdk.model;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Lists;
-
import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
+import com.google.common.base.Predicate;
+
/**
- * <p class="changed_added_4_0">
- * Base class for all model collections. This collection use {@link Mergeable#same(Object)} method instead of equals
- * to lookup objects in the {@link #contains(Object)} and {@link #remove(Object)} methods. In addition, it merges same objects instead of replace in the {@link #add(ModelElement)} method.
- * </p>
- *
+ * <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
+ *
+ * @param <E>
*/
-public class ModelCollection<E extends ModelElement<? super E>> implements Collection<E>, Visitable {
+public interface ModelCollection<E extends ModelElement<? super E>> extends Collection<E>, Visitable {
- private final List<E> elements = Lists.newArrayList();
-
- private Comparator<E> comparator;
-
+ public E find(final Predicate<? super E> predicate);
- /**
- * <p class="changed_added_4_0"></p>
- * @return the comparator
- */
- public Comparator<E> getComparator() {
- return this.comparator;
- }
+ public <R,D> R accept(R result, Visitor<R,D> visitor, D data);
- /**
- * <p class="changed_added_4_0"></p>
- * @param comparator the comparator to set
- */
- public void setComparator(Comparator<E> comparator) {
- this.comparator = comparator;
- }
-
- public static <T extends ModelElement<? super T>> ModelCollection<T> create() {
- return new ModelCollection<T>();
- }
-
- public static <T extends ModelElement<? super T>> ModelCollection<T> create(Comparator<T> comparator) {
- ModelCollection<T> collection = new ModelCollection<T>();
- collection.setComparator(comparator);
- return collection;
- }
-
- public E find(final Predicate<? super E> predicate) {
- try {
- return Iterables.find(elements, predicate);
- } catch (NoSuchElementException e) {
- return null;
- }
- }
-
- @Override
- public boolean add(E e) {
- if (null == e) {
- throw new NullPointerException();
- }
- for (E element : elements) {
- if (element.same(e)) {
- element.merge(e);
- return false;
- }
- }
- return elements.add(e);
- }
-
- @Override
- public boolean addAll(Collection<? extends E> c) {
- boolean changed = false;
-
- for (E e : c) {
- changed |= add(e);
- }
-
- return changed;
- }
-
- @Override
- public void clear() {
- elements.clear();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public boolean contains(Object o) {
- if (null != o) {
- Class<? extends Object> clazz = o.getClass();
- for (E element : elements) {
- if (clazz.isInstance(element) && element.same((E) o)) {
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean containsAll(Collection<?> c) {
- return elements.containsAll(c);
- }
-
- @Override
- public boolean isEmpty() {
- return elements.isEmpty();
- }
-
- @Override
- public Iterator<E> iterator() {
- if(null == comparator){
- return elements.iterator();
- } else {
- List<E> list = Lists.newArrayList(elements);
- Collections.sort(list, comparator);
- return Iterators.unmodifiableIterator(list.iterator());
- }
- }
-
- @Override
- public boolean remove(Object o) {
- if (null != o) {
- Class<? extends Object> clazz = o.getClass();
- for (E element : elements) {
- if (clazz.isInstance(element) && element.same((E) o)) {
- elements.remove(element);
- return true;
- }
- }
-
- }
- return false;
- }
-
- @Override
- public boolean removeAll(Collection<?> c) {
- boolean changed = false;
-
- for (Object e : c) {
- changed |= remove(e);
- }
-
- return changed;
- }
-
- @Override
- public boolean retainAll(Collection<?> c) {
- return elements.retainAll(c);
- }
-
- @Override
- public int size() {
- return elements.size();
- }
-
- @Override
- public Object[] toArray() {
- Object[] array = elements.toArray();
- return array;
- }
-
- @Override
- public <T> T[] toArray(T[] a) {
- return elements.toArray(a);
- }
-
- public <R,D> R accept(R result, Visitor<R,D> visitor, D data) {
- return null==result?accept(visitor, data):result;
- }
-
- public <R,D> R accept(Visitor<R,D> visitor, D data) {
- for (ModelElement element : elements) {
- R result = element.accept(visitor,data);
- if(null != result){
- return result;
- }
- }
- return null;
- }
-
-}
+}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,9 +1,9 @@
package org.richfaces.cdk.model;
+import java.util.Collection;
+
import com.google.common.collect.Lists;
-import java.util.Collection;
-
/**
* <p class="changed_added_4_0">Base class for the most JSF components taht have description
* attributes and support extensions in faces-config.</p>
@@ -18,7 +18,7 @@
private ClassName baseClass;
- private final ModelCollection<TagModel> tags = ModelCollection.<TagModel>create();
+ private final ModelCollection<TagModel> tags = ModelSet.<TagModel>create();
private final Collection<ClassName> interfaces = Lists.newArrayList();
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelSet.java (from rev 17182, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelSet.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelSet.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -0,0 +1,216 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.model;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+
+/**
+ * <p class="changed_added_4_0">
+ * Base class for all model collections. This collection use {@link Mergeable#same(Object)} method instead of equals
+ * to lookup objects in the {@link #contains(Object)} and {@link #remove(Object)} methods. In addition, it merges same objects instead of replace in the {@link #add(ModelElement)} method.
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ */
+public class ModelSet<E extends ModelElement<? super E>> implements ModelCollection<E>,Set<E> {
+
+ private final List<E> elements = Lists.newArrayList();
+
+ private Comparator<E> comparator;
+
+
+ public static <T extends ModelElement<? super T>> ModelSet<T> create() {
+ return new ModelSet<T>();
+ }
+
+ public static <T extends ModelElement<? super T>> ModelSet<T> create(Comparator<T> comparator) {
+ ModelSet<T> collection = new ModelSet<T>();
+ collection.setComparator(comparator);
+ return collection;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the comparator
+ */
+ public Comparator<E> getComparator() {
+ return this.comparator;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param comparator the comparator to set
+ */
+ public void setComparator(Comparator<E> comparator) {
+ this.comparator = comparator;
+ }
+
+ @Override
+ public E find(final Predicate<? super E> predicate) {
+ try {
+ return Iterables.find(elements, predicate);
+ } catch (NoSuchElementException e) {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean add(E e) {
+ if (null == e) {
+ throw new NullPointerException();
+ }
+ for (E element : elements) {
+ if (element.same(e)) {
+ element.merge(e);
+ return false;
+ }
+ }
+ return elements.add(e);
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends E> c) {
+ boolean changed = false;
+
+ for (E e : c) {
+ changed |= add(e);
+ }
+
+ return changed;
+ }
+
+ @Override
+ public void clear() {
+ elements.clear();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public boolean contains(Object o) {
+ if (null != o) {
+ Class<? extends Object> clazz = o.getClass();
+ for (E element : elements) {
+ if (clazz.isInstance(element) && element.same((E) o)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean containsAll(Collection<?> c) {
+ return elements.containsAll(c);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return elements.isEmpty();
+ }
+
+ @Override
+ public Iterator<E> iterator() {
+ if(null == comparator){
+ return elements.iterator();
+ } else {
+ List<E> list = Lists.newArrayList(elements);
+ Collections.sort(list, comparator);
+ return Iterators.unmodifiableIterator(list.iterator());
+ }
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ if (null != o) {
+ Class<? extends Object> clazz = o.getClass();
+ for (E element : elements) {
+ if (clazz.isInstance(element) && element.same((E) o)) {
+ elements.remove(element);
+ return true;
+ }
+ }
+
+ }
+ return false;
+ }
+
+ @Override
+ public boolean removeAll(Collection<?> c) {
+ boolean changed = false;
+
+ for (Object e : c) {
+ changed |= remove(e);
+ }
+
+ return changed;
+ }
+
+ @Override
+ public boolean retainAll(Collection<?> c) {
+ return elements.retainAll(c);
+ }
+
+ @Override
+ public int size() {
+ return elements.size();
+ }
+
+ @Override
+ public Object[] toArray() {
+ Object[] array = elements.toArray();
+ return array;
+ }
+
+ @Override
+ public <T> T[] toArray(T[] a) {
+ return elements.toArray(a);
+ }
+
+ @Override
+ public <R,D> R accept(R result, Visitor<R,D> visitor, D data) {
+ return null==result?accept(visitor, data):result;
+ }
+
+ public <R,D> R accept(Visitor<R,D> visitor, D data) {
+ for (ModelElement element : elements) {
+ R result = element.accept(visitor,data);
+ if(null != result){
+ return result;
+ }
+ }
+ return null;
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelSet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Named.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Named.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Named.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,9 +23,10 @@
package org.richfaces.cdk.model;
-import com.google.common.base.Predicate;
import org.richfaces.cdk.util.ComparatorUtils;
+import com.google.common.base.Predicate;
+
/**
* <p class="changed_added_4_0">This interface represents all models for "named" JSF objects ( attributes, properties, facets )</p>
* @author asmirnov(a)exadel.com
@@ -33,11 +34,16 @@
*/
public interface Named {
- public static final class NamedPredicate implements Predicate<Named> {
+ /**
+ * <p class="changed_added_4_0">Predicate used to lookup named element in the {@link ModelCollection}</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+ public static final class NamePredicate implements Predicate<Named> {
private final String name;
- public NamedPredicate(String name) {
+ public NamePredicate(String name) {
this.name = name;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/PropertyBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/PropertyBase.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/PropertyBase.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,13 +22,14 @@
package org.richfaces.cdk.model;
+import java.util.List;
+import java.util.Set;
+
+import org.richfaces.cdk.util.ComparatorUtils;
+
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
-import org.richfaces.cdk.util.ComparatorUtils;
-import java.util.List;
-import java.util.Set;
-
/**
* @author akolonitsky
* @since Mar 19, 2010
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -27,25 +27,25 @@
import org.richfaces.cdk.util.ComparatorUtils;
-import java.util.Collection;
-
-import javax.faces.render.RenderKitFactory;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
*
*/
-public class RenderKitModel extends DescriptionGroupBase implements ModelElement<RenderKitModel> {
+public class RenderKitModel extends DescriptionGroupBase implements ModelElement<RenderKitModel>,FacesComponent {
private static final long serialVersionUID = -7387781530198813352L;
- private final ModelCollection<RendererModel> renderers = ModelCollection.<RendererModel>create();
- private final ModelCollection<BehaviorRenderer> behaviorRenderers = ModelCollection.<BehaviorRenderer>create();
+ private final ModelSet<RendererModel> renderers = ModelSet.<RendererModel>create();
+ private final ModelSet<BehaviorRendererModel> behaviorRenderers = ModelSet.<BehaviorRendererModel>create();
- private ClassName renderKitClass;
+ private ClassName targetClass;
- private Id id;
+ private ClassName baseClass;
+ private FacesId id;
+
+ private boolean generate;
+
public RenderKitModel() {
}
@@ -53,7 +53,7 @@
* <p class="changed_added_4_0"></p>
* @return the id
*/
- public Id getId() {
+ public FacesId getId() {
return this.id;
}
@@ -61,32 +61,64 @@
* <p class="changed_added_4_0"></p>
* @param id the id to set
*/
- public void setId(Id id) {
- this.id = id;
+ public void setId(FacesId id) {
+ this.id = id;
}
/**
* <p class="changed_added_4_0"></p>
- * @return the renderKitClass
+ * @return the targetClass
*/
@Merge
- public ClassName getRenderKitClass() {
- return renderKitClass;
+ public ClassName getTargetClass() {
+ return targetClass;
}
/**
* <p class="changed_added_4_0"></p>
- * @param renderKitClass the renderKitClass to set
+ * @param targetClass the targetClass to set
*/
- public void setRenderKitClass(ClassName renderKitClass) {
- this.renderKitClass = renderKitClass;
+ public void setTargetClass(ClassName renderKitClass) {
+ this.targetClass = renderKitClass;
}
/**
* <p class="changed_added_4_0"></p>
+ * @return the baseClass
+ */
+ public ClassName getBaseClass() {
+ return this.baseClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param baseClass the baseClass to set
+ */
+ public void setBaseClass(ClassName baseClass) {
+ this.baseClass = baseClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the generate
+ */
+ public boolean isGenerate() {
+ return this.generate;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param generate the generate to set
+ */
+ public void setGenerate(boolean generate) {
+ this.generate = generate;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
* @return the renderers
*/
- public Collection<RendererModel> getRenderers() {
+ public ModelCollection<RendererModel> getRenderers() {
return renderers;
}
@@ -94,7 +126,7 @@
* <p class="changed_added_4_0"></p>
* @return the behaviorRenderers
*/
- public Collection<BehaviorRenderer> getBehaviorRenderers() {
+ public ModelCollection<BehaviorRendererModel> getBehaviorRenderers() {
return behaviorRenderers;
}
@@ -120,31 +152,7 @@
if(null != getId() && null != other.getId()){
return getId().equals(other.getId());
} else {
- return ComparatorUtils.nullSafeEquals(getRenderKitClass(), other.getRenderKitClass());
+ return ComparatorUtils.nullSafeEquals(getTargetClass(), other.getTargetClass());
}
}
-
-
- /**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
- public static final class Id extends FacesId {
- private static final long serialVersionUID = 9169827614943311779L;
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param type
- */
- public Id(String type) {
-
- // Null value means default render kit.
- super(null == type ? RenderKitFactory.HTML_BASIC_RENDER_KIT : type);
- }
-
- public String getId() {
- return super.getType();
- }
- }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -37,8 +37,6 @@
private static final long serialVersionUID = -5802466539382148578L;
- private RenderKitModel.Id renderKitId;
-
private String family;
private String componentType;
@@ -160,14 +158,6 @@
return false;
}
- public RenderKitModel.Id getRenderKitId() {
- return renderKitId;
- }
-
- public void setRenderKitId(RenderKitModel.Id renderKitId) {
- this.renderKitId = renderKitId;
- }
-
public String getComponentType() {
return componentType;
}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SimpleVisitor.java (from rev 17182, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SimpleVisitor.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SimpleVisitor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.model;
+
+/**
+ * Implementation for easy on inheritance. By default, all calls delegated to the {@link #defaultAction(Visitable, Object)} method.
+ *
+ * @author akolonitsky
+ * @since Feb 22, 2010
+ */
+public abstract class SimpleVisitor<R,D> implements Visitor<R,D>{
+
+ /**
+ * <p class="changed_added_4_0">Default action for all visitXXX method.</p>
+ * @param model visited object.
+ * @param param optional parameter for visit method.
+ * @return null by default.
+ */
+ protected R defaultAction(Visitable model, D param){
+ return null;
+ }
+
+ public R visitComponentLibrary(ComponentLibrary model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitComponent(ComponentModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitConverter(ConverterModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitValidator(ValidatorModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitBehavior(BehaviorModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitFacet(FacetModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitEvent(EventModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitBehaviorRenderer(BehaviorRendererModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitProperty(PropertyBase model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitRenderKit(RenderKitModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitRender(RendererModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ public R visitListener(ListenerModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ @Override
+ public R visitFunction(FunctionModel model, D param) {
+ return defaultAction(model,param);
+ }
+
+ @SuppressWarnings("unchecked")
+ public R visit(ModelElement model, D param) {
+ return defaultAction(model,param);
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/SimpleVisitor.java
___________________________________________________________________
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -46,7 +46,7 @@
R visitEvent(EventModel model, D param);
- R visitBehaviorRenderer(BehaviorRenderer model, D param);
+ R visitBehaviorRenderer(BehaviorRendererModel model, D param);
R visitProperty(PropertyBase model, D param);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,6 +23,15 @@
package org.richfaces.cdk.model.validator;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.NoSuchElementException;
+
+import javax.faces.view.facelets.BehaviorHandler;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.ConverterHandler;
+import javax.xml.validation.ValidatorHandler;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.ModelValidator;
@@ -44,15 +53,6 @@
import org.richfaces.cdk.model.Taglib;
import org.richfaces.cdk.util.Strings;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.NoSuchElementException;
-
-import javax.faces.view.facelets.BehaviorHandler;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.ConverterHandler;
-import javax.xml.validation.ValidatorHandler;
-
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/QNameComparator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/QNameComparator.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/QNameComparator.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,7 +21,7 @@
*/
package org.richfaces.cdk.templatecompiler;
-import static org.richfaces.cdk.util.ComparatorUtils.nullSafeCompare;
+import static org.richfaces.cdk.util.ComparatorUtils.*;
import java.util.Comparator;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,8 +23,10 @@
package org.richfaces.cdk.templatecompiler;
-import com.google.inject.Inject;
-import freemarker.template.TemplateException;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Collection;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
@@ -33,17 +35,17 @@
import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
-import org.richfaces.cdk.model.ModelCollection;
+import org.richfaces.cdk.model.ModelSet;
import org.richfaces.cdk.model.PropertyBase;
import org.richfaces.cdk.model.RenderKitModel;
import org.richfaces.cdk.model.RendererModel;
import org.richfaces.cdk.templatecompiler.builder.model.JavaClass;
import org.richfaces.cdk.templatecompiler.model.Template;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Collection;
+import com.google.inject.Inject;
+import freemarker.template.TemplateException;
+
/**
* <p class="changed_added_4_0">
* </p>
@@ -92,7 +94,7 @@
for (RendererModel renderer : renderKit.getRenderers()) {
Template template = renderer.getTemplate();
if (null != template) {
- Collection<PropertyBase> attributes = ModelCollection.<PropertyBase>create();
+ Collection<PropertyBase> attributes = ModelSet.<PropertyBase>create();
ComponentModel component = findComponentByRenderer(renderer);
if (component != null) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,9 +23,8 @@
package org.richfaces.cdk.templatecompiler;
-import static org.richfaces.cdk.templatecompiler.QNameComparator.QNAME_COMPARATOR;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedStringsArray;
+import static org.richfaces.cdk.templatecompiler.QNameComparator.*;
+import static org.richfaces.cdk.util.JavaUtils.*;
import java.io.IOException;
import java.util.Collection;
@@ -294,7 +293,7 @@
sb.append(")");
}
- // OPTIMIZATION - use ModelCollection with lookup method
+ // OPTIMIZATION - use ModelSet with lookup method
for (PropertyBase property : attributes) {
if (attributeName.equals(property.getName())) {
Set<EventName> eventNames = property.getEventNames();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,9 +23,16 @@
package org.richfaces.cdk.templatecompiler;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import com.google.inject.Inject;
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Logger;
@@ -36,12 +43,12 @@
import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.EmptyVisitor;
import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.PropertyBase;
import org.richfaces.cdk.model.PropertyModel;
-import org.richfaces.cdk.model.PropertyBase;
import org.richfaces.cdk.model.RenderKitModel;
import org.richfaces.cdk.model.RendererModel;
+import org.richfaces.cdk.model.SimpleVisitor;
import org.richfaces.cdk.templatecompiler.model.Attribute;
import org.richfaces.cdk.templatecompiler.model.ClientBehavior;
import org.richfaces.cdk.templatecompiler.model.CompositeInterface;
@@ -51,15 +58,9 @@
import org.richfaces.cdk.xmlconfig.FragmentParser;
import org.richfaces.cdk.xmlconfig.JAXB;
-import java.io.File;
-import java.text.MessageFormat;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.inject.Inject;
/**
* <p class="changed_added_4_0">
@@ -170,7 +171,7 @@
log.debug(" - file = " + absolutePath);
log.debug(" - renderer = " + rendererModel);
- RendererModel existedModel = library.accept(new EmptyVisitor<RendererModel,String>() {
+ RendererModel existedModel = library.accept(new SimpleVisitor<RendererModel,String>() {
@Override
public RendererModel visitRender(RendererModel model,String absolutePath) {
Template template = model.getTemplate();
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateVisitorFactory.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateVisitorFactory.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/TemplateVisitorFactory.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,12 +23,12 @@
package org.richfaces.cdk.templatecompiler;
+import java.util.Collection;
+
import org.richfaces.cdk.model.PropertyBase;
import org.richfaces.cdk.templatecompiler.model.CompositeInterface;
import org.richfaces.cdk.templatecompiler.model.TemplateVisitor;
-import java.util.Collection;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/VisitorFactoryImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/VisitorFactoryImpl.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/VisitorFactoryImpl.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,14 +23,15 @@
package org.richfaces.cdk.templatecompiler;
-import com.google.inject.Inject;
+import java.util.Collection;
+
import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.model.PropertyBase;
import org.richfaces.cdk.templatecompiler.model.CompositeInterface;
import org.richfaces.cdk.xmlconfig.JAXB;
-import java.util.Collection;
+import com.google.inject.Inject;
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELVisitor.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/ELVisitor.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,8 +21,8 @@
package org.richfaces.cdk.templatecompiler.el;
-import static org.richfaces.cdk.templatecompiler.el.HelperMethod.TO_STRING_CONVERSION;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
+import static org.richfaces.cdk.templatecompiler.el.HelperMethod.*;
+import static org.richfaces.cdk.util.JavaUtils.*;
import java.text.MessageFormat;
import java.util.EnumSet;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/HelperMethod.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/HelperMethod.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/HelperMethod.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,10 +21,7 @@
*/
package org.richfaces.cdk.templatecompiler.el;
-import static org.richfaces.cdk.templatecompiler.el.ELNodeConstants.CONVERT_TO_BOOLEAN_FUNCTION;
-import static org.richfaces.cdk.templatecompiler.el.ELNodeConstants.CONVERT_TO_STRING_FUNCTION;
-import static org.richfaces.cdk.templatecompiler.el.ELNodeConstants.IS_EMPTY_FUNCTION;
-import static org.richfaces.cdk.templatecompiler.el.ELNodeConstants.IS_EQUAL_FUNCTION;
+import static org.richfaces.cdk.templatecompiler.el.ELNodeConstants.*;
import java.util.EnumSet;
import java.util.Set;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstDeferredOrDynamicExpressionTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstDeferredOrDynamicExpressionTreeNode.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstDeferredOrDynamicExpressionTreeNode.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,9 +21,8 @@
package org.richfaces.cdk.templatecompiler.el.node;
-import static org.richfaces.cdk.templatecompiler.el.HelperMethod.TO_STRING_CONVERSION;
+import static org.richfaces.cdk.templatecompiler.el.HelperMethod.*;
-
import org.jboss.el.parser.Node;
import org.richfaces.cdk.templatecompiler.el.ELNodeConstants;
import org.richfaces.cdk.templatecompiler.el.ELVisitor;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstEmptyTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstEmptyTreeNode.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstEmptyTreeNode.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,7 +23,7 @@
package org.richfaces.cdk.templatecompiler.el.node;
-import static org.richfaces.cdk.templatecompiler.el.HelperMethod.EMPTINESS_CHECK;
+import static org.richfaces.cdk.templatecompiler.el.HelperMethod.*;
import org.jboss.el.parser.Node;
import org.richfaces.cdk.templatecompiler.el.ELNodeConstants;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstLiteralTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstLiteralTreeNode.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstLiteralTreeNode.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -24,10 +24,11 @@
package org.richfaces.cdk.templatecompiler.el.node;
+import static org.richfaces.cdk.util.JavaUtils.*;
+
import org.jboss.el.parser.Node;
import org.richfaces.cdk.templatecompiler.el.ELVisitor;
import org.richfaces.cdk.templatecompiler.el.ParsingException;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstStringTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstStringTreeNode.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/AstStringTreeNode.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -24,11 +24,12 @@
package org.richfaces.cdk.templatecompiler.el.node;
+import static org.richfaces.cdk.util.JavaUtils.*;
+
import org.jboss.el.parser.AstString;
import org.jboss.el.parser.Node;
import org.richfaces.cdk.templatecompiler.el.ELVisitor;
import org.richfaces.cdk.templatecompiler.el.ParsingException;
-import static org.richfaces.cdk.util.JavaUtils.getEscapedString;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/EqualityTestTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/EqualityTestTreeNode.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/node/EqualityTestTreeNode.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,7 +21,7 @@
*/
package org.richfaces.cdk.templatecompiler.el.node;
-import static org.richfaces.cdk.templatecompiler.el.HelperMethod.EQUALS_CHECK;
+import static org.richfaces.cdk.templatecompiler.el.HelperMethod.*;
import org.jboss.el.parser.Node;
import org.richfaces.cdk.templatecompiler.el.ELNodeConstants;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/ComplexType.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/ComplexType.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/el/types/ComplexType.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,15 +21,15 @@
*/
package org.richfaces.cdk.templatecompiler.el.types;
-import org.richfaces.cdk.templatecompiler.el.Type;
-import org.richfaces.cdk.util.ArrayUtils;
-
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.richfaces.cdk.templatecompiler.el.Type;
+import org.richfaces.cdk.util.ArrayUtils;
+
/**
* @author Nick Belaevski
*
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,9 +23,10 @@
package org.richfaces.cdk.templatecompiler.model;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,8 +23,14 @@
package org.richfaces.cdk.xmlconfig;
-import com.google.common.collect.ImmutableMap;
-import com.google.inject.Inject;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+
import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Source;
@@ -33,13 +39,8 @@
import org.xml.sax.SAXException;
import org.xml.sax.ext.EntityResolver2;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Inject;
/**
* <p class="changed_added_4_0">
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FragmentParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FragmentParser.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FragmentParser.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,7 +23,9 @@
package org.richfaces.cdk.xmlconfig;
-import com.google.inject.Inject;
+import java.util.Collection;
+import java.util.Collections;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
@@ -31,8 +33,7 @@
import org.richfaces.cdk.xmlconfig.model.ComponentAdapter;
import org.richfaces.cdk.xmlconfig.model.Fragment;
-import java.util.Collection;
-import java.util.Collections;
+import com.google.inject.Inject;
/**
* <p class="changed_added_4_0">
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -25,8 +25,28 @@
package org.richfaces.cdk.xmlconfig;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Inject;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collection;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.UnmarshallerHandler;
+import javax.xml.bind.util.ValidationEventCollector;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+
import org.apache.cocoon.pipeline.component.sax.XIncludeTransformer;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Logger;
@@ -36,16 +56,8 @@
import org.xml.sax.ext.EntityResolver2;
import org.xml.sax.helpers.XMLReaderFactory;
-import javax.xml.bind.*;
-import javax.xml.bind.util.ValidationEventCollector;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
-import java.io.*;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collection;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Inject;
/**
* <p class="changed_added_4_0">
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,13 +23,13 @@
package org.richfaces.cdk.xmlconfig.model;
-import org.richfaces.cdk.model.ClassName;
-import org.richfaces.cdk.model.ComponentLibrary;
-
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.ComponentLibrary;
+
/**
* <p class="changed_added_4_0"></p>
*
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -22,17 +22,18 @@
package org.richfaces.cdk.xmlconfig.model;
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.Collection;
-
/**
* @author akolonitsky
* @since Jan 21, 2010
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorRendererAdapter.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,22 +23,22 @@
package org.richfaces.cdk.xmlconfig.model;
-import org.richfaces.cdk.model.BehaviorRenderer;
+import org.richfaces.cdk.model.BehaviorRendererModel;
/**
* <p class="changed_added_4_0"></p>
*
* @author asmirnov(a)exadel.com
*/
-public class BehaviorRendererAdapter extends AdapterBase<BehaviorRendererBean, BehaviorRenderer> {
+public class BehaviorRendererAdapter extends AdapterBase<BehaviorRendererBean, BehaviorRendererModel> {
@Override
- protected Class<? extends BehaviorRendererBean> getBeanClass(BehaviorRenderer model) {
+ protected Class<? extends BehaviorRendererBean> getBeanClass(BehaviorRendererModel model) {
return BehaviorRendererBean.class;
}
@Override
- protected Class<? extends BehaviorRenderer> getModelClass(BehaviorRendererBean bean) {
- return BehaviorRenderer.class;
+ protected Class<? extends BehaviorRendererModel> getModelClass(BehaviorRendererBean bean) {
+ return BehaviorRendererModel.class;
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,7 +23,13 @@
package org.richfaces.cdk.xmlconfig.model;
-import com.google.common.collect.Lists;
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -33,11 +39,7 @@
import org.richfaces.cdk.model.PropertyModel;
import org.richfaces.cdk.model.TagModel;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.Collection;
-import java.util.List;
+import com.google.common.collect.Lists;
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,17 +21,18 @@
package org.richfaces.cdk.xmlconfig.model;
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.Collection;
-
/**
* @author akolonitsky
* @since Jan 6, 2010
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,18 +23,20 @@
package org.richfaces.cdk.xmlconfig.model;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
import org.richfaces.cdk.model.EventName;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.List;
-import java.util.Set;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
/**
* <p class="changed_added_4_0"></p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,13 +23,13 @@
package org.richfaces.cdk.xmlconfig.model;
-import org.richfaces.cdk.model.ClassName;
-import org.richfaces.cdk.model.ComponentLibrary;
-
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.ComponentLibrary;
+
/**
* <p class="changed_added_4_0"></p>
*
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -30,12 +30,12 @@
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.richfaces.cdk.model.BehaviorRenderer;
+import org.richfaces.cdk.model.BehaviorRendererModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
+import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.RendererModel;
-import org.richfaces.cdk.model.RenderKitModel.Id;
import com.google.common.collect.Lists;
@@ -47,43 +47,43 @@
@XmlType(
name = "faces-config-render-kitType",
namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE,
- propOrder = {"id", "renderkitClass", "renderers", "behaviorRenderers", "extension"})
+ propOrder = {"id", "targetClass", "renderers", "behaviorRenderers", "extension"})
public class RenderKitBean extends ExtensibleBean<RenderKitBean.RenderKitExtension> {
private List<RendererModel> renderers = Lists.newArrayList();
- private List<BehaviorRenderer> behaviorRenderers = Lists.newArrayList();
- private ClassName renderkitClass;
- private Id key = new Id(RenderKitFactory.HTML_BASIC_RENDER_KIT);
+ private List<BehaviorRendererModel> behaviorRenderers = Lists.newArrayList();
+ private ClassName targetClass;
+ private FacesId key = new FacesId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
@XmlElement(name = "render-kit-id", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
- @XmlJavaTypeAdapter(RenderKitIdAdapter.class)
- public Id getId() {
+ @XmlJavaTypeAdapter(FacesIdAdapter.class)
+ public FacesId getId() {
return key;
}
- public void setId(Id key) {
+ public void setId(FacesId key) {
this.key = key;
}
/**
* <p class="changed_added_4_0"></p>
*
- * @return the renderkitClass
+ * @return the targetClass
*/
@XmlElement(name = "render-kit-class", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@XmlJavaTypeAdapter(ClassAdapter.class)
- public ClassName getRenderkitClass() {
- return renderkitClass;
+ public ClassName getTargetClass() {
+ return targetClass;
}
/**
* <p class="changed_added_4_0"></p>
*
- * @param renderkitClass the renderkitClass to set
+ * @param targetClass the targetClass to set
*/
- public void setRenderkitClass(ClassName renderkitClass) {
- this.renderkitClass = renderkitClass;
+ public void setTargetClass(ClassName renderkitClass) {
+ this.targetClass = renderkitClass;
}
/**
@@ -112,7 +112,7 @@
*/
@XmlElement(name = "client-behavior-renderer", namespace = ComponentLibrary.FACES_CONFIG_NAMESPACE)
@XmlJavaTypeAdapter(BehaviorRendererAdapter.class)
- public List<BehaviorRenderer> getBehaviorRenderers() {
+ public List<BehaviorRendererModel> getBehaviorRenderers() {
return this.behaviorRenderers;
}
@@ -120,7 +120,7 @@
* <p class="changed_added_4_0"></p>
* @param behaviorRenderers the behaviorRenderers to set
*/
- public void setBehaviorRenderers(List<BehaviorRenderer> behaviorRenderers) {
+ public void setBehaviorRenderers(List<BehaviorRendererModel> behaviorRenderers) {
this.behaviorRenderers = behaviorRenderers;
}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitIdAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitIdAdapter.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitIdAdapter.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -1,48 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.cdk.xmlconfig.model;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-import org.richfaces.cdk.model.RenderKitModel;
-import org.richfaces.cdk.model.RenderKitModel.Id;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-public class RenderKitIdAdapter extends XmlAdapter<String, RenderKitModel.Id>{
-
- @Override
- public String marshal(Id v) throws Exception {
- return v.toString();
- }
-
- @Override
- public Id unmarshal(String v) throws Exception {
- return new Id(v);
- }
-
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -23,17 +23,18 @@
package org.richfaces.cdk.xmlconfig.model;
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
import org.richfaces.cdk.model.TagModel;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.Collection;
-
/**
* <p class="changed_added_4_0">
* </p>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,17 +21,18 @@
package org.richfaces.cdk.xmlconfig.model;
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
import org.richfaces.cdk.model.AttributeModel;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.Collection;
-
/**
* @author akolonitsky
* @since Jan 13, 2010
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -21,21 +21,20 @@
*/
package org.richfaces.cdk.templatecompiler;
-import com.google.common.collect.Lists;
-import com.google.inject.Inject;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.event.ActionEvent;
+import javax.faces.render.RenderKitFactory;
+import javax.faces.validator.Validator;
+
import org.easymock.EasyMock;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.isNull;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.As;
@@ -48,9 +47,9 @@
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyBase;
import org.richfaces.cdk.model.RenderKitModel;
-import org.richfaces.cdk.model.RenderKitModel.Id;
import org.richfaces.cdk.model.RendererModel;
import org.richfaces.cdk.templatecompiler.model.Template;
import org.richfaces.cdk.xmlconfig.JAXB;
@@ -58,15 +57,8 @@
import org.xml.sax.InputSource;
import org.xml.sax.ext.EntityResolver2;
-import javax.faces.event.ActionEvent;
-import javax.faces.render.RenderKitFactory;
-import javax.faces.validator.Validator;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import com.google.common.collect.Lists;
+import com.google.inject.Inject;
/**
* @author Nick Belaevski
@@ -93,7 +85,7 @@
private FileManager templatesSource;
private RenderKitModel getRenderkitFromModel(String renderkitId) {
- RenderKitModel renderKit = library.getRenderKit(new RenderKitModel.Id(renderkitId));
+ RenderKitModel renderKit = library.getRenderKit(new FacesId(renderkitId));
assertNotNull(renderKit);
return renderKit;
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2010-05-21 18:33:03 UTC (rev 17187)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2010-05-21 19:35:20 UTC (rev 17188)
@@ -40,6 +40,7 @@
import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
+import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.FacetModel;
import org.richfaces.cdk.model.PropertyBase;
import org.richfaces.cdk.model.RenderKitModel;
@@ -124,9 +125,9 @@
assertEquals(2, renderKits.size());
RenderKitModel renderKit = renderKits.get(0);
- assertEquals(new RenderKitModel.Id("HTML_BASIC"), renderKit.getId());
+ assertEquals(new FacesId("HTML_BASIC"), renderKit.getId());
assertEquals(1, renderKit.getRenderers().size());
- assertEquals(new RenderKitModel.Id("RDFa"), renderKits.get(1).getId());
+ assertEquals(new FacesId("RDFa"), renderKits.get(1).getId());
}
}
15 years, 7 months
JBoss Rich Faces SVN: r17187 - root/core/trunk/impl/src/main/java/org/ajax4jsf/context.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-21 14:33:03 -0400 (Fri, 21 May 2010)
New Revision: 17187
Modified:
root/core/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
Log:
Fixed checkstyle violation in core-impl
Modified: root/core/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2010-05-21 17:07:31 UTC (rev 17186)
+++ root/core/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2010-05-21 18:33:03 UTC (rev 17187)
@@ -173,11 +173,7 @@
String stringValue = (String) value;
- if ("true".equalsIgnoreCase(stringValue) || "yes".equalsIgnoreCase(stringValue)) {
- return true;
- } else {
- return false;
- }
+ return ("true".equalsIgnoreCase(stringValue) || "yes".equalsIgnoreCase(stringValue));
}
private static ConcurrentMap<Object, Object> getExpressionsMap(FacesContext context) {
15 years, 7 months