JBoss Rich Faces SVN: r15185 - branches/community/3.3.X/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-08-17 09:01:57 -0400 (Mon, 17 Aug 2009)
New Revision: 15185
Added:
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox5.png
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionboxAPI.png
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox_simple.png
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox2.png
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox3.png
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox4.png
branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox_init.png
Log:
https://jira.jboss.org/jira/browse/RF-7677 - rich:suggestionBox component description review
Modified: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox2.png
===================================================================
(Binary files differ)
Modified: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox3.png
===================================================================
(Binary files differ)
Modified: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox4.png
===================================================================
(Binary files differ)
Added: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox5.png
===================================================================
(Binary files differ)
Property changes on: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionboxAPI.png
===================================================================
(Binary files differ)
Property changes on: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionboxAPI.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox_init.png
===================================================================
(Binary files differ)
Added: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox_simple.png
===================================================================
(Binary files differ)
Property changes on: branches/community/3.3.X/docs/userguide/en/src/main/resources/images/suggestionbox_simple.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 4 months
JBoss Rich Faces SVN: r15184 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-08-17 09:00:39 -0400 (Mon, 17 Aug 2009)
New Revision: 15184
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.desc.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.xml
Log:
https://jira.jboss.org/jira/browse/RF-7677 - rich:suggestionBox component description review
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.desc.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.desc.xml 2009-08-17 12:39:01 UTC (rev 15183)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.desc.xml 2009-08-17 13:00:39 UTC (rev 15184)
@@ -1,48 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
-<sectioninfo>
-<keywordset>
- <keyword>rich:suggestionBox</keyword>
-</keywordset>
-</sectioninfo>
-<section>
-<title>Description</title>
- <para>The component adds on-keypress suggestions capabilities to any input text component
- (like <emphasis role="bold"><property><h:inputText></property></emphasis>). When a key
- is pressed in the field Ajax request is sent to the server. When the suggestion action returns a
- list of possible values, it pop ups them inside the
- <emphasis role="bold"><property><div></property></emphasis> element bellow the input.</para>
- <figure>
- <title><emphasis role="bold"><property><rich:suggestionbox></property></emphasis> component</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/suggestionbox_init.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section>
- <title>Key Features</title>
- <itemizedlist>
- <listitem><para>Fully skinnable component</para></listitem>
- <listitem><para>Adds <emphasis><property>"onkeypress"</property></emphasis> suggestions capabilities to any input text component</para></listitem>
- <listitem><para>Performs suggestion via Ajax requests without any line of JavaScript code written
- by you</para></listitem>
- <listitem><para>Possible to render table as a popup suggestion</para></listitem>
- <listitem><para>Can be pointed to any Ajax request status indicator of the page</para></listitem>
- <listitem><para>Easily customizable size of suggestion popup</para></listitem>
- <listitem><para>Setting rules that appear between cells within a table of popup values</para></listitem>
- <listitem><para><emphasis
-
-><property>"Event queue"</property></emphasis> and <emphasis
-
-><property>"request delay"</property></emphasis> attributes present to divide
- frequently requests</para></listitem>
- <listitem><para>Managing area of components submitted on Ajax request</para></listitem>
- <listitem><para>Flexible list of components to update after Ajax request managed by attributes</para></listitem>
- <listitem><para>Setting restriction to Ajax request generation</para></listitem>
- <listitem><para>Easily setting action to collect suggestion data</para></listitem>
- <listitem><para>Keyboard navigation support</para></listitem>
- </itemizedlist>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:suggestionBox</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <para>
+ The component adds on-keypress suggestions capabilities to any input
+ text component
+ like
+ <emphasis role="bold">
+ <property><h:inputText></property>
+ </emphasis>
+ .
+ </para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ component
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionbox_init.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
</section>
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Adds
+ <emphasis>
+ <property>"onkeypress"</property>
+ </emphasis>
+ suggestions capabilities to any input text component
+ </para>
+ </listitem>
+ <listitem>
+ <para>Possible to render table as a popup suggestion</para>
+ </listitem>
+ <listitem>
+ <para>Can be pointed to any Ajax request status indicator of the
+ page</para>
+ </listitem>
+ <listitem>
+ <para>Easily customizable look-and-feel</para>
+ </listitem>
+ <listitem>
+ <para>Fully skinnable component</para>
+ </listitem>
+ <listitem>
+ <para>Managing area of components submitted on Ajax request</para>
+ </listitem>
+ <listitem>
+ <para>Flexible list of components to update after Ajax request
+ managed by attributes</para>
+ </listitem>
+ <listitem>
+ <para>Setting restriction to Ajax request generation</para>
+ </listitem>
+ <listitem>
+ <para>Keyboard navigation support</para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
\ No newline at end of file
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.xml 2009-08-17 12:39:01 UTC (rev 15183)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.xml 2009-08-17 13:00:39 UTC (rev 15184)
@@ -1,734 +1,771 @@
<?xml version='1.0' encoding='UTF-8'?>
<section>
- <sectioninfo>
- <keywordset>
- <keyword>on-keypress suggestion</keyword>
- <keyword>rich:suggestionbox</keyword>
- <keyword>HtmlsuggestionBox</keyword>
- </keywordset>
- </sectioninfo>
+ <sectioninfo>
+ <keywordset>
+ <keyword>on-keypress suggestion</keyword>
+ <keyword>rich:suggestionbox</keyword>
+ <keyword>HtmlsuggestionBox</keyword>
+ </keywordset>
+ </sectioninfo>
- <table>
- <title>Component identification parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.SuggestionBox</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlSuggestionBox</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.richfaces.SuggestionBox</entry>
- </row>
- <row>
- <entry>renderer-type</entry>
- <entry>org.richfaces.SuggestionBoxRenderer</entry>
- </row>
- <row>
- <entry>tag-class</entry>
- <entry>org.richfaces.taglib.SuggestionBoxTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <section>
+ <title>Details of Usage</title>
- <section>
- <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant on a page use the following syntax:</para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<h:inputText value="#{bean.property}" id="suggest"/>
-<rich:suggestionbox for="suggest" suggestionAction="#{bean.autocomplete}" var="suggest">
- <h:column>
- <h:outputText value="#{suggest.text}"/>
- </h:column>
+ <section>
+ <title>Main attributes</title>
+ <para>There are 3 main component attributes:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>
+ <property>"for"</property>
+ </emphasis>
+ contains an ID of an input component
+ for which the suggestion
+ support is provided
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>
+ <property>"suggestionAction"</property>
+ </emphasis>
+ defines the method to get a collection of suggestion data on
+ request
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>
+ <property>"var"</property>
+ </emphasis>
+ defines a collection name that provides an access for the current
+ row while iterating through
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>To create the simplest variant on a page use the following
+ syntax:</para>
+ <programlisting role="XML"><![CDATA[...
+<h:inputText id="city" value="#{capitalsBean.capital}" />
+<rich:suggestionbox for="city" var="result" suggestionAction="#{capitalsBean.autocomplete}">
+ <h:column>
+ <h:outputText value="#{result.name}" />
+ </h:column>
</rich:suggestionbox>
...
]]></programlisting>
- <para>Here is the <code>bean.autocomplete</code> method that returns the
- collection to pop up:</para>
+ <para>
+ There is a managed bean:
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+public class SBbean {
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[public List autocomplete(Object event) {
- String pref = event.toString();
- //Collecting some data that begins with "pref" letters
- ...
- return result;
-}
+ private ArrayList<Capital> capitals = new ArrayList<Capital>();
+ private ArrayList<String> capitalsNames = new ArrayList<String>();
+ private List<SelectItem> capitalsOptions = new ArrayList<SelectItem>();
+ private String capital = "";
+
+ public List<Capital> autocomplete(Object suggest) {
+ String pref = (String) suggest;
+ ArrayList<Capital> result = new ArrayList<Capital>();
+
+ Iterator<Capital> iterator = getCapitals().iterator();
+ while (iterator.hasNext()) {
+ Capital elem = ((Capital) iterator.next());
+ if ((elem.getName() != null && elem.getName().toLowerCase()
+ .indexOf(pref.toLowerCase()) == 0)
+ || "".equals(pref)) {
+ result.add(elem);
+ }
+ }
+ return result;
+ }
+
+ public SBbean() {
+ URL rulesUrl = getClass().getResource("capitals-rules.xml");
+ Digester digester = DigesterLoader.createDigester(rulesUrl);
+ digester.push(this);
+ try {
+ digester.parse(getClass().getResourceAsStream("capitals.xml"));
+ } catch (IOException e) {
+ throw new FacesException(e);
+ } catch (SAXException e) {
+ throw new FacesException(e);
+ }
+ capitalsNames.clear();
+ for (Capital cap : capitals) {
+ capitalsNames.add(cap.getName());
+ }
+ capitalsOptions.clear();
+ for (Capital cap : capitals) {
+ capitalsOptions.add(new SelectItem(cap.getName(), cap.getState()));
+ }
+ }
+
+ public String addCapital(Capital capital) {
+ capitals.add(capital);
+ return null;
+ }
+}
]]></programlisting>
- </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ <para>
+ In the example above when suggestion item (city) is selected it is
+ set as a value of
+ <code><h:inputText id="city"/></code>
+ .
+ </para>
+ <para>
+ Here is a result:
+ </para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ Simple
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionbox_simple.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlSuggestionBox;
+ <para>
+ The
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ component could get any collection
+ and outputs it in a
+ popup in
+ several columns. The
+ <emphasis>
+ <property>"fetchValue"</property>
+ </emphasis>
+ attribute points to the data that is inserted into the input field
+ if a particular row is selected
+ or clicked from the suggested list.
+ Therefore when some string is chosen input
+ receives the proper value.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:inputText id="city" value="#{capitalsBean.capital}" />
+<rich:suggestionbox for="city" var="result" fetchValue="#{result.state}"
+ suggestionAction="#{capitalsBean.autocomplete}">
+ <h:column>
+ <h:outputText value="#{result.name}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{result.state}" />
+ </h:column>
+</rich:suggestionbox>
...
-HtmlSuggestionBox myList = new HtmlSuggestionBox();
-...
]]></programlisting>
- </section>
- <section>
- <title>Details of Usage</title>
- <para>As it is shown in the example above, the main component attribute are:</para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>
- <property>"for"</property>
- </emphasis>
- </para>
- <para>The attribute where there is an input component which
- activation causes a suggestion activation</para>
- </listitem>
- <listitem>
- <para>
- <emphasis>
- <property>"suggestionAction"</property>
- </emphasis>
- </para>
- <para> is an accepting parameter of a suggestionEvent type
- that returns as a result a collection for
- rendering in a tool tip window.</para>
- </listitem>
- <listitem>
- <para>
- <emphasis>
- <property>"var"</property>
- </emphasis>
- </para>
- <para> a collection name that provides access for inputting
- into a table in a popup</para>
- </listitem>
- </itemizedlist>
- <para>There are also two size attributes (<emphasis>
- <property>"width"</property>
- </emphasis> and <emphasis>
- <property>"height"</property>
- </emphasis>) that are obligatory for the suggestion component. The
- attributes have initial Defaults but should be specified manually in
- order to be changed.</para>
- <para>The <property>suggestionbox</property> component, as it is shown on the
- screenshot, could get any collection for an output and outputs it in a
- ToolTip window the same as a custom dataTable (in several columns)</para>
- <programlisting role="XML"><![CDATA[...
-<rich:suggestionbox for="test" suggestionAction="#{bean.autocomplete}" var="cit" fetchValue="#{cit.text}">
- <h:column>
- <h:outputText value="#{cit.label}"/>
- </h:column>
- <h:column>
- <h:outputText value="#{cit.text}"/>
- </h:column>
+ <para>
+ In the example above if you choose any string input will receive the
+ corresponding value
+ from the second column containing
+ <code>#{result.state}</code>
+ .
+ </para>
+ <para>Here is a result:</para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ with output in several columns
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionbox2.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>
+ There is also one more important attribute named
+ <emphasis>
+ <property>"tokens"</property>
+ </emphasis>
+ that specifies separators after which a set of some
+ characters
+ sequence is defined as a new prefix beginning from this
+ separator and
+ not from the string beginning.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:inputText id="city" value="#{capitalsBean.capital}" />
+<rich:suggestionbox for="city" var="result" suggestionAction="#{capitalsBean.autocomplete}"
+ tokens=",">
+ <h:column>
+ <h:outputText value="#{result.name}" />
+ </h:column>
</rich:suggestionbox>
...
]]></programlisting>
- <para>It looks on a page in the following way:</para>
- <figure>
- <title><emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> with ToolTip window</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/suggestionbox2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>When some string is chosen input receives the corresponding value from the
- second column containing <code>#{cit.text}</code></para>
- <para>There is also one more important attribute named <emphasis>
- <property>"tokens"</property>
- </emphasis> that specifies separators after which a set of some
- characters sequence is defined as a new prefix beginning from this
- separator and not from the string beginning.</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:suggestionbox for="test" suggestionAction="#{bean.autocomplete}" var="cit" selfRendered="true" tokens=",">
- <h:column>
- <h:outputText value="#{cit.text}"/>
- </h:column>
+ <para>This example shows that when a city is chosen and a comma and
+ first letter
+ character are input, Ajax request is called again, but
+ it
+ submits a
+ value starting from the last token:</para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ with chosen word
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionbox3.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>For
+ a multiple definition use either "
+ <code>,.;[]</code>
+ "
+ syntax as a value for
+ <emphasis>
+ <property>"tokens"</property>
+ </emphasis>
+ attribute or link a parameter to some bean
+ property that transmits
+ separators collection.
+ </para>
+ </section>
+ <section>
+ <title>JavaScript API</title>
+ <para>
+ There is such feature of the
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ component as
+ <property>object selection</property>
+ .
+ If you want to get the selected item as object on the client side
+ you should set the value of the
+ <emphasis>
+ <property> "usingSuggestObjects" </property>
+ </emphasis>
+ attribute
+ to "true".
+ After that you should specify
+ JavaScript method in the
+ <emphasis>
+ <property> "onobjectchange"</property>
+ </emphasis>
+ attribute and pass the
+ <code>suggestion</code>
+ object as a parameter:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:inputText id="city" value="#{capitalsBean.capital}" />
+<rich:suggestionbox for="city" var="result" suggestionAction="#{capitalsBean.autocomplete}"
+ onobjectchange="processObjects(suggestion)" usingSuggestObjects="true">
+ <h:column>
+ <h:outputText value="#{result.name}" />
+ </h:column>
</rich:suggestionbox>
+<h:panelGroup>
+ <div id="state"></div>
+</h:panelGroup>
...
]]></programlisting>
- <para>This example shows that when a city is chosen and a comma and first letter
- character are input, Ajax request is called again, but it submits a
- value starting from the last token:</para>
- <figure>
- <title><emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> with chosen word</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/suggestionbox3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>For a multiple definition use either "<code>,.;</code> "
- syntax as a value for tokens or link a parameter to some bean property
- transmitting separators collection.</para>
- <para>The component also encompasses <emphasis>
- <property>"style"</property>
- </emphasis> attributes corresponding to dataTable ones for a table
- appearing in popup (for additional information, read JSF Reference)
- and custom attribute managing Ajax requests sending (for additional
- information, see <ulink
- url="http://www.jboss.org/community/wiki/Ajax4jsf">Ajax4JSF
- Project</ulink>).</para>
- <para>In addition to these attributes common for Ajax action components and
- limiting requests quantity and frequency,
- <property>suggestionbox</property> has one more its own attribute
- limiting requests (the <emphasis>
- <property>"minChars"</property>
- </emphasis> attribute). The attribute defines characters quantity
- inputted into a field after which Ajax requests are called to perform
- suggestion.</para>
+ <para>
+ When the item is selected you can get it as an object on the client
+ side and use
+ <code>getSelectedItems()</code>
+ method to access any object properties:
+ </para>
+ <programlisting role="XML"><![CDATA[<script type="text/javascript">
+function processObjects(suggestionBox) {
+ var items = suggestionBox.getSelectedItems();
+ var state;
+ if (items && items.length > 0) {
+ for ( var i = 0; i < items.length; i++) {
+ state = items[i].state;
+ }
+ document.getElementById('state').innerHTML = "State: "+state;
+ }else{
+ document.getElementById('state').innerHTML = '';
+ }
+}
+</script>
+]]></programlisting>
+ <para>
+ Here is a result:
+ </para>
+ <figure>
+ <title>
+ Usage of
+ <code>getSelectedItems()</code>
+ method
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionboxAPI.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section>
+ <title>Other attributes and facets</title>
+ <para>
+ In addition to attributes common for Ajax action components
+ and
+ limiting requests quantity and frequency,
+ the
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ has one more its own attribute
+ limiting requests: the
+ <emphasis>
+ <property>"minChars"</property>
+ </emphasis>
+ attribute. This attribute defines characters quantity
+ inputted into a
+ field after which Ajax requests are called to perform
+ suggestion.
+ </para>
- <para> There is possibility to define what be shown if the autocomplete returns
- empty list. Attribute<emphasis>
- <property> "nothingLabel" </property>
- </emphasis>or facet with the same name could be used for it. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:suggestionbox nothingLabel="Empty" for="test" suggestionAction="#{bean.autocomplete}" var="cit">
- <h:column>
- <h:outputText value="#{cit.text}"/>
- </h:column>
+ <para>
+ There is possibility to define what is shown if the autocomplete
+ returns empty list. Attribute
+ <emphasis>
+ <property> "nothingLabel" </property>
+ </emphasis>
+ or facet with the same name could be used for this purpose.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:suggestionbox for="city" var="result" suggestionAction="#{capitalsBean.autocomplete}"
+ nothingLabel="No cities found">
+ <h:column>
+ <h:outputText value="#{result.name}" />
+ </h:column>
</rich:suggestionbox>
...
]]></programlisting>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:suggestionbox for="test" suggestionAction="#{bean.autocomplete}" var="cit">
+ <para>Here is a result:</para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ with empty list
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionbox4.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>
+ You can also use facets for the further
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ customization:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:inputText id="city" value="#{capitalsBean.capital}" />
+<rich:suggestionbox for="city" var="result" suggestionAction="#{capitalsBean.autocomplete}">
<f:facet name="nothingLabel">
- <h:outputText value="Empty"/>
- </f:facet>
+ <h:outputText value="No cities found" />
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="Select your city" />
+ </f:facet>
<h:column>
- <h:outputText value="#{cit.text}"/>
+ <h:outputText value="#{result.name}" />
</h:column>
</rich:suggestionbox>
...
]]></programlisting>
-
-
- <para>It looks on a page in the following way:</para>
-
- <figure>
- <title><emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> with empty list</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/suggestionbox4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para> There is such feature in <emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> component as object selection. If you want that selected
- item has been represented as object, you could set to "true" the value
- for <emphasis>
- <property> "usingSuggestObjects"
- </property>
- </emphasis> attribute, "false" value means that selected item
- represents as string. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:suggestionbox for="test" suggestionAction="#{bean.autocomplete}" var="cit" usingSuggestObjects="true">
- <h:column>
- <h:outputText value="#{cit.text}"/>
- </h:column>
-</rich:suggestionbox>
-...
-]]></programlisting>
- <para> Information about the <emphasis>
- <property>"process"</property>
- </emphasis> attribute usage you can findin the
- <link linkend="process"> "Decide what to process" </link> guide section. </para>
- <para>In RichFaces Wiki article about
- <ulink
- url="http://wiki.jboss.org/wiki/RichFacesSuggestionGettingAdditionalProperties"
- >Additional Properties </ulink> you can find example of getting additional
- properties. </para>
- </section>
- <section>
- <title>JavaScript API</title>
- <table>
- <title>JavaScript API</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Function</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
-
- <row>
- <entry>callSuggestion()</entry>
- <entry>Calls the suggestion. If the
- "ignoreMinChars"
- value is
- "true" then
- the number of symbols to send
- a query is no longer actual
- for callSuggestion()</entry>
- </row>
-
- <row>
- <entry>getSelectedItems()</entry>
- <entry>Returns the array of
- objects</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
- </section>
-
+ <para>
+ Here is a result:
+ </para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ facets
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionbox5.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>
+ Information about the
+ <emphasis>
+ <property>"process"</property>
+ </emphasis>
+ attribute usage you can findin the
+ <link linkend="process"> "Decide what to process" </link>
+ guide section.
+ </para>
+ <para>
+ In RichFaces Wiki article about
+ <ulink
+ url="http://wiki.jboss.org/wiki/RichFacesSuggestionGettingAdditionalProperties">
+ Additional Properties </ulink>
+ you can find example of getting additional
+ properties.
+ </para>
+ </section>
<section>
- <title>Facets</title>
- <table>
- <title>Facets</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Facet name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>nothingLabel</entry>
- <entry>Redefines the content item if the autocomplete returns empty list. Related attribute is "nothingLabel"</entry>
- </row>
- <row>
- <entry>popup</entry>
- <entry>Redefines the content for the popup list of the suggestion</entry>
- </row>
- <row>
- <entry>header</entry>
- <entry>Defines the header content</entry>
- </row>
- <row>
- <entry>footer</entry>
- <entry>Defines the footer content</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-
- <section>
- <title>Look-and-Feel Customization</title>
+ <title>Custom style classes redefinition</title>
+ <para>
+ In order to redefine styles for all
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ components on a page using CSS, it's enough to
+ create classes
+ with the same names (possible classes could be found in
+ the tables
+ <link linkend="suggBoxC"> above</link>
+ ) and define
+ necessary properties in them.
+ </para>
- <para>For skinnability implementation, the components use a <emphasis>
- <property>style class redefinition method.</property>
- </emphasis> Default style classes are mapped on <emphasis>
- <property>skin parameters.</property>
- </emphasis></para>
-
- <para>There are two ways to redefine the appearance of all <emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> components at once:</para>
-
- <itemizedlist>
- <listitem>
- <para>Redefine the corresponding skin parameters</para>
- </listitem>
-
- <listitem>
- <para>Add to your style sheets <emphasis>
- <property>style classes</property>
- </emphasis> used by a <emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> component</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title> Skin Parameters Redefinition</title>
-
- <table>
- <title>General skin parameters redefinition for popup list</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Parameters for popup list</entry>
-
- <entry>CSS properties</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>additionalBackgroundColor</entry>
-
- <entry>background-color</entry>
- </row>
-
- <row>
- <entry>panelBorderColor</entry>
-
- <entry>border-color</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table>
- <title>Skin parameters redefinition for shadow element of the list</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Parameters for shadow element of
- the list</entry>
-
- <entry>CSS properties</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>shadowBackgroundColor</entry>
-
- <entry>background-color</entry>
- </row>
-
- <row>
- <entry>shadowBackgroundColor</entry>
-
- <entry>border-color</entry>
- </row>
-
- <row>
- <entry>shadowOpacity</entry>
-
- <entry>opacity</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table>
- <title>Skin parameters redefinition for popup table rows</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Parameters for popup table rows</entry>
-
- <entry>CSS properties</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>generalSizeFont</entry>
-
- <entry>font-size</entry>
- </row>
-
- <row>
- <entry>generalTextColor</entry>
-
- <entry>color</entry>
- </row>
-
- <row>
- <entry>generalFamilyFont</entry>
-
- <entry>font-family</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table>
- <title>Skin parameters redefinition for selected row</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Parameters for selected row</entry>
-
- <entry>CSS properties</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>headerBackgroundColor</entry>
-
- <entry>background-color</entry>
- </row>
-
- <row>
- <entry>generalSizeFont</entry>
-
- <entry>font-size</entry>
- </row>
-
- <row>
- <entry>generalFamilyFont</entry>
-
- <entry>font-family</entry>
- </row>
- <row>
- <entry>headerTextColor</entry>
-
- <entry>color</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
- </section>
-
- <section>
- <title>Definition of Custom Style Classes</title>
-
- <figure>
- <title>Classes names</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/suggestionbox_cn.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>On the screenshot, there are classes names defining specified elements.</para>
-
- <table id="suggBoxC">
- <title>Classes names that define a suggestionbox</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>rich-sb-common-container</entry>
-
- <entry>Defines styles for a wrapper
- <div> element of
- a suggestion container</entry>
- </row>
-
- <row>
- <entry>rich-sb-ext-decor-1</entry>
-
- <entry>Defines styles for the first
- wrapper <div>
- element of a suggestion box
- exterior</entry>
- </row>
-
- <row>
- <entry>rich-sb-ext-decor-2</entry>
-
- <entry>Defines styles for the second
- wrapper <div>
- element of a suggestion box
- exterior</entry>
- </row>
-
- <row>
- <entry>rich-sb-ext-decor-3</entry>
-
- <entry>Defines styles for the third
- wrapper <div>
- element of a suggestion box
- exterior</entry>
- </row>
-
- <row>
- <entry>rich-sb-overflow</entry>
-
- <entry>Defines styles for a wrapper
- <div>
- element</entry>
- </row>
-
- <row>
- <entry>rich-sb-int-decor-table</entry>
-
- <entry>Defines styles for a suggestion
- box table</entry>
- </row>
-
- <row>
- <entry>rich-sb-int</entry>
-
- <entry>Defines the styles for a
- suggestion box table rows
- (tr)</entry>
- </row>
-
- <row>
- <entry>rich-sb-cell-padding</entry>
-
- <entry>Defines the styles for suggestion
- box table cells (td)</entry>
- </row>
-
- <row>
- <entry>rich-sb-int-sel</entry>
-
- <entry>Defines styles for a selected
- row</entry>
- </row>
-
- <row>
- <entry>rich-sb-shadow</entry>
-
- <entry>Defines styles for a suggestion
- boxshadow</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> components on a page using CSS, it's enough to
- create classes with the same names (possible classes could be found in
- the tables <link linkend="suggBoxC"> above</link>) and define
- necessary properties in them. </para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="CSS"><![CDATA[...
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
.rich-sb-int{
font-weight:bold;
}
...]]></programlisting>
- <para>This is a result:</para>
+ <para>This is a result:</para>
- <figure>
- <title>Redefinition styles with predefined classes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/suggestionbox_pc.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionbox_pc.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
- <para>In the example the font weight for rows was changed.</para>
+ <para>In the example the font weight for rows was changed.</para>
- <para>Also it's possible to change styles of particular <emphasis
- role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> component. In this case you should create own style
- classes and use them in corresponding <emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis>
- <emphasis>
- <property>styleClass</property>
- </emphasis> attributes. An example is placed below:</para>
+ <para>Also
+ it's possible to change styles of particular
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ component. In this case you should create own style
+ classes and use
+ them in corresponding
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ <emphasis>
+ <property>styleClass</property>
+ </emphasis>
+ attributes. An example is placed below:
+ </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="CSS"><![CDATA[...
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
.myClass{
background-color:#f0ddcd;
}
...]]></programlisting>
- <para>The <emphasis>
- <property>"selectedClass"</property>
- </emphasis> attribute for <emphasis role="bold">
- <property><rich:suggestionbox></property>
- </emphasis> is defined as it's shown in the example below:</para>
+ <para>
+ The
+ <emphasis>
+ <property>"selectedClass"</property>
+ </emphasis>
+ attribute for
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ is defined as it's shown in the example below:
+ </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[<rich:suggestionbox ... selectedClass="myClass"/>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:suggestionbox ... selectedClass="myClass"/>
]]></programlisting>
- <para>This is a result:</para>
+ <para>This is a result:</para>
- <figure>
- <title>Redefinition styles with own classes and <emphasis>
- <property>styleClass</property>
- </emphasis> attributes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/suggestionbox_oc.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <figure>
+ <title>
+ Redefinition styles with own classes and
+ <emphasis>
+ <property>styleClass</property>
+ </emphasis>
+ attributes
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/suggestionbox_oc.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
- <para>As it could be seen on the picture above,background color for selected
- item was changed.</para>
+ <para>As it could be seen on the picture above,background color for
+ selected
+ item was changed.</para>
+ </section>
+ </section>
+ <section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:suggestionbox</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Reference Data</title>
+ <para>
+ <ulink
+ url="http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/...">
+ Table of <rich:suggestionbox> attributes
+ </ulink>
+ </para>
+ <table>
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.SuggestionBox</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.HtmlSuggestionBox</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.SuggestionBox</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.SuggestionBoxRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.SuggestionBoxTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Facets</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Facet name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>nothingLabel</entry>
+ <entry>Redefines the content item if the autocomplete returns
+ empty
+ list. Related attribute is "nothingLabel"</entry>
+ </row>
+ <row>
+ <entry>popup</entry>
+ <entry>Redefines the content for the popup list of the suggestion
+ </entry>
+ </row>
+ <row>
+ <entry>header</entry>
+ <entry>Defines the header content</entry>
+ </row>
+ <row>
+ <entry>footer</entry>
+ <entry>Defines the footer content</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>JavaScript API</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Function</entry>
- </section>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>callSuggestion()</entry>
+ <entry>Calls the suggestion. If the
+ "ignoreMinChars"
+ value is
+ "true" then
+ the number of symbols to send
+ a query
+ is no longer actual
+ for callSuggestion()</entry>
+ </row>
- <section>
- <title>Relevant Resources Links</title>
- <para>Vizit <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/suggestionBox.jsf?c=s...">SuggestionBox</ulink>
- page at RichFaces Livedemo for examples of component usage and sources.
- </para>
- <para>RichFaces cookbook at JBoss Portal includes some articles that cover different aspects of working with
- <emphasis role="bold"><property><rich:suggestionbox></property></emphasis>:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- "<ulink url="http://www.jboss.org/community/docs/DOC-11851">Creating suggestion box dynamically</ulink>";
- </para>
- </listitem>
- <listitem>
- <para>
- "<ulink url="http://www.jboss.org/community/docs/DOC-11865">Getting additional properties from <rich:suggectionbox></ulink>".
- </para>
- </listitem>
- </itemizedlist>
-
-
- </section>
+ <row>
+ <entry>getSelectedItems()</entry>
+ <entry>Returns the array of
+ objects</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table id="suggBoxC">
+ <title>Classes names with the corresponding skin parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ <entry>Skin Parameters</entry>
+ <entry>CSS properties</entry>
+
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry morerows="2">.rich-sb-int</entry>
+ <entry morerows="2">Defines the styles for a
+ suggestion box table
+ rows
+ <tr></entry>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+
+ <row>
+ <entry morerows="3">.rich-sb-int-sel</entry>
+ <entry morerows="3">Defines styles for a selected
+ row</entry>
+ <entry>headerBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>headerTextColor</entry>
+ <entry>color</entry>
+ </row>
+ <row>
+ <entry morerows="1">.rich-sb-ext-decor-2</entry>
+ <entry morerows="1">Defines styles for the second
+ wrapper
+ <div>
+ element of
+ a suggestion box
+ exterior</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry morerows="2">.rich-sb-shadow</entry>
+ <entry morerows="2">Defines styles for a suggestion
+ boxshadow
+ </entry>
+ <entry>shadowBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>shadowBackgroundColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>shadowOpacity</entry>
+ <entry>opacity</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section>
+ <title>Relevant Resources Links</title>
+ <para>
+ Vizit
+ <ulink
+ url="http://livedemo.exadel.com/richfaces-demo/richfaces/suggestionBox.jsf?c=s..."><emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis></ulink>
+ page at RichFaces Livedemo for examples of component usage and
+ sources.
+ </para>
+ <para>
+ RichFaces cookbook at JBoss Portal includes some articles that cover
+ different aspects of working with
+ <emphasis role="bold">
+ <property><rich:suggestionbox></property>
+ </emphasis>
+ :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ "
+ <ulink url="http://www.jboss.org/community/docs/DOC-11851">Creating suggestion box dynamically</ulink>
+ ";
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ "
+ <ulink url="http://www.jboss.org/community/docs/DOC-11865">Getting additional properties from
+ <rich:suggectionbox></ulink>
+ ".
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
15 years, 4 months
JBoss Rich Faces SVN: r15183 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-08-17 08:39:01 -0400 (Mon, 17 Aug 2009)
New Revision: 15183
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
RF-7689: rich:editor component description review
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml 2009-08-17 10:51:10 UTC (rev 15182)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml 2009-08-17 12:39:01 UTC (rev 15183)
@@ -380,43 +380,33 @@
<thead>
<row>
<entry>Skin parameters</entry>
-
- <entry>CSS properties</entry>
+ <entry>CSS properties</entry>
</row>
</thead>
<tbody>
<row>
<entry>additionalBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
</tbody>
</tgroup>
</table>
-
-
<table>
<title>Skin parameters redefinition for external controls</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
<row>
<entry>panelBorderColor</entry>
-
<entry>border-color</entry>
</row>
-
</tbody>
</tgroup>
</table>
@@ -424,12 +414,10 @@
<table>
<title>Skin parameters redefinition for layout</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
@@ -437,386 +425,235 @@
<tbody>
<row>
<entry>panelBorderColor</entry>
-
<entry>border-left-color</entry>
</row>
-
-
<row>
<entry>panelBorderColor</entry>
-
<entry>border-right-color</entry>
</row>
-
-
-
<row>
<entry>panelBorderColor</entry>
-
<entry>border-top-color</entry>
</row>
-
-
<row>
<entry>panelBorderColor</entry>
-
<entry>border-bottom-color</entry>
</row>
-
<row>
-
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
-
-
<row>
<entry>generalTextColor</entry>
-
<entry>color</entry>
</row>
-
-
<row>
<entry>headerBackgroundColor</entry>
-
<entry>background-color</entry>
</row>
-
</tbody>
</tgroup>
</table>
<table>
<title>Skin parameters redefinition for buttons</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
-
<row>
<entry>headerBackgroundColor</entry>
-
<entry>background-color</entry>
</row>
-
</tbody>
</tgroup>
</table>
-
-
-
-
<table>
<title>Skin parameters redefinition for list box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
-
</row>
</thead>
-
<tbody>
-
-
<row>
<entry>tableBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
-
<row>
<entry>panelBorderColor</entry>
-
<entry>border-color</entry>
</row>
-
-
<row>
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
<table>
<title>Skin parameters redefinition for color split button</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
-
<row>
<entry>tableBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
-
<row>
<entry>panelBorderColor</entry>
-
<entry>border-color</entry>
</row>
-
-
<row>
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
-
<row>
<entry>additionalBackgroundColor</entry>
-
<entry>background-color</entry>
</row>
-
-
</tbody>
</tgroup>
</table>
-
-
<table>
<title>Skin parameters redefinition for hovered color split button</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>headerBackgroundColor</entry>
-
<entry>border-color</entry>
</row>
-
-
</tbody>
</tgroup>
</table>
-
-
-
<table>
<title>Skin parameters redefinition for menu</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>panelBorderColor</entry>
-
<entry>border-color</entry>
</row>
-
<row>
<entry>tableBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
-
<row>
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
<row>
<entry>generalTextColor</entry>
-
<entry>color</entry>
</row>
-
<row>
<entry>additionalBackgroundColor</entry>
-
<entry>background-color</entry>
</row>
-
-
<row>
<entry>additionalBackgroundColor</entry>
-
<entry>background-color</entry>
</row>
-
</tbody>
</tgroup>
</table>
-
<table>
<title>Skin parameters redefinition for menu item</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>additionalBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
<row>
<entry>panelBorderColor</entry>
-
<entry>border-bottom-color</entry>
</row>
-
-
<row>
<entry>generalTextColor</entry>
-
<entry>color</entry>
</row>
-
<row>
<entry>generalTextColor</entry>
-
<entry>color</entry>
</row>
-
<row>
<entry>tabDisabledTextColor</entry>
-
<entry>color</entry>
</row>
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
-
<table>
<title>Skin parameters redefinition for progress and resize states</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>tableBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
<row>
<entry>tableBorderColor</entry>
-
<entry>border-color</entry>
</row>
-
-
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
-
-
<table>
<title>Skin parameters redefinition for dialog box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
<row>
<entry>generalBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
-
-
-
-
-
</tbody>
</tgroup>
</table>
@@ -829,341 +666,199 @@
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>generalTextColor</entry>
-
<entry>color</entry>
</row>
-
<row>
<entry>hoverLinkColor</entry>
-
<entry>color</entry>
</row>
-
-
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
-
-
<table>
<title>Skin parameters redefinition for link in dialog box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>generalTextColor</entry>
-
<entry>color</entry>
</row>
-
<row>
<entry>hoverLinkColor</entry>
-
<entry>color</entry>
</row>
-
-
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
<table>
<title>Skin parameters redefinition for fieldset in dialog box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
<row>
<entry>panelBorderColor</entry>
-
<entry>border-color</entry>
</row>
-
-
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
-
-
<table>
<title>Skin parameters redefinition for fieldset legend in dialog box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>generalLinkColor</entry>
-
<entry>color</entry>
</row>
-
-
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
-
<table>
<title>Skin parameters redefinition for input elements in dialog box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>warningColor</entry>
-
<entry>color</entry>
</row>
-
-
-
<row>
<entry>warningColor</entry>
-
<entry>border-color</entry>
</row>
-
-
-
<row>
<entry>controlBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
<row>
<entry>tableBorderColor</entry>
-
<entry>border-color</entry>
</row>
-
-
<row>
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
-
<table>
<title>Skin parameters redefinition for panel wrapper in dialog box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>panelBorderColor</entry>
-
- <entry>border-color</entry>
+ <entry>border-color</entry>
</row>
-
<row>
<entry>tableBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
<table>
<title>Skin parameters redefinition for headers in dialog box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>generalLinkColor</entry>
-
<entry>color</entry>
</row>
-
-
-
-
</tbody>
</tgroup>
</table>
-
-
<table>
<title>Skin parameters redefinition for links in tabs in dialog box</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
-
<row>
<entry>generalTextColor</entry>
-
<entry>color</entry>
</row>
-
-
</tbody>
</tgroup>
</table>
-
-
-
<table>
<title>Skin parameters redefinition for main text area</title>
-
<tgroup cols="2">
<thead>
<row>
<entry>Skin parameters</entry>
-
<entry>CSS properties</entry>
</row>
</thead>
-
<tbody>
-
<row>
<entry>generalFamilyFont</entry>
-
<entry>font-family</entry>
</row>
-
-
<row>
<entry>generalTextColor</entry>
-
<entry>color</entry>
</row>
-
<row>
<entry>tableBackgroundColor</entry>
-
<entry>background</entry>
</row>
-
-
-
</tbody>
</tgroup>
</table>
-
-
-
-
-
</section>
<section id="EditorDefinitionofCustomStyleSelectors">
@@ -1195,48 +890,79 @@
<row>
<entry>.richfacesSkin .mceButton</entry>
<entry>Defines styles for the buttons</entry>
+ <entry>n/a</entry>
+ <entry>background-image</entry>
</row>
+
<row>
<entry>.richfacesSkin .mceButtonDisabled .mceIcon </entry>
<entry>Defines styles for the icons</entry>
+ <entry>n/a</entry>
+ <entry>opacity</entry>
</row>
+
<row>
<entry>.richfacesSkin .mceIframeContainer</entry>
<entry>Defines styles for the container</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-top-color, border-bottom-color</entry>
</row>
+
<row>
- <entry>.richfacesSkin .mceListBox</entry>
- <entry>Defines styles for the list box</entry>
+ <entry morerows="2">.richfacesSkin .mceListBox .mceText</entry>
+ <entry morerows="2">Defines styles for the list box</entry>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
</row>
<row>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tableBackgroundColor</entry>
+ <entry>background</entry>
+ </row>
+
+ <row>
+ <entry>.richfacesSkin .mceExternalToolbar</entry>
+ <entry>Defines styles for the toolbar</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+
+ <row>
<entry>.richfacesSkin .mceMenu</entry>
<entry>Defines styles for the menus</entry>
+ <entry>panelBorderColor</entry>
+ <entry>border-color</entry>
</row>
+
<row>
<entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
<entry>Defines styles for the active menu items</entry>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
</row>
+
<row>
- <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
- <entry>Defines styles for the active menu items</entry>
- </row>
- <row>
<entry>.richfacesSkin .mceSeparator</entry>
<entry>Defines styles for the buttons separator</entry>
+ <entry>n/a</entry>
+ <entry>background-image</entry>
</row>
+
<row>
- <entry>.richfacesSkin .mceToolbar</entry>
- <entry>Defines styles for the toolbar</entry>
- </row>
- <row>
- <entry morerows="2">.richfacesSkin table.mceLayout</entry>
- <entry morerows="2">Defines styles for the table layout</entry>
- <entry>additionalBackgroundColor</entry>
+ <entry>.richfacesSkin table.mceLayout</entry>
+ <entry>Defines styles for the table layout</entry>
<entry>panelBorderColor</entry>
+ <entry>border-left-color, border-right-color</entry>
</row>
+
<row>
<entry>.richfacesSkin table.mceToolbar</entry>
<entry>Defines styles for the rows of icons within toolbar</entry>
+ <entry>n/a</entry>
+ <entry>padding</entry>
</row>
</tbody>
</tgroup>
15 years, 4 months
JBoss Rich Faces SVN: r15182 - Reports/3.3.2 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2009-08-17 06:51:10 -0400 (Mon, 17 Aug 2009)
New Revision: 15182
Added:
branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1(08.10-14).xls
Modified:
branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1(08.03-07).xls
Log:
Modified: branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1(08.03-07).xls
===================================================================
(Binary files differ)
Added: branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1(08.10-14).xls
===================================================================
(Binary files differ)
Property changes on: branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1(08.10-14).xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 4 months
JBoss Rich Faces SVN: r15181 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-08-17 03:55:09 -0400 (Mon, 17 Aug 2009)
New Revision: 15181
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.desc.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.desc.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.desc.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
Log:
https://jira.jboss.org/jira/browse/RF-7685 - component description review;
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.desc.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.desc.xml 2009-08-14 22:10:22 UTC (rev 15180)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.desc.xml 2009-08-17 07:55:09 UTC (rev 15181)
@@ -7,7 +7,7 @@
</sectioninfo>
<section>
<title>Description</title>
- <para>The component for definition lists rendering that allows choosing data from a model
+ <para>The component to render definition lists that allows choosing data from a model
and obtains built-in support of Ajax updates.</para>
<figure>
<title><emphasis role="bold"><property><rich:dataDefinitionList></property></emphasis> component</title>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2009-08-14 22:10:22 UTC (rev 15180)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2009-08-17 07:55:09 UTC (rev 15181)
@@ -73,13 +73,13 @@
<title>Details of Usage</title>
<para>The <emphasis role="bold">
<property><rich:dataDefinitionList></property>
- </emphasis> component allows to generate an definition list from a model.</para>
+ </emphasis> component allows to generate a definition list from a model.</para>
<para>The component has the <emphasis>
<property>"term"</property>
</emphasis> facet, which corresponds to the <emphasis>
<property>"type"</property>
</emphasis> parameter for the <emphasis role="bold">
- <property><DT></property>
+ <property><dt></property>
</emphasis> HTML element.</para>
<para>Here is an example:</para>
@@ -115,18 +115,18 @@
<para>In the example the <emphasis>
<property>"rows"</property>
- </emphasis> attribute limits number of output elements of the list.</para>
+ </emphasis> attribute limits a number of output elements of the list.</para>
- <para><emphasis>
+ <para>The <emphasis>
<property>"first"</property>
- </emphasis> attribute defines first element for output. <emphasis>
+ </emphasis> attribute defines the first element for output. <emphasis>
<property>"title"</property>
- </emphasis> are used for popup title.</para>
+ </emphasis> is used for a popup title.</para>
- <para>The component was created basing on the <emphasis role="bold">
- <property><a4j:repeat></property>
- </emphasis> component and as a result it could be partially updated with Ajax. <emphasis>
- <property>The "ajaxKeys"</property>
+ <para>The <emphasis role="bold">
+ <property><rich:dataDefinitionList></property>
+ </emphasis> component could be partially updated with Ajax. The <emphasis>
+ <property>"ajaxKeys"</property>
</emphasis> attribute allows to define row keys that are updated after an Ajax request, you need to pass an array with key (lines) of the list that you want to be updated after the Ajax request is executed.</para>
<para>Here is an example:</para>
@@ -143,7 +143,7 @@
...
]]></programlisting>
- <para> In the example <emphasis>
+ <para> In the example the <emphasis>
<property>"reRender"</property>
</emphasis> attribute contains value of <emphasis>
<property>"id"</property>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.desc.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.desc.xml 2009-08-14 22:10:22 UTC (rev 15180)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.desc.xml 2009-08-17 07:55:09 UTC (rev 15181)
@@ -7,7 +7,7 @@
</sectioninfo>
<section>
<title>Description</title>
- <para>The component for unordered lists rendering that allows choosing data from a model
+ <para>The component to render unordered lists that allows choosing data from a model
and obtains built-in support of Ajax updates.</para>
<figure>
<title><emphasis role="bold"><property><rich:dataList></property></emphasis> component</title>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.xml 2009-08-14 22:10:22 UTC (rev 15180)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.xml 2009-08-17 07:55:09 UTC (rev 15181)
@@ -80,7 +80,7 @@
</emphasis> attribute, which corresponds to the <emphasis>
<property>"type"</property>
</emphasis> parameter for the <emphasis role="bold">
- <property><UL></property>
+ <property><ul></property>
</emphasis> HTML element and defines a marker type. Possible values for <emphasis>
<property>"type"</property>
</emphasis> attribute are: "disc",
@@ -118,16 +118,16 @@
<para>In the example the <emphasis>
<property>"rows"</property>
- </emphasis> attribute limits number of output elements of the list.</para>
+ </emphasis> attribute limits a number of output elements of the list.</para>
- <para><emphasis>
+ <para>The <emphasis>
<property>"first"</property>
- </emphasis> attribute defines first element for output. <emphasis>
+ </emphasis> attribute defines the first element for output. <emphasis>
<property>"title"</property>
- </emphasis> are used for popup title. See picture below:</para>
+ </emphasis> is used for a popup title. See the picture below:</para>
<figure>
- <title><emphasis role="bold">
+ <title>The <emphasis role="bold">
<property><rich:dataList></property>
</emphasis> component with <emphasis>
<property>"title"</property>
@@ -139,9 +139,11 @@
</mediaobject>
</figure>
- <para>The component was created basing on the <emphasis role="bold">
- <property><a4j:repeat></property>
- </emphasis> component and as a result it could be partially updated with Ajax. <emphasis>
+ <para>The <emphasis role="bold">
+ <property><rich:dataList></property>
+ </emphasis>
+ component could be partially updated with
+ Ajax. The <emphasis>
<property>"ajaxKeys"</property>
</emphasis> attribute allows to define row keys that are updated after an Ajax request.</para>
<para>Here is an example:</para>
@@ -161,7 +163,7 @@
<para> In the example <emphasis>
<property>"reRender"</property>
- </emphasis> attribute contains value of <emphasis>
+ </emphasis> attribute contains the value of <emphasis>
<property>"id"</property>
</emphasis> attribute for <emphasis role="bold">
<property><rich:dataList></property>
@@ -257,7 +259,7 @@
</mediaobject>
</figure>
- <para>In the example the font style for list item text was changed.</para>
+ <para>In the example the font style for the text of the list item was changed.</para>
<para>Also it's possible to change styles of particular <emphasis role="bold"
><property><rich:dataList></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.desc.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.desc.xml 2009-08-14 22:10:22 UTC (rev 15180)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.desc.xml 2009-08-17 07:55:09 UTC (rev 15181)
@@ -7,7 +7,7 @@
</sectioninfo>
<section>
<title>Description</title>
- <para>The component for ordered lists rendering that allows choosing data from a model
+ <para>The component to render ordered lists that allows choosing data from a model
and obtains built-in support of Ajax updates.</para>
<figure>
<title><emphasis role="bold"><property><rich:dataOderedList></property></emphasis> component</title>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2009-08-14 22:10:22 UTC (rev 15180)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2009-08-17 07:55:09 UTC (rev 15181)
@@ -96,7 +96,7 @@
</emphasis>
parameter for the
<emphasis role="bold">
- <property><OL></property>
+ <property><ol></property>
</emphasis>
HTML element and defines a marker type. Possible values for
<emphasis>
@@ -126,7 +126,7 @@
<emphasis role="bold">
<property><rich:dataOrderedList></property>
</emphasis>
- component with
+ component with the
<emphasis>
<property>"type"</property>
</emphasis>
@@ -144,27 +144,26 @@
<emphasis>
<property>"rows"</property>
</emphasis>
- attribute limits number of output elements of the list.
+ attribute limits a number of output elements of the list.
</para>
- <para>
+ <para>The
<emphasis>
<property>"first"</property>
</emphasis>
- attribute defines first element for output.
+ attribute defines the first element for output.
<emphasis>
<property>"title"</property>
</emphasis>
- are used for popup title.
+ is used for a popup title.
</para>
<para>
- The component was created basing on the
- <emphasis role="bold">
- <property><a4j:repeat></property>
+ The <emphasis role="bold">
+ <property><rich:dataOrderedList></property>
</emphasis>
- component and as a result it could be partially updated with
- Ajax.
+ component could be partially updated with
+ Ajax. The
<emphasis>
<property>"ajaxKeys"</property>
</emphasis>
@@ -191,11 +190,11 @@
<emphasis>
<property>"reRender"</property>
</emphasis>
- attribute contains value of
+ attribute contains value of the
<emphasis>
<property>"id"</property>
</emphasis>
- attribute for
+ attribute for the
<emphasis role="bold">
<property><rich:dataOrderedList></property>
</emphasis>
15 years, 4 months
JBoss Rich Faces SVN: r15180 - in root/cdk/trunk/plugins/generator/src: main/java/org/richfaces/cdk/apt and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-08-14 18:10:22 -0400 (Fri, 14 Aug 2009)
New Revision: 15180
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.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/DescriptionGroup.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ClassDescriptionTest.java
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/NamingConventions.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/CdkCompiler.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.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/Event.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/JsfType.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.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/FacesConfigParser.java
Log:
Add JAXB annotations to model
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/NamingConventions.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/NamingConventions.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/NamingConventions.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -67,4 +67,8 @@
*/
public String inferUIComponentClass(String componentType, String explicitClass, String baseClass, boolean baseClassIsAbstract) throws InvalidNameException;
+ public String inferUIComponentBaseClass(String componentType,String baseClassName, boolean baseClassIsAbstract);
+
+ public String inferUIComponentFamily(String componentType, String explicitFamily);
+
}
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 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/RichFacesConventions.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -87,7 +87,7 @@
if(!Strings.isEmpty(explicitClass)){
// Class name provided by developer.
className = explicitClass;
- } else if (baseClassIsAbstract || baseClass.startsWith(ABSTRACT)|| baseClass.endsWith(BASE)) {
+ } else if (isAbstract(baseClass, baseClassIsAbstract)) {
// Infer UI class name from component type.
Name name = Name.create(componentType);
name.setClassifier(Classifier.component);
@@ -102,6 +102,25 @@
}
+ private boolean isAbstract(String baseClass, boolean baseClassIsAbstract) {
+ return baseClassIsAbstract || baseClass.startsWith(ABSTRACT)|| baseClass.endsWith(BASE);
+ }
+
+
+ @Override
+ public String inferUIComponentBaseClass(String componentType,
+ String baseClassName, boolean baseClassIsAbstract) {
+ return isAbstract(baseClassName, baseClassIsAbstract)?baseClassName:null;
+ }
+
+
+ @Override
+ public String inferUIComponentFamily(String componentType,
+ String explicitFamily) {
+ return Strings.isEmpty(explicitFamily)?componentType:explicitFamily;
+ }
+
+
/**
* <p class="changed_added_4_0"></p>
* @return the baseName
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkCompiler.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkCompiler.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkCompiler.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -73,6 +73,8 @@
private Locale locale;
private CdkContext context;
+
+ private boolean initialized = false;
/**
* <p class="changed_added_4_0">Builder method that creates and initializes compiler instance.
@@ -83,9 +85,8 @@
@Override
public void init(CdkContext context) {
this.context = context;
- CdkCompiler compiler = new CdkCompiler();
JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler();
- compiler.setJavaCompiler(javaCompiler);
+ setJavaCompiler(javaCompiler);
ArrayList<String> options = new ArrayList<String>();
options.add("-proc:only");
options.add("-implicit:class");
@@ -129,9 +130,9 @@
}
options.add(generatedSourceFolders.toString());
}
- compiler.setOptions(options);
+ setOptions(options);
// TODO - provide source files locale.
- compiler.setLocale(Locale.getDefault());
+ setLocale(Locale.getDefault());
// TODO -set locale and charset for platform-independent processing. Provide own diagnostics listener.
StandardJavaFileManager stdFileManager = javaCompiler
.getStandardFileManager(null, null, null);
@@ -139,11 +140,15 @@
VirtualFileManager fileManager = new VirtualFileManager(stdFileManager,
context.getLoader());
fileManager.setJavaSourceDirectory(context.getJavaSource());
- compiler.setFileManager(fileManager);
+ setFileManager(fileManager);
+ initialized = true;
}
@Override
public ComponentLibrary build() throws CdkException {
+ if(!initialized){
+ throw new CdkException("Annotation processor is not initialized");
+ }
ComponentLibrary library = new ComponentLibrary();
ComponentProcessor processor = new ComponentProcessor(context,library);
process(context.getSources(StandardSources.JAVA_SOURCES),processor);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -49,85 +49,121 @@
import org.richfaces.cdk.util.Strings;
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
@SupportedAnnotationTypes(Component.NAME)
public class ComponentProcessor extends CdkProcessor {
-
+
private final ComponentLibrary library;
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @param context
*/
- public ComponentProcessor(CdkContext context,ComponentLibrary library) {
+ public ComponentProcessor(CdkContext context, ComponentLibrary library) {
super(context);
this.library = library;
}
- /* (non-Javadoc)
- * @see javax.annotation.processing.AbstractProcessor#process(java.util.Set, javax.annotation.processing.RoundEnvironment)
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.annotation.processing.AbstractProcessor#process(java.util.Set,
+ * javax.annotation.processing.RoundEnvironment)
*/
@Override
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
- if(null != annotations && !annotations.isEmpty()){
+ if (null != annotations && !annotations.isEmpty()) {
ComponentLibrary library = getLibrary();
NamingConventions namingUtils = getContext().getNamingConventions();
// Process all component classes.
- Set<? extends TypeElement> componentClasses = getClassesAnnotatedWith(Component.class, roundEnv);
+ Set<? extends TypeElement> componentClasses = getClassesAnnotatedWith(
+ Component.class, roundEnv);
for (TypeElement component : componentClasses) {
try {
// Process class-level annotations.
// Calculate type for base UI component class.
// TODO - encpsulate that into simple utility classes call.
- Component componentAnnotation = component.getAnnotation(Component.class);
- String baseClassName = component.getQualifiedName().toString();
- String componentType = namingUtils.inferComponentType(componentAnnotation.type(),baseClassName);
- String uiComponentClass = namingUtils.inferUIComponentClass(componentType, componentAnnotation.className(), baseClassName, component.getModifiers().contains(Modifier.ABSTRACT));
+ Component componentAnnotation = component
+ .getAnnotation(Component.class);
+ String baseClassName = component.getQualifiedName()
+ .toString();
+ String componentType = namingUtils.inferComponentType(
+ componentAnnotation.type(), baseClassName);
// Create/get component instance.
org.richfaces.cdk.model.Component componentModel = library
- .createComponent(componentType, uiComponentClass, baseClassName);
- // Component Family. TODO - get it from 'COMPONENT_FAMILY' field or infer by NamingConventios.
+ .createComponent(componentType)
+ .setClassName(
+ namingUtils.inferUIComponentClass(
+ componentType, componentAnnotation
+ .className(),
+ baseClassName, component
+ .getModifiers().contains(
+ Modifier.ABSTRACT)))
+ .setBaseClassName(
+ namingUtils.inferUIComponentBaseClass(
+ componentType, baseClassName,
+ component.getModifiers().contains(
+ Modifier.ABSTRACT)));
+ // Component Family. TODO - get it from 'COMPONENT_FAMILY'
+ // field or infer by NamingConventios.
Family family = component.getAnnotation(Family.class);
- componentModel.setFamily(Strings.isEmpty(family.value())?componentType:family.value());
+ componentModel
+ .setFamily(namingUtils.inferUIComponentFamily(componentType,family.value()));
// JavaDoc comments
- componentModel.setDescription(this.processingEnv.getElementUtils().getDocComment(component));
+ componentModel.setDescription(this.processingEnv
+ .getElementUtils().getDocComment(component));
// TODO - process Events attribute.
// TODO - renderers, ....
// Process attributes.
- Set<BeanProperty> properties = getBeanPropertiesAnnotatedWith(Attribute.class, component);
+ Set<BeanProperty> properties = getBeanPropertiesAnnotatedWith(
+ Attribute.class, component);
// TODO - encapsulate attribute builder into utility class.
for (BeanProperty beanProperty : properties) {
- Property atribute = componentModel.addAttribute(beanProperty.getName());
+ Property atribute = componentModel
+ .addAttribute(beanProperty.getName());
// Documentation
atribute.setDescription(beanProperty.getDocComment());
// Type.
- atribute.setType(createClassDescription(beanProperty.getType()));
+ atribute.setPropertyClass(beanProperty
+ .getType().toString());
// Flags.
atribute.setExists(beanProperty.isExists());
}
- Attributes attributes = component.getAnnotation(Attributes.class);
- if(null != attributes){
- Attribute[] attributes2 = attributes.value();
- for (Attribute attributeAnnotation : attributes2) {
- Property attribute = componentModel.addAttribute(attributeAnnotation.name());
- attribute.setExists(false);
- try {
- Class<?> type = attributeAnnotation.type();
- attribute.setType(library.createClassDescription(type.getName()));
- } catch(MirroredTypeException ex){
- attribute.setType(createClassDescription(ex.getTypeMirror()));
- }
- // TODO - process additional properties.
+ Attributes attributes = component
+ .getAnnotation(Attributes.class);
+ if (null != attributes) {
+ Attribute[] attributes2 = attributes.value();
+ for (Attribute attributeAnnotation : attributes2) {
+ Property attribute = componentModel
+ .addAttribute(attributeAnnotation.name());
+ attribute.setExists(false);
+ try {
+ Class<?> type = attributeAnnotation.type();
+ attribute
+ .setPropertyClass(type
+ .getName());
+ } catch (MirroredTypeException ex) {
+ attribute.setPropertyClass(ex
+ .getTypeMirror().toString());
}
+ // TODO - process additional properties.
+ }
}
- // TODO - Process standard information for parent classes and intrfaces.
+ // TODO - Process standard information for parent classes
+ // and intrfaces.
} catch (InvalidNameException e) {
// rise error and continue.
- processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR, e.getMessage(), component);
+ processingEnv.getMessager().printMessage(
+ javax.tools.Diagnostic.Kind.ERROR, e.getMessage(),
+ component);
continue;
}
}
@@ -140,7 +176,7 @@
return library;
}
- protected ClassDescription createClassDescription(TypeMirror mirror){
+ protected ClassDescription createClassDescription(TypeMirror mirror) {
return getLibrary().createClassDescription(mirror.toString());
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -0,0 +1,41 @@
+/*
+ * $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
+ *
+ */
+public class Attribute extends Property {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param name
+ */
+ public Attribute(String name) {
+ super(name);
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ClassDescription.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -40,6 +40,7 @@
*/
private static final long serialVersionUID = -846623207703750456L;
+ @SuppressWarnings("serial")
public static final class Type extends JsfType {
public Type(String type) {
super(type);
@@ -68,8 +69,6 @@
private final String boxingClassName;
- private ClassDescription superClass;
-
/**
* <p class="changed_added_4_0">Type parameters for that class</p>
* TODO append type parameters to key.
@@ -83,15 +82,22 @@
* @param name
*/
public ClassDescription(String name) {
- this.name = name;
+ this.type = new Type(name);
if (primitiveTypes.containsKey(name)) {
+ this.name = name;
boxingClassName = primitiveTypes.get(name);
primitive = true;
} else {
+ int i = name.indexOf('<');
+ if(i>0){
+ this.name = name.substring(0,i);
+ this.typeParameters=name.substring(i);
+ } else {
+ this.name = name;
+ }
boxingClassName = name;
primitive = false;
}
- this.type = new Type(name);
}
@Override
@@ -100,27 +106,6 @@
}
/**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @return the superClass
- */
- public ClassDescription getSuperClass() {
- return superClass;
- }
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param superClass
- * the superClass to set
- */
- public void setSuperClass(ClassDescription superClass) {
- this.superClass = superClass;
- }
-
- /**
* <p class="changed_added_4_0"></p>
* @return the typeParameters
*/
@@ -168,7 +153,7 @@
@Override
public String toString() {
- return name;
+ return type.toString();
}
/* (non-Javadoc)
@@ -197,11 +182,11 @@
return false;
}
ClassDescription other = (ClassDescription) obj;
- if (name == null) {
- if (other.name != null) {
+ if (type == null) {
+ if (other.type != null) {
return false;
}
- } else if (!name.equals(other.name)) {
+ } else if (!type.equals(other.type)) {
return false;
}
return true;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -2,96 +2,168 @@
import java.util.Collection;
import java.util.Collections;
-import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+import org.richfaces.cdk.util.Strings;
+
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
/**
* That class represents JSF component in the CDK.
+ * That is mapped to faces-config "component" element.
* @author asmirnov(a)exadel.com
- *
+ *
*/
@SuppressWarnings("serial")
-public final class Component implements JsfComponent {
-
+@XmlType(name="faces-config-componentType")
+@XmlAccessorType( XmlAccessType.NONE )
+public final class Component implements JsfComponent, DescriptionGroup,Extensible {
+
/**
- * <p class="changed_added_4_0">Component type</p>
+ * <p class="changed_added_4_0">Reference to component library for which that component is belong to.</p>
*/
+ private final ComponentLibrary library;
+
+ /**
+ * <p class="changed_added_4_0">
+ * Component type
+ * </p>
+ */
private final Type type;
-
/**
- * <p class="changed_added_4_0">component family</p>
- */
+ * <p class="changed_added_4_0">
+ * component family
+ * </p>
+ */
private String family;
/**
- * <p class="changed_added_4_0">Cenerated component class</p>
- */
+ * <p class="changed_added_4_0">
+ * Cenerated component class
+ * </p>
+ */
private ClassDescription componentClass;
-
/**
- * <p class="changed_added_4_0">Long description for documentation</p>
- */
+ * <p class="changed_added_4_0">
+ * Cenerated component class
+ * </p>
+ */
+ private ClassDescription baseClass;
+
+ /**
+ * <p class="changed_added_4_0">
+ * Long description for documentation
+ * </p>
+ */
private String description;
-
+
/**
- * <p class="changed_added_4_0">Short name for IDE tools</p>
- */
+ * <p class="changed_added_4_0">
+ * Short name for IDE tools
+ * </p>
+ */
private String displayname;
-
+
/**
- * <p class="changed_added_4_0">Icon name for IDE tools</p>
- */
+ * <p class="changed_added_4_0">
+ * Icon name for IDE tools
+ * </p>
+ */
private String icon;
/**
- * <p class="changed_added_4_0">Component attributes</p>
+ * <p class="changed_added_4_0">Is that component c</p>
*/
- private final Map<String,Property> attributes = Maps.newHashMap();
-
-
+ private boolean exists = true;
+
/**
- * <p class="changed_added_4_0">Application level events fired by the component</p>
- */
- private List<Event> events;
-
+ * <p class="changed_added_4_0">
+ * Component attributes
+ * </p>
+ */
+ private final Map<String, Property> attributes = Maps.newHashMap();
+
/**
- * <p class="changed_added_4_0">Renderer for the final component. This is bidirectional one to one relation.</p>
- */
- private List<Renderer> renderers;
-
+ * <p class="changed_added_4_0">
+ * Facets recognised by the component
+ * </p>
+ */
+ private final Map<String,Facet> facets = Maps.newHashMap();
+
/**
- * <p class="changed_added_4_0">Facets recognised by the component</p>
- */
- private List<Facet> facets;
+ * <p class="changed_added_4_0">
+ * Application level events fired by the component
+ * </p>
+ */
+ private final Set<Event> events = Sets.newHashSet();
/**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
+ * <p class="changed_added_4_0">
+ * Renderer for the final component. This is bidirectional many to many
+ * relation.
+ * </p>
*/
- Component(Type type) {
+ private final Set<Renderer> renderers = Sets.newHashSet();
+
+ private ComponentExtension extension;
+
+ /**
+ * <p class="changed_added_4_0">Constructor. That class can be instantiated by model-package members only.
+ * </p>
+ *
+ * @param type
+ * the type to set
+ */
+ Component(ComponentLibrary library, Type type) {
+ this.library = library;
this.type = type;
}
@Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) {
return visitor.visit(this, param);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.richfaces.cdk.model.JsfComponent#getType()
*/
+ @XmlElement(name="component-type",required=true)
public JsfType getType() {
return type;
}
/**
* <p class="changed_added_4_0"></p>
+ * @return the extension
+ */
+ @XmlElement(name="component-extensions")
+ public ComponentExtension getExtension() {
+ if (extension == null) {
+ extension = new ComponentExtension();
+ }
+ return extension;
+ }
+
+
+ /**
+ * <p class="changed_added_4_0">
+ * Reepresent a component family. In the faces-config element that property encoded as
+ * <component><component-extension><cdk:component-family>....
+ * </p>
+ *
* @return the family
*/
public String getFamily() {
@@ -99,15 +171,20 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param family the family to set
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param family
+ * the family to set
*/
public void setFamily(String family) {
this.family = family;
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the componentClass
*/
public ClassDescription getComponentClass() {
@@ -115,56 +192,108 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param componentClass the componentClass to set
+ * <p class="changed_added_4_0">Represents class of that component.
+ * </p>
+ *
+ * @param componentClass
+ * the componentClass to set
*/
- public void setComponentClass(ClassDescription componentClass) {
+ @XmlElement(name="component-class")
+ void setComponentClass(ClassDescription componentClass) {
this.componentClass = componentClass;
}
/**
- * <p class="changed_added_4_0"></p>
- * @return the description
+ * <p class="changed_added_4_0">Base class for generated components.
+ * </p>
+ *
+ * @return the baseClass
*/
+ @XmlElementWrapper(name="component-extensions")
+ @XmlElement(namespace=ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public ClassDescription getBaseClass() {
+ return baseClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param baseClass
+ * the baseClass to set
+ */
+ void setBaseClass(ClassDescription baseClass) {
+ this.baseClass = baseClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0">Create and set {@link ClassDescription} for component class.</p>
+ * @param className canonical name for component class.
+ * @return component instance itself for chain calls.
+ */
+ public Component setClassName(String className) {
+ ClassDescription classDescription = library
+ .createClassDescription(className);
+ setComponentClass(classDescription);
+ return this;
+ }
+
+ /**
+ * <p class="changed_added_4_0">Create and set {@link ClassDescription} for base generated component class .</p>
+ * @param className canonical name for component super class.
+ * @return component instance itself for chain calls.
+ */
+ public Component setBaseClassName(String className) {
+ if (!Strings.isEmpty(className)) {
+ ClassDescription classDescription = library
+ .createClassDescription(className);
+ setBaseClass(classDescription);
+ } else {
+ setBaseClass(null);
+ }
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.model.DescriptionGroup#getDescription()
+ */
+ @XmlElement
public String getDescription() {
return description;
}
- /**
- * <p class="changed_added_4_0"></p>
- * @param description the description to set
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.model.DescriptionGroup#setDescription(java.lang.String)
*/
public void setDescription(String description) {
this.description = description;
}
- /**
- * <p class="changed_added_4_0"></p>
- * @return the displayname
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.model.DescriptionGroup#getDisplayname()
*/
+ @XmlElement(name="display-name")
public String getDisplayname() {
return displayname;
}
- /**
- * <p class="changed_added_4_0"></p>
- * @param displayname the displayname to set
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.model.DescriptionGroup#setDisplayname(java.lang.String)
*/
public void setDisplayname(String displayname) {
this.displayname = displayname;
}
- /**
- * <p class="changed_added_4_0"></p>
- * @return the icon
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.model.DescriptionGroup#getIcon()
*/
+ @XmlElement
public String getIcon() {
return icon;
}
- /**
- * <p class="changed_added_4_0"></p>
- * @param icon the icon to set
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.model.DescriptionGroup#setIcon(java.lang.String)
*/
public void setIcon(String icon) {
this.icon = icon;
@@ -172,15 +301,35 @@
/**
* <p class="changed_added_4_0"></p>
+ * @return the exists
+ */
+ public boolean isExists() {
+ return exists;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param exists the exists to set
+ */
+ public void setExists(boolean exists) {
+ this.exists = exists;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * Represents JSF component attributes and properties.
+ * </p>
+ *
* @return the attributes
*/
+ @XmlElements({@XmlElement(name="property",type=Property.class),@XmlElement(name="attribute",type=Attribute.class)})
public Collection<Property> getAttributes() {
return Collections.unmodifiableCollection(attributes.values());
}
public Property addAttribute(String attributeName) {
Property attribute;
- if(attributes.containsKey(attributeName)){
+ if (attributes.containsKey(attributeName)) {
attribute = attributes.get(attributeName);
} else {
attribute = new Property(attributeName);
@@ -189,12 +338,68 @@
return attribute;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the facets
+ */
+ public Collection<Facet> getFacets() {
+ return facets.values();
+ }
+
+ public Facet addFacet(String name){
+ Facet facet = facets.get(name);
+ if(null == facets){
+ facet = new Facet(name);
+ facets.put(name, facet);
+ }
+ return facet;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the events
+ */
+ public Set<Event> getEvents() {
+ return events;
+ }
+
+ public Event addEvent(String className){
+ Event event = new Event();
+ events.add(event);
+ return event;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the renderers
+ */
+ public Set<Renderer> getRenderers() {
+ return renderers;
+ }
+
public static class Type extends JsfType {
public Type(String type) {
super(type);
}
+
+ }
+
+ /**
+ * <p class="changed_added_4_0">Inner class that wraps <component-extension> element content</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+ public class ComponentExtension extends ConfigExtension {
+ @XmlElement(namespace=ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public String getFamily(){
+ return Component.this.getFamily();
+ }
+
+ public void setFamily(String family) {
+ Component.this.setFamily(family);
+ }
}
-
+
}
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 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -32,6 +32,11 @@
import java.util.NoSuchElementException;
import java.util.Set;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
import org.richfaces.cdk.model.Component.Type;
import org.richfaces.cdk.util.Strings;
@@ -53,15 +58,21 @@
* @author asmirnov(a)exadel.com
*
*/
+@XmlRootElement(name="faces-config",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
+(a)XmlType(namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE,name="faces-configType")
public class ComponentLibrary implements Serializable {
+
+ public static final String FACES_CONFIG_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
+ public static final String CDK_EXTENSIONS_NAMESPACE="http://richfaces.org/cdk";
+
/**
* <p class="changed_added_4_0">
* </p>
*/
private static final long serialVersionUID = -6055670836731899832L;
- private final Set<Component> componentsSet = Sets.newHashSet();
+ private final Set<Component> components = Sets.newHashSet();
private final Set<ClassDescription> classes = Sets.newHashSet();
/**
@@ -108,7 +119,7 @@
}
public <R,P> R accept(LibraryVisitor<R, P> visitor,P param){
- R result = accept(componentsSet,visitor, param, null);
+ R result = accept(components,visitor, param, null);
result = accept(renderers,visitor, param, result);
result = accept(converters,visitor, param, result);
result = accept(validators,visitor, param, result);
@@ -132,8 +143,9 @@
*
* @return the components
*/
+ @XmlElement
public Collection<Component> getComponents() {
- return componentsSet;
+ return components;
}
/**
@@ -147,15 +159,15 @@
* @param create
* @return
*/
- public Component getComponent(String type, boolean create) {
+ Component getComponent(String type, boolean create) {
Component.Type componentType = new Component.Type(type);
Component component = null;
try {
- component = find(componentsSet, componentType);
+ component = find(components, componentType);
} catch (NoSuchElementException e) {
if (create) {
- component = new Component(componentType);
- componentsSet.add(component);
+ component = new Component(this,componentType);
+ components.add(component);
}
}
return component;
@@ -175,25 +187,8 @@
* already existed components.
* @return
*/
- public Component createComponent(String type, String className,
- String superClassName) {
+ public Component createComponent(String type) {
Component component = getComponent(type, true);
- ClassDescription componentClass;
- if (!Strings.isEmpty(className)) {
- componentClass = createClassDescription(className);
- if (!Strings.isEmpty(superClassName)
- && !className.equals(superClassName)) {
- componentClass
- .setSuperClass(createClassDescription(superClassName));
- }
- } else if (!Strings.isEmpty(superClassName)) {
- componentClass = createClassDescription(superClassName);
- } else {
- // Do not modify class descriptions because it would be already
- // existed component.
- return component;
- }
- component.setComponentClass(componentClass);
return component;
}
Added: 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 (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -0,0 +1,58 @@
+/*
+ * $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.List;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+
+import org.dom4j.Element;
+
+/**
+ * <p class="changed_added_4_0">That class represents all faces-config "extension" fields.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ConfigExtension {
+
+ private List<Element> extensions;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the extensions
+ */
+ @XmlAnyElement
+ public List<Element> getExtensions() {
+ return extensions;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param extensions the extensions to set
+ */
+ public void setExtensions(List<Element> extensions) {
+ this.extensions = extensions;
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConfigExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -0,0 +1,66 @@
+package org.richfaces.cdk.model;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface DescriptionGroup {
+
+ /**
+ * <p class="changed_added_4_0">Documentation description of that element.
+ * </p>
+ *
+ * @return the description
+ */
+ @XmlElement
+ public String getDescription();
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param description
+ * the description to set
+ */
+ public void setDescription(String description);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the displayname
+ */
+ @XmlElement(name = "display-name")
+ public String getDisplayname();
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param displayname
+ * the displayname to set
+ */
+ public void setDisplayname(String displayname);
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the icon
+ */
+ @XmlElement
+ public String getIcon();
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param icon
+ * the icon to set
+ */
+ public void setIcon(String icon);
+
+}
\ No newline at end of file
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -23,8 +23,10 @@
package org.richfaces.cdk.model;
+import javax.faces.event.FacesEvent;
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">That bean represent {@link FacesEvent} subclass that can be fired by component.</p>
* @author asmirnov(a)exadel.com
*
*/
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -0,0 +1,41 @@
+/*
+ * $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">That interface marks all faces-config elements that have 'extension' element.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface Extensible<E extends ConfigExtension> {
+
+ /**
+ * <p class="changed_added_4_0">Return extension object that holds CDK-related tags and any other content as well.</p>
+ * @return
+ */
+ public E getExtension();
+
+// public void setExtension(E ext);
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Extensible.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -30,8 +30,40 @@
*/
public class Facet {
- private String name;
+ private final String name;
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param name
+ */
+ public Facet(String name) {
+ this.name = name;
+ }
+
private String description;
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/JsfType.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/JsfType.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/JsfType.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -23,12 +23,15 @@
package org.richfaces.cdk.model;
+import java.io.Serializable;
+
/**
* <p class="changed_added_4_0">This is a Key class that should be used to find JSF elements in {@link ComponentLibrary}</p>
* @author asmirnov(a)exadel.com
*
*/
-public class JsfType {
+@SuppressWarnings("serial")
+public class JsfType implements Serializable {
private final String type;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -21,12 +21,20 @@
package org.richfaces.cdk.model;
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.richfaces.cdk.util.Strings;
+
/**
* That class represents JSF component property.
* @author asmirnov(a)exadel.com
*
*/
-public class Property {
+@SuppressWarnings("serial")
+public class Property implements Serializable, DescriptionGroup {
/**
* <p class="changed_added_4_0">Bean property name of component attribute</p>
@@ -47,16 +55,38 @@
private String displayname;
/**
+ * <p class="changed_added_4_0">
+ * Icon name for IDE tools
+ * </p>
+ */
+ private String icon;
+
+
+ /**
* <p class="changed_added_4_0">Is that bean property exists in the class or should be generated ?</p>
*/
private boolean exists;
+ private boolean hidden;
+
+ private boolean elExpression;
+ private String dafaultValue;
+
+ private String suggestedValue;
+
+ private boolean passThrough=false;
+
+ private boolean defaultBehavior=false;
+
+ private Set<String> behaviorNames;
+
+
/**
* <p class="changed_added_4_0"></p>
* @param name
*/
- public Property(String name) {
+ Property(String name) {
this.name = name;
}
@@ -64,6 +94,7 @@
* <p class="changed_added_4_0"></p>
* @return the name
*/
+ @XmlElement(name="property-name")
public String getName() {
return name;
}
@@ -102,6 +133,22 @@
/**
* <p class="changed_added_4_0"></p>
+ * @return the icon
+ */
+ public String getIcon() {
+ return icon;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param icon the icon to set
+ */
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
* @return the type
*/
public ClassDescription getType() {
@@ -112,12 +159,55 @@
* <p class="changed_added_4_0"></p>
* @param type the type to set
*/
- public void setType(ClassDescription type) {
+ void setType(ClassDescription type) {
this.type = type;
}
+ @XmlElement(name = "property-class")
+ public void setPropertyClass(String propertyClass) {
+ if (!Strings.isEmpty(propertyClass)) {
+ ClassDescription type = new ClassDescription(propertyClass);
+ setType(type);
+
+ }
+ }
+
/**
* <p class="changed_added_4_0"></p>
+ * @return the dafaultValue
+ */
+ @XmlElement(name="default-value")
+ public String getDafaultValue() {
+ return dafaultValue;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param dafaultValue the dafaultValue to set
+ */
+ public void setDafaultValue(String dafaultValue) {
+ this.dafaultValue = dafaultValue;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the suggestedValue
+ */
+ @XmlElement(name="suggested-value")
+ public String getSuggestedValue() {
+ return suggestedValue;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param suggestedValue the suggestedValue to set
+ */
+ public void setSuggestedValue(String suggestedValue) {
+ this.suggestedValue = suggestedValue;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
* @return the exists
*/
public boolean isExists() {
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 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/package-info.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -12,6 +12,11 @@
* </ul>
*
*/
+(a)XmlAccessorType(XmlAccessType.NONE)
+(a)javax.xml.bind.annotation.XmlSchema(namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE,
+ xmlns = { @javax.xml.bind.annotation.XmlNs( prefix = "cdk",
+ namespaceURI = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE ) })
package org.richfaces.cdk.model;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
-
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java 2009-08-14 17:34:02 UTC (rev 15179)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -35,6 +35,16 @@
*/
public class FacesConfigParser implements ModelBuilder {
+ private CdkContext context;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the context
+ */
+ public CdkContext getContext() {
+ return context;
+ }
+
/* (non-Javadoc)
* @see org.richfaces.cdk.ModelBuilder#build()
*/
@@ -49,8 +59,7 @@
*/
@Override
public void init(CdkContext context) {
- // TODO Auto-generated method stub
-
+ this.context = context;
}
}
Added: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ClassDescriptionTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ClassDescriptionTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ClassDescriptionTest.java 2009-08-14 22:10:22 UTC (rev 15180)
@@ -0,0 +1,75 @@
+/*
+ * $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 static org.junit.Assert.*;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)RunWith(Parameterized.class)
+public class ClassDescriptionTest {
+
+ private final String className;
+ private final String expectedCanonicalName;
+ private final String expectedBoxedName;
+ private final String expectedTypeParameter;
+
+ public ClassDescriptionTest(String className,String expectedCanonicalName,String expectedBoxedName,String expectedTypeParameter) {
+ this.className = className;
+ this.expectedCanonicalName = expectedCanonicalName;
+ this.expectedBoxedName = expectedBoxedName;
+ this.expectedTypeParameter = expectedTypeParameter;
+
+ }
+ /**
+ * Test method for {@link org.richfaces.cdk.model.ClassDescription#ClassDescription(java.lang.String)}.
+ */
+ @Test
+ public void testClassDescription() {
+ ClassDescription description = new ClassDescription(className);
+ assertEquals(className, description.toString());
+ assertEquals(expectedCanonicalName, description.getName());
+ assertEquals(expectedBoxedName, description.getBoxingName());
+ assertEquals(expectedTypeParameter, description.getTypeParameters());
+ }
+
+ @Parameters
+ public static Collection<String[]> values(){
+ return Arrays.asList(new String[]{int.class.getName(),"int","java.lang.Integer",null},
+ new String[]{"java.util.List<String>","java.util.List","java.util.List<String>","<String>"},
+ new String[]{double.class.getName(),"double","java.lang.Double",null});
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ClassDescriptionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss Rich Faces SVN: r15179 - in root/framework/trunk/impl/src/test/resources: javascript and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-08-14 13:34:02 -0400 (Fri, 14 Aug 2009)
New Revision: 15179
Added:
root/framework/trunk/impl/src/test/resources/javascript/
root/framework/trunk/impl/src/test/resources/javascript/4_0_0.html
root/framework/trunk/impl/src/test/resources/javascript/qunit/
root/framework/trunk/impl/src/test/resources/javascript/qunit/testrunner.js
root/framework/trunk/impl/src/test/resources/javascript/qunit/testsuite.css
Log:
RFPL-59
Added: root/framework/trunk/impl/src/test/resources/javascript/4_0_0.html
===================================================================
--- root/framework/trunk/impl/src/test/resources/javascript/4_0_0.html (rev 0)
+++ root/framework/trunk/impl/src/test/resources/javascript/4_0_0.html 2009-08-14 17:34:02 UTC (rev 15179)
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>jQuery Test Suite</title>
+ <link type="text/css" rel="Stylesheet" media="screen" href="qunit/testsuite.css" />
+ <script type="text/javascript" src="../../classes/META-INF/resources/jquery.js/1_3_2.js"></script>
+ <script type="text/javascript" src="../../classes/META-INF/resources/richfaces.js/4_0_0.js"></script>
+ <script type="text/javascript" src="qunit/testrunner.js"></script>
+ <script type="text/javascript">
+ var jsf = {};
+ jQuery(document).ready(function(){
+ test("RichFaces.submitForm", function() {
+ expect(7);
+ var submitTarget = "target";
+ var submitParameters = {
+ name1 : "value1",
+ name2 : "value2"
+ };
+ var form = jQuery("form");
+ ok(!form.attr("target"));
+ ok(!jQuery("input[type='hidden']", form).size());
+ var trigger = form.trigger;
+ form.trigger = function(event) {
+ equals(form.attr("target"), submitTarget);
+ for (var name in submitParameters) {
+ equals(jQuery("input[name='" + name + "']", form).attr("value"), submitParameters[name]);
+ }
+ };
+ RichFaces.submitForm(form, submitParameters, submitTarget);
+ form.trigger = trigger;
+ ok(!form.attr("target"));
+ ok(!jQuery("input", form).size());
+ return false;
+ });
+
+ test("RichFaces.log test", function() {
+ ok(false, "Not yet implemented");
+ // RichFaces.console.error("some error");
+ // equals(RichFaces.getValue(["prop1", "prop2"], base), "value2");
+ // equals(RichFaces.getValue(["prop3", "prop2"], base), undefined);
+ });
+
+ test("RichFaces.getValue test", function() {
+ expect(2);
+ var base = {
+ prop1:{
+ prop2: "value2"
+ }
+ };
+ equals(RichFaces.getValue(["prop1", "prop2"], base), "value2");
+ equals(RichFaces.getValue(["prop3", "prop2"], base), undefined);
+ });
+ });
+
+ test("RichFaces.evalMacro test", function() {
+ expect(4);
+ var base = {
+ prop1:{
+ prop2: "value2",
+ function1 : function(base) { return base.prop1.prop2 }
+ },
+ eval : function(macro) { return macro.toString().length }
+ };
+ var context = {
+ prop1 : "value1",
+ prop2 : "value2"
+ };
+ equals(RichFaces.evalMacro("prop1.function1", base), "value2");
+ equals(RichFaces.evalMacro("document.title", {}), "jQuery Test Suite");
+ equals(RichFaces.evalMacro("1234", base), 4);
+ equals(RichFaces.evalMacro("1+2", {}), 3);
+ });
+
+ test("RichFaces.interpolate test", function() {
+ var context = {
+ prop1 : "value1",
+ prop2 : "value2"
+ };
+ equals(RichFaces.interpolate("{prop1} {prop2} {prop3}", context), "value1 value2 {prop3}");
+ });
+
+ test("RichFaces.startPush and RichFaces.stopPush test", function() {
+ var timeoutFakeObject = {id:"timeoutFakeObject"};
+ expect(1);
+ var options = {
+ pushId : "pushId",
+ interval : 700,
+ ondataavailable : function() {
+ ok(true, "Function 'ondataavailable' has been called");
+ }
+ };
+ var xhr = {
+ status : 200,
+ getResponseHeader : function() { return "READY" }
+ };
+ var ajax = jQuery.ajax;
+ jQuery.ajax = function(ajaxOptions) {
+ RichFaces.stopPush(options.pushId);
+ ajaxOptions.complete(xhr);
+ };
+ var setTimeout = window.setTimeout;
+ window.setTimeout = function(func, delay) {
+ func();
+ return timeoutFakeObject;
+ };
+ RichFaces.startPush(options);
+ jQuery.ajax = ajax;
+ window.setTimeout = setTimeout;
+ });
+
+ test("RichFaces.ajax test", function() {
+ expect(3);
+ var ajaxSource = "source";
+ var ajaxEvent = "event";
+ var ajaxOptions = {};
+ jsf.ajax = {
+ request : function(source, event, options) {
+ equals(source, ajaxSource);
+ equals(event, ajaxEvent);
+ equals(options, ajaxOptions);
+ }
+ }
+ RichFaces.ajax(ajaxSource, ajaxEvent, ajaxOptions);
+ });
+ </script>
+ </head>
+ <body>
+ <h1>RichFaces QUnit tests</h1>
+ <h2 id="banner"></h2>
+ <h2 id="userAgent"></h2>
+ <ol id="tests"></ol>
+ <div id="main">
+ <form />
+ </div>
+ </body>
+</html>
Added: root/framework/trunk/impl/src/test/resources/javascript/qunit/testrunner.js
===================================================================
--- root/framework/trunk/impl/src/test/resources/javascript/qunit/testrunner.js (rev 0)
+++ root/framework/trunk/impl/src/test/resources/javascript/qunit/testrunner.js 2009-08-14 17:34:02 UTC (rev 15179)
@@ -0,0 +1,780 @@
+/*
+ * QUnit - jQuery unit testrunner
+ *
+ * http://docs.jquery.com/QUnit
+ *
+ * Copyright (c) 2008 John Resig, J��rn Zaefferer
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Id: testrunner.js 6173 2009-02-02 20:09:32Z jeresig $
+ */
+
+(function($) {
+
+// Tests for equality any JavaScript type and structure without unexpected results.
+// Discussions and reference: http://philrathe.com/articles/equiv
+// Test suites: http://philrathe.com/tests/equiv
+// Author: Philippe Rathӊ <prathe(a)gmail.com>
+var equiv = function () {
+
+ var innerEquiv; // the real equiv function
+ var callers = []; // stack to decide between skip/abort functions
+
+ // Determine what is o.
+ function hoozit(o) {
+ if (typeof o === "string") {
+ return "string";
+
+ } else if (typeof o === "boolean") {
+ return "boolean";
+
+ } else if (typeof o === "number") {
+
+ if (isNaN(o)) {
+ return "nan";
+ } else {
+ return "number";
+ }
+
+ } else if (typeof o === "undefined") {
+ return "undefined";
+
+ // consider: typeof null === object
+ } else if (o === null) {
+ return "null";
+
+ // consider: typeof [] === object
+ } else if (o instanceof Array) {
+ return "array";
+
+ // consider: typeof new Date() === object
+ } else if (o instanceof Date) {
+ return "date";
+
+ // consider: /./ instanceof Object;
+ // /./ instanceof RegExp;
+ // typeof /./ === "function"; // => false in IE and Opera,
+ // true in FF and Safari
+ } else if (o instanceof RegExp) {
+ return "regexp";
+
+ } else if (typeof o === "object") {
+ return "object";
+
+ } else if (o instanceof Function) {
+ return "function";
+ }
+ }
+
+ // Call the o related callback with the given arguments.
+ function bindCallbacks(o, callbacks, args) {
+ var prop = hoozit(o);
+ if (prop) {
+ if (hoozit(callbacks[prop]) === "function") {
+ return callbacks[prop].apply(callbacks, args);
+ } else {
+ return callbacks[prop]; // or undefined
+ }
+ }
+ }
+
+ var callbacks = function () {
+
+ // for string, boolean, number and null
+ function useStrictEquality(b, a) {
+ return a === b;
+ }
+
+ return {
+ "string": useStrictEquality,
+ "boolean": useStrictEquality,
+ "number": useStrictEquality,
+ "null": useStrictEquality,
+ "undefined": useStrictEquality,
+
+ "nan": function (b) {
+ return isNaN(b);
+ },
+
+ "date": function (b, a) {
+ return hoozit(b) === "date" && a.valueOf() === b.valueOf();
+ },
+
+ "regexp": function (b, a) {
+ return hoozit(b) === "regexp" &&
+ a.source === b.source && // the regex itself
+ a.global === b.global && // and its modifers (gmi) ...
+ a.ignoreCase === b.ignoreCase &&
+ a.multiline === b.multiline;
+ },
+
+ // - skip when the property is a method of an instance (OOP)
+ // - abort otherwise,
+ // initial === would have catch identical references anyway
+ "function": function () {
+ var caller = callers[callers.length - 1];
+ return caller !== Object &&
+ typeof caller !== "undefined";
+ },
+
+ "array": function (b, a) {
+ var i;
+ var len;
+
+ // b could be an object literal here
+ if ( ! (hoozit(b) === "array")) {
+ return false;
+ }
+
+ len = a.length;
+ if (len !== b.length) { // safe and faster
+ return false;
+ }
+ for (i = 0; i < len; i++) {
+ if( ! innerEquiv(a[i], b[i])) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "object": function (b, a) {
+ var i;
+ var eq = true; // unless we can proove it
+ var aProperties = [], bProperties = []; // collection of strings
+
+ // comparing constructors is more strict than using instanceof
+ if ( a.constructor !== b.constructor) {
+ return false;
+ }
+
+ // stack constructor before traversing properties
+ callers.push(a.constructor);
+
+ for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
+
+ aProperties.push(i); // collect a's properties
+
+ if ( ! innerEquiv(a[i], b[i])) {
+ eq = false;
+ }
+ }
+
+ callers.pop(); // unstack, we are done
+
+ for (i in b) {
+ bProperties.push(i); // collect b's properties
+ }
+
+ // Ensures identical properties name
+ return eq && innerEquiv(aProperties.sort(), bProperties.sort());
+ }
+ };
+ }();
+
+ innerEquiv = function () { // can take multiple arguments
+ var args = Array.prototype.slice.apply(arguments);
+ if (args.length < 2) {
+ return true; // end transition
+ }
+
+ return (function (a, b) {
+ if (a === b) {
+ return true; // catch the most you can
+
+ } else if (typeof a !== typeof b || a === null || b === null || typeof a === "undefined" || typeof b === "undefined") {
+ return false; // don't lose time with error prone cases
+
+ } else {
+ return bindCallbacks(a, callbacks, [b, a]);
+ }
+
+ // apply transition with (1..n) arguments
+ })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
+ };
+
+ return innerEquiv;
+}(); // equiv
+
+var GETParams = $.map( location.search.slice(1).split('&'), decodeURIComponent ),
+ ngindex = $.inArray("noglobals", GETParams),
+ noglobals = ngindex !== -1;
+
+if( noglobals )
+ GETParams.splice( ngindex, 1 );
+
+var config = {
+ stats: {
+ all: 0,
+ bad: 0
+ },
+ queue: [],
+ // block until document ready
+ blocking: true,
+ //restrict modules/tests by get parameters
+ filters: GETParams,
+ isLocal: !!(window.location.protocol == 'file:')
+};
+
+// public API as global methods
+$.extend(window, {
+ test: test,
+ module: module,
+ expect: expect,
+ ok: ok,
+ equals: equals,
+ start: start,
+ stop: stop,
+ reset: reset,
+ isLocal: config.isLocal,
+ same: function(a, b, message) {
+ push(equiv(a, b), a, b, message);
+ },
+ QUnit: {
+ equiv: equiv,
+ ok: ok,
+ done: function(failures, total){},
+ log: function(result, message){}
+ },
+ // legacy methods below
+ isSet: isSet,
+ isObj: isObj,
+ compare: function() {
+ throw "compare is deprecated - use same() instead";
+ },
+ compare2: function() {
+ throw "compare2 is deprecated - use same() instead";
+ },
+ serialArray: function() {
+ throw "serialArray is deprecated - use jsDump.parse() instead";
+ },
+ q: q,
+ t: t,
+ url: url,
+ triggerEvent: triggerEvent
+});
+
+$(window).load(function() {
+ $('#userAgent').html(navigator.userAgent);
+ var head = $('<div class="testrunner-toolbar"><label for="filter-pass">Hide passed tests</label></div>').insertAfter("#userAgent");
+ $('<input type="checkbox" id="filter-pass" />').attr("disabled", true).prependTo(head).click(function() {
+ $('li.pass')[this.checked ? 'hide' : 'show']();
+ });
+ $('<input type="checkbox" id="filter-missing">').attr("disabled", true).appendTo(head).click(function() {
+ $("li.fail:contains('missing test - untested code is broken code')").parent('ol').parent('li.fail')[this.checked ? 'hide' : 'show']();
+ });
+ $("#filter-missing").after('<label for="filter-missing">Hide missing tests (untested code is broken code)</label>');
+ runTest();
+});
+
+function synchronize(callback) {
+ config.queue.push(callback);
+ if(!config.blocking) {
+ process();
+ }
+}
+
+function process() {
+ while(config.queue.length && !config.blocking) {
+ config.queue.shift()();
+ }
+}
+
+function stop(timeout) {
+ config.blocking = true;
+ if (timeout)
+ config.timeout = setTimeout(function() {
+ QUnit.ok( false, "Test timed out" );
+ start();
+ }, timeout);
+}
+function start() {
+ // A slight delay, to avoid any current callbacks
+ setTimeout(function() {
+ if(config.timeout)
+ clearTimeout(config.timeout);
+ config.blocking = false;
+ process();
+ }, 13);
+}
+
+function validTest( name ) {
+ var i = config.filters.length,
+ run = false;
+
+ if( !i )
+ return true;
+
+ while( i-- ){
+ var filter = config.filters[i],
+ not = filter.charAt(0) == '!';
+ if( not )
+ filter = filter.slice(1);
+ if( name.indexOf(filter) != -1 )
+ return !not;
+ if( not )
+ run = true;
+ }
+ return run;
+}
+
+function runTest() {
+ config.blocking = false;
+ var started = +new Date;
+ config.fixture = document.getElementById('main').innerHTML;
+ config.ajaxSettings = $.ajaxSettings;
+ synchronize(function() {
+ $('<p id="testresult" class="result"/>').html(['Tests completed in ',
+ +new Date - started, ' milliseconds.<br/>',
+ '<span class="bad">', config.stats.bad, '</span> tests of <span class="all">', config.stats.all, '</span> failed.']
+ .join(''))
+ .appendTo("body");
+ $("#banner").addClass(config.stats.bad ? "fail" : "pass");
+ QUnit.done( config.stats.bad, config.stats.all );
+ });
+}
+
+var pollution;
+
+function saveGlobal(){
+ pollution = [ ];
+
+ if( noglobals )
+ for( var key in window )
+ pollution.push(key);
+}
+function checkPollution( name ){
+ var old = pollution;
+ saveGlobal();
+
+ if( pollution.length > old.length ){
+ ok( false, "Introduced global variable(s): " + diff(old, pollution).join(", ") );
+ config.expected++;
+ }
+}
+
+function diff( clean, dirty ){
+ return $.grep( dirty, function(name){
+ return $.inArray( name, clean ) == -1;
+ });
+}
+
+function test(name, callback) {
+ if(config.currentModule)
+ name = config.currentModule + " module: " + name;
+ var lifecycle = $.extend({
+ setup: function() {},
+ teardown: function() {}
+ }, config.moduleLifecycle);
+
+ if ( !validTest(name) )
+ return;
+
+ synchronize(function() {
+ config.assertions = [];
+ config.expected = null;
+ try {
+ if( !pollution )
+ saveGlobal();
+ lifecycle.setup();
+ } catch(e) {
+ QUnit.ok( false, "Setup failed on " + name + ": " + e.message );
+ }
+ })
+ synchronize(function() {
+ try {
+ callback();
+ } catch(e) {
+ if( typeof console != "undefined" && console.error && console.warn ) {
+ console.error("Test " + name + " died, exception and test follows");
+ console.error(e);
+ console.warn(callback.toString());
+ }
+ QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message );
+ // else next test will carry the responsibility
+ saveGlobal();
+ }
+ });
+ synchronize(function() {
+ try {
+ checkPollution();
+ lifecycle.teardown();
+ } catch(e) {
+ QUnit.ok( false, "Teardown failed on " + name + ": " + e.message );
+ }
+ })
+ synchronize(function() {
+ try {
+ reset();
+ } catch(e) {
+ if( typeof console != "undefined" && console.error && console.warn ) {
+ console.error("reset() failed, following Test " + name + ", exception and reset fn follows");
+ console.error(e);
+ console.warn(reset.toString());
+ }
+ }
+
+ if(config.expected && config.expected != config.assertions.length) {
+ QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" );
+ }
+
+ var good = 0, bad = 0;
+ var ol = $("<ol/>").hide();
+ config.stats.all += config.assertions.length;
+ for ( var i = 0; i < config.assertions.length; i++ ) {
+ var assertion = config.assertions[i];
+ $("<li/>").addClass(assertion.result ? "pass" : "fail").text(assertion.message || "(no message)").appendTo(ol);
+ assertion.result ? good++ : bad++;
+ }
+ config.stats.bad += bad;
+
+ var b = $("<strong/>").html(name + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + config.assertions.length + ")</b>")
+ .click(function(){
+ $(this).next().toggle();
+ })
+ .dblclick(function(event) {
+ var target = $(event.target).filter("strong").clone();
+ if ( target.length ) {
+ target.children().remove();
+ location.href = location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent($.trim(target.text()));
+ }
+ });
+
+ $("<li/>").addClass(bad ? "fail" : "pass").append(b).append(ol).appendTo("#tests");
+
+ if(bad) {
+ $("#filter-pass").attr("disabled", null);
+ $("#filter-missing").attr("disabled", null);
+ }
+ });
+}
+
+// call on start of module test to prepend name to all tests
+function module(name, lifecycle) {
+ config.currentModule = name;
+ config.moduleLifecycle = lifecycle;
+}
+
+/**
+ * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
+ */
+function expect(asserts) {
+ config.expected = asserts;
+}
+
+/**
+ * Resets the test setup. Useful for tests that modify the DOM.
+ */
+function reset() {
+ $("#main").html( config.fixture );
+ $.event.global = {};
+ $.ajaxSettings = $.extend({}, config.ajaxSettings);
+}
+
+/**
+ * Asserts true.
+ * @example ok( $("a").size() > 5, "There must be at least 5 anchors" );
+ */
+function ok(a, msg) {
+ QUnit.log(a, msg);
+
+ config.assertions.push({
+ result: !!a,
+ message: msg
+ });
+}
+
+/**
+ * Asserts that two arrays are the same
+ */
+function isSet(a, b, msg) {
+ function serialArray( a ) {
+ var r = [];
+
+ if ( a && a.length )
+ for ( var i = 0; i < a.length; i++ ) {
+ var str = a[i].nodeName;
+ if ( str ) {
+ str = str.toLowerCase();
+ if ( a[i].id )
+ str += "#" + a[i].id;
+ } else
+ str = a[i];
+ r.push( str );
+ }
+
+ return "[ " + r.join(", ") + " ]";
+ }
+ var ret = true;
+ if ( a && b && a.length != undefined && a.length == b.length ) {
+ for ( var i = 0; i < a.length; i++ )
+ if ( a[i] != b[i] )
+ ret = false;
+ } else
+ ret = false;
+ QUnit.ok( ret, !ret ? (msg + " expected: " + serialArray(b) + " result: " + serialArray(a)) : msg );
+}
+
+/**
+ * Asserts that two objects are equivalent
+ */
+function isObj(a, b, msg) {
+ var ret = true;
+
+ if ( a && b ) {
+ for ( var i in a )
+ if ( a[i] != b[i] )
+ ret = false;
+
+ for ( i in b )
+ if ( a[i] != b[i] )
+ ret = false;
+ } else
+ ret = false;
+
+ QUnit.ok( ret, msg );
+}
+
+/**
+ * Returns an array of elements with the given IDs, eg.
+ * @example q("main", "foo", "bar")
+ * @result [<div id="main">, <span id="foo">, <input id="bar">]
+ */
+function q() {
+ var r = [];
+ for ( var i = 0; i < arguments.length; i++ )
+ r.push( document.getElementById( arguments[i] ) );
+ return r;
+}
+
+/**
+ * Asserts that a select matches the given IDs
+ * @example t("Check for something", "//[a]", ["foo", "baar"]);
+ * @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar'
+ */
+function t(a,b,c) {
+ var f = $(b);
+ var s = "";
+ for ( var i = 0; i < f.length; i++ )
+ s += (s && ",") + '"' + f[i].id + '"';
+ isSet(f, q.apply(q,c), a + " (" + b + ")");
+}
+
+/**
+ * Add random number to url to stop IE from caching
+ *
+ * @example url("data/test.html")
+ * @result "data/test.html?10538358428943"
+ *
+ * @example url("data/test.php?foo=bar")
+ * @result "data/test.php?foo=bar&10538358345554"
+ */
+function url(value) {
+ return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000);
+}
+
+/**
+ * Checks that the first two arguments are equal, with an optional message.
+ * Prints out both actual and expected values.
+ *
+ * Prefered to ok( actual == expected, message )
+ *
+ * @example equals( $.format("Received {0} bytes.", 2), "Received 2 bytes." );
+ *
+ * @param Object actual
+ * @param Object expected
+ * @param String message (optional)
+ */
+function equals(actual, expected, message) {
+ push(expected == actual, actual, expected, message);
+}
+
+function push(result, actual, expected, message) {
+ message = message || (result ? "okay" : "failed");
+ QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + jsDump.parse(expected) + " result: " + jsDump.parse(actual) );
+}
+
+/**
+ * Trigger an event on an element.
+ *
+ * @example triggerEvent( document.body, "click" );
+ *
+ * @param DOMElement elem
+ * @param String type
+ */
+function triggerEvent( elem, type, event ) {
+ if ( $.browser.mozilla || $.browser.opera ) {
+ event = document.createEvent("MouseEvents");
+ event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ elem.dispatchEvent( event );
+ } else if ( $.browser.msie ) {
+ elem.fireEvent("on"+type);
+ }
+}
+
+})(jQuery);
+
+/**
+ * jsDump
+ * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
+ * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
+ * Date: 5/15/2008
+ * @projectDescription Advanced and extensible data dumping for Javascript.
+ * @version 1.0.0
+ * @author Ariel Flesler
+ * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
+ */
+(function(){
+ function quote( str ){
+ return '"' + str.toString().replace(/"/g, '\\"') + '"';
+ };
+ function literal( o ){
+ return o + '';
+ };
+ function join( pre, arr, post ){
+ var s = jsDump.separator(),
+ base = jsDump.indent();
+ inner = jsDump.indent(1);
+ if( arr.join )
+ arr = arr.join( ',' + s + inner );
+ if( !arr )
+ return pre + post;
+ return [ pre, inner + arr, base + post ].join(s);
+ };
+ function array( arr ){
+ var i = arr.length, ret = Array(i);
+ this.up();
+ while( i-- )
+ ret[i] = this.parse( arr[i] );
+ this.down();
+ return join( '[', ret, ']' );
+ };
+
+ var reName = /^function (\w+)/;
+
+ var jsDump = window.jsDump = {
+ parse:function( obj, type ){//type is used mostly internally, you can fix a (custom)type in advance
+ var parser = this.parsers[ type || this.typeOf(obj) ];
+ type = typeof parser;
+
+ return type == 'function' ? parser.call( this, obj ) :
+ type == 'string' ? parser :
+ this.parsers.error;
+ },
+ typeOf:function( obj ){
+ var type = typeof obj,
+ f = 'function';//we'll use it 3 times, save it
+ return type != 'object' && type != f ? type :
+ !obj ? 'null' :
+ obj.exec ? 'regexp' :// some browsers (FF) consider regexps functions
+ obj.getHours ? 'date' :
+ obj.scrollBy ? 'window' :
+ obj.nodeName == '#document' ? 'document' :
+ obj.nodeName ? 'node' :
+ obj.item ? 'nodelist' : // Safari reports nodelists as functions
+ obj.callee ? 'arguments' :
+ obj.call || obj.constructor != Array && //an array would also fall on this hack
+ (obj+'').indexOf(f) != -1 ? f : //IE reports functions like alert, as objects
+ 'length' in obj ? 'array' :
+ type;
+ },
+ separator:function(){
+ return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? ' ' : ' ';
+ },
+ indent:function( extra ){// extra can be a number, shortcut for increasing-calling-decreasing
+ if( !this.multiline )
+ return '';
+ var chr = this.indentChar;
+ if( this.HTML )
+ chr = chr.replace(/\t/g,' ').replace(/ /g,' ');
+ return Array( this._depth_ + (extra||0) ).join(chr);
+ },
+ up:function( a ){
+ this._depth_ += a || 1;
+ },
+ down:function( a ){
+ this._depth_ -= a || 1;
+ },
+ setParser:function( name, parser ){
+ this.parsers[name] = parser;
+ },
+ // The next 3 are exposed so you can use them
+ quote:quote,
+ literal:literal,
+ join:join,
+ //
+ _depth_: 1,
+ // This is the list of parsers, to modify them, use jsDump.setParser
+ parsers:{
+ window: '[Window]',
+ document: '[Document]',
+ error:'[ERROR]', //when no parser is found, shouldn't happen
+ unknown: '[Unknown]',
+ 'null':'null',
+ undefined:'undefined',
+ 'function':function( fn ){
+ var ret = 'function',
+ name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
+ if( name )
+ ret += ' ' + name;
+ ret += '(';
+
+ ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join('');
+ return join( ret, this.parse(fn,'functionCode'), '}' );
+ },
+ array: array,
+ nodelist: array,
+ arguments: array,
+ object:function( map ){
+ var ret = [ ];
+ this.up();
+ for( var key in map )
+ ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) );
+ this.down();
+ return join( '{', ret, '}' );
+ },
+ node:function( node ){
+ var open = this.HTML ? '<' : '<',
+ close = this.HTML ? '>' : '>';
+
+ var tag = node.nodeName.toLowerCase(),
+ ret = open + tag;
+
+ for( var a in this.DOMAttrs ){
+ var val = node[this.DOMAttrs[a]];
+ if( val )
+ ret += ' ' + a + '=' + this.parse( val, 'attribute' );
+ }
+ return ret + close + open + '/' + tag + close;
+ },
+ functionArgs:function( fn ){//function calls it internally, it's the arguments part of the function
+ var l = fn.length;
+ if( !l ) return '';
+
+ var args = Array(l);
+ while( l-- )
+ args[l] = String.fromCharCode(97+l);//97 is 'a'
+ return ' ' + args.join(', ') + ' ';
+ },
+ key:quote, //object calls it internally, the key part of an item in a map
+ functionCode:'[code]', //function calls it internally, it's the content of the function
+ attribute:quote, //node calls it internally, it's an html attribute value
+ string:quote,
+ date:quote,
+ regexp:literal, //regex
+ number:literal,
+ 'boolean':literal
+ },
+ DOMAttrs:{//attributes to dump from nodes, name=>realName
+ id:'id',
+ name:'name',
+ 'class':'className'
+ },
+ HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
+ indentChar:' ',//indentation unit
+ multiline:true //if true, items in a collection, are separated by a \n, else just a space.
+ };
+
+})();
\ No newline at end of file
Added: root/framework/trunk/impl/src/test/resources/javascript/qunit/testsuite.css
===================================================================
--- root/framework/trunk/impl/src/test/resources/javascript/qunit/testsuite.css (rev 0)
+++ root/framework/trunk/impl/src/test/resources/javascript/qunit/testsuite.css 2009-08-14 17:34:02 UTC (rev 15179)
@@ -0,0 +1,120 @@
+body, div, h1 { font-family: 'trebuchet ms', verdana, arial; margin: 0; padding: 0 }
+body {font-size: 10pt; }
+h1 { padding: 15px; font-size: large; background-color: #06b; color: white; }
+h1 a { color: white; }
+h2 { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal }
+
+.pass { color: green; }
+.fail { color: red; }
+p.result { margin-left: 1em; }
+
+#banner { height: 2em; border-bottom: 1px solid white; }
+h2.pass { background-color: green; }
+h2.fail { background-color: red; }
+
+div.testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; }
+
+ol#tests > li > strong { cursor:pointer; }
+
+div#fx-tests h4 {
+ background: red;
+}
+
+div#fx-tests h4.pass {
+ background: green;
+}
+
+div#fx-tests div.box {
+ background: red url(data/cow.jpg) no-repeat;
+ overflow: hidden;
+ border: 2px solid #000;
+}
+
+div#fx-tests div.overflow {
+ overflow: visible;
+}
+
+div.inline {
+ display: inline;
+}
+
+div.autoheight {
+ height: auto;
+}
+
+div.autowidth {
+ width: auto;
+}
+
+div.autoopacity {
+ opacity: auto;
+}
+
+div.largewidth {
+ width: 100px;
+}
+
+div.largeheight {
+ height: 100px;
+}
+
+div.largeopacity {
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
+}
+
+div.medwidth {
+ width: 50px;
+}
+
+div.medheight {
+ height: 50px;
+}
+
+div.medopacity {
+ opacity: 0.5;
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
+}
+
+div.nowidth {
+ width: 0px;
+}
+
+div.noheight {
+ height: 0px;
+}
+
+div.noopacity {
+ opacity: 0;
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0);
+}
+
+div.hidden {
+ display: none;
+}
+
+div#fx-tests div.widewidth {
+ background-repeat: repeat-x;
+}
+
+div#fx-tests div.wideheight {
+ background-repeat: repeat-y;
+}
+
+div#fx-tests div.widewidth.wideheight {
+ background-repeat: repeat;
+}
+
+div#fx-tests div.noback {
+ background-image: none;
+}
+
+div.chain, div.chain div { width: 100px; height: 20px; position: relative; float: left; }
+div.chain div { position: absolute; top: 0px; left: 0px; }
+
+div.chain.test { background: red; }
+div.chain.test div { background: green; }
+
+div.chain.out { background: green; }
+div.chain.out div { background: red; display: none; }
+
+div#show-tests * { display: none; }
15 years, 4 months
JBoss Rich Faces SVN: r15178 - root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-08-14 09:59:29 -0400 (Fri, 14 Aug 2009)
New Revision: 15178
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
Log:
fix buildAjaxFunction
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-14 13:56:18 UTC (rev 15177)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2009-08-14 13:59:29 UTC (rev 15178)
@@ -477,7 +477,7 @@
FacesContext facesContext, String functionName) {
JSFunction ajaxFunction = new JSFunction(functionName);
ajaxFunction.addParameter(uiComponent.getClientId(facesContext));
- ajaxFunction.addParameter("event");
+ ajaxFunction.addParameter(new JSReference("event"));
return ajaxFunction;
}
15 years, 4 months
JBoss Rich Faces SVN: r15177 - branches/community/3.3.X/docs/userguide/en/src/main/docbook.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-08-14 09:56:18 -0400 (Fri, 14 Aug 2009)
New Revision: 15177
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/master.xml
Log:
Validate document
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/master.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/master.xml 2009-08-14 13:36:16 UTC (rev 15176)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/master.xml 2009-08-14 13:56:18 UTC (rev 15177)
@@ -159,7 +159,7 @@
<abstract>
<title/>
<para>
- <ulink url="../pdf/richfaces_reference.pdf"">PDF version</ulink>
+ <ulink url="../pdf/richfaces_reference.pdf">PDF version</ulink>
</para>
</abstract>
<!--citebiblioid>
15 years, 4 months
JBoss Rich Faces SVN: r15176 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-08-14 09:36:16 -0400 (Fri, 14 Aug 2009)
New Revision: 15176
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
RF-7689: rich:editor component description review
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml 2009-08-14 08:20:51 UTC (rev 15175)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml 2009-08-14 13:36:16 UTC (rev 15176)
@@ -1164,107 +1164,87 @@
- </section>
- <section id="EditorDefinitionofCustomStyleSelectors">
- <title>Definition of Custom Style Selectors</title>
+ </section>
+
+ <section id="EditorDefinitionofCustomStyleSelectors">
+ <title>Definition of Custom Style Selectors</title>
- <para>On the screenshot there are CSS selectors that define styles for component elements.</para>
-
- <figure>
+ <para>On the screenshot there are CSS selectors that define styles for component elements.</para>
+
+ <figure>
<title>Classes names</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/editor3.png"/>
</imageobject>
</mediaobject>
- </figure>
+ </figure>
+
+ <table>
+ <title>CSS selectors for the layout of the editor</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>Class name (selector)</entry>
+ <entry>Description</entry>
+ <entry>Skin Parameter</entry>
+ <entry>CSS property</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>.richfacesSkin .mceButton</entry>
+ <entry>Defines styles for the buttons</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceButtonDisabled .mceIcon </entry>
+ <entry>Defines styles for the icons</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceIframeContainer</entry>
+ <entry>Defines styles for the container</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceListBox</entry>
+ <entry>Defines styles for the list box</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceMenu</entry>
+ <entry>Defines styles for the menus</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
+ <entry>Defines styles for the active menu items</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
+ <entry>Defines styles for the active menu items</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceSeparator</entry>
+ <entry>Defines styles for the buttons separator</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin .mceToolbar</entry>
+ <entry>Defines styles for the toolbar</entry>
+ </row>
+ <row>
+ <entry morerows="2">.richfacesSkin table.mceLayout</entry>
+ <entry morerows="2">Defines styles for the table layout</entry>
+ <entry>additionalBackgroundColor</entry>
+ <entry>panelBorderColor</entry>
+ </row>
+ <row>
+ <entry>.richfacesSkin table.mceToolbar</entry>
+ <entry>Defines styles for the rows of icons within toolbar</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
- <table>
- <title>CSS selectors for the layout of the editor</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Selector</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>.richfacesSkin table.mceToolbar</entry>
- <entry>Defines styles for the rows of icons within toolbar</entry>
- </row>
- <row>
- <entry>.richfacesSkin .mceButton</entry>
- <entry>Defines styles for the buttons</entry>
- </row>
- <row>
- <entry>.richfacesSkin .mceButtonDisabled .mceIcon </entry>
- <entry>Defines styles for the icons</entry>
- </row>
- <row>
- <entry>.richfacesSkin .mceListBox</entry>
- <entry>Defines styles for the list box</entry>
- </row>
- <row>
- <entry>.richfacesSkin .mceSeparator</entry>
- <entry>Defines styles for the buttons separator</entry>
- </row>
- <row>
- <entry>.richfacesSkin .mceIframeContainer</entry>
- <entry>Defines styles for the container</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin table.mceLayout</entry>
- <entry>Defines styles for the table layout</entry>
- </row>
- <row>
- <entry>.richfacesSkin .mceToolbar</entry>
- <entry>Defines styles for the toolbar</entry>
- </row>
-
-
- </tbody>
- </tgroup>
- </table>
-
-
-
- <table>
- <title>CSS selectors for the menus</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Selector</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>.richfacesSkin .mceMenu</entry>
- <entry>Defines styles for the menus</entry>
- </row>
-
- <row>
- <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
- <entry>Defines styles for the active menu items</entry>
- </row>
-
-
- <row>
- <entry>.richfacesSkin .mceMenu .mceMenuItemActive</entry>
- <entry>Defines styles for the active menu items</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>In order to redefine styles for all <emphasis role="bold">
+
+ <para>In order to redefine styles for all <emphasis role="bold">
<property><rich:editor></property>
</emphasis> components on a page using CSS, it's enough to create classes with the
same names (possible classes could be found in the tables <link linkend="EditorDefinitionofCustomStyleSelectors">above</link>) and define necessary properties in them.
15 years, 4 months