JBoss Rich Faces SVN: r8111 - trunk/test-applications/facelets/src/main/java/inplaceSelect.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-24 06:04:47 -0400 (Thu, 24 Apr 2008)
New Revision: 8111
Modified:
trunk/test-applications/facelets/src/main/java/inplaceSelect/InplaceSelect.java
Log:
add onclick
Modified: trunk/test-applications/facelets/src/main/java/inplaceSelect/InplaceSelect.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/inplaceSelect/InplaceSelect.java 2008-04-24 09:58:33 UTC (rev 8110)
+++ trunk/test-applications/facelets/src/main/java/inplaceSelect/InplaceSelect.java 2008-04-24 10:04:47 UTC (rev 8111)
@@ -30,7 +30,7 @@
public InplaceSelect() {
valueCL = "---";
- editEvent = "click";
+ editEvent = "onclick";
maxSelectWidth = "150";
minSelectWidth = "85";
selectWidth = "170";
16 years, 8 months
JBoss Rich Faces SVN: r8109 - in trunk/test-applications/seleniumTest/src: main/webapp/layout and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-04-24 05:56:08 -0400 (Thu, 24 Apr 2008)
New Revision: 8109
Added:
trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/template/
trunk/test-applications/seleniumTest/src/main/webapp/template/dataTableTemplate.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/template/modalPanelTemplate.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/template/simpleTemplate.xhtml
Removed:
trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml
Modified:
trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
Log:
refactoring
Copied: trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml (from rev 8105, trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-04-24 09:56:08 UTC (rev 8109)
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<head>
+ <script>
+ var errorMessage = null;
+ var pauseHolder = {};
+ window.onerror = function (message, url, code) {
+ errorMessage = message;
+ };
+ function checkError () {
+ return errorMessage;
+ }
+
+ function pause (miliseconds, id) {
+ pauseHolder[id] = false;
+ window.setTimeout(function () { pauseHolder[id] = true; }, miliseconds);
+ }
+
+ function submitForm () {
+ document.getElementById('_form').submit();
+ }
+
+ function reRenderAll () {
+ document.getElementById('_Selenium_Test_ReRender_Form:_reRender').onclick();
+ return;
+ }
+ </script>
+ <style type="text/css">
+ <ui:insert name="style"/>
+ </style>
+</head>
+<f:view>
+<body>
+<div style="padding: 10px; font-size: 24px;">Rich faces component testing by Selenium</div><br/>
+
+<h:form id="_Selenium_Test_ReRender_Form">
+ <table border="0" cellpadding="5" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <a4j:commandLink reRender="_Selenium_Test_Common_Grid" style="display: none;" value="ReRenderAll" id="_reRender"/>
+ </td>
+ </tr>
+ </table>
+</h:form>
+<div id="_Selenium_Test_ControlPoint1" style="display: none;">Control1</div>
+<h:panelGrid id="_Selenium_Test_Common_Grid">
+ <ui:insert name="template"/>
+</h:panelGrid>
+<script type="text/javascript">
+ window.done=false;A4J.AJAX.AddListener(new A4J.AJAX.Listener(function(){window.done=true}));
+</script>
+
+<div id="_Selenium_Test_ControlPoint2" style="display: none;">Control2</div>
+</body>
+</f:view>
+</html>
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml 2008-04-24 09:25:39 UTC (rev 8108)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml 2008-04-24 09:56:08 UTC (rev 8109)
@@ -1,112 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-<head>
- <script>
- var errorMessage = null;
- var pauseHolder = {};
- window.onerror = function (message, url, code) {
- errorMessage = message;
- };
- function checkError () {
- return errorMessage;
- }
-
- function pause (miliseconds, id) {
- pauseHolder[id] = false;
- window.setTimeout(function () { pauseHolder[id] = true; }, miliseconds);
- }
-
- function submitForm () {
- document.getElementById('_form').submit();
- }
-
- function reRenderAll () {
- document.getElementById('_Selenium_Test_ReRender_Form:_reRender').onclick();
- return;
- }
- </script>
- <style type="text/css">
- <ui:insert name="style"/>
- </style>
-</head>
-<f:view>
-<body>
-<div style="padding: 10px; font-size: 24px;">Rich faces component testing by Selenium</div><br/>
-<h:form id="_Selenium_Test_ReRender_Form">
- <table border="0" cellpadding="5" cellspacing="0">
- <tr>
- <td colspan="2">
- <a4j:commandLink reRender="_Selenium_Test_Form1, _Selenium_Test_Form2" style="text-decoration: underline; color: blue" value="ReRenderAll" id="_reRender"/>
- </td>
- </tr>
- <!-- tr>
- <td>
- <b>Ajax Status:</b>
- </td>
- <td>
- <a4j:status startText="Ajax in progress...">
- <f:facet name="stop">
- <h:outputText value="Completed" style="color: green"></h:outputText>
- </f:facet>
- <f:facet name="start">
- <h:outputText value="In progress..." style="color: red"></h:outputText>
- </f:facet>
- </a4j:status>
- </td>
- </tr-->
- </table>
-</h:form>
-<br/>
-<div id="_Selenium_Test_ControlPoint1" style="display: none;">Control1</div>
- <br/>
-<table border="0" cellpadding="0" cellspacing="10"><tr><td style="vertical-align: top">
- <rich:dataTable value="1" id="_Selenium_Test_Description">
- <h:column>
- <f:facet name="header">
- <h:outputText value="Description area"></h:outputText>
- </f:facet>
- <ui:insert name="description"></ui:insert>
- </h:column>
- </rich:dataTable>
-</td></tr></table>
-
- <br/><br/>
-<table border="0" cellpadding="0" cellspacing="10"><tr><td style="vertical-align: top">
-<h:form id="_Selenium_Test_Form1">
- <rich:dataTable value="1" id="_Selenium_Test_DataTable" style="width: auto">
- <h:column>
- <f:facet name="header">
- <h:outputText value="Testing area inside Data Table"></h:outputText>
- </f:facet>
- <ui:insert name="component" />
- </h:column>
- </rich:dataTable>
-</h:form>
-</td>
-<td style="width: 20px">
-</td>
-<td style="vertical-align: top">
-<h:form id="_Selenium_Test_Form2">
- <rich:panel id="_Selenium_Test_Panel">
- <f:facet name="header">
- <h:outputText value="Testing area inside Panel"></h:outputText>
- </f:facet>
- <ui:insert name="component" />
- </rich:panel>
-</h:form>
-</td></tr></table>
-
-
-<script type="text/javascript">
- window.done=false;A4J.AJAX.AddListener(new A4J.AJAX.Listener(function(){window.done=true}));
-</script>
-
-<div id="_Selenium_Test_ControlPoint2" style="display: none;">Control2</div>
-</body>
-</f:view>
-</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/main/webapp/template/dataTableTemplate.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/template/dataTableTemplate.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/template/dataTableTemplate.xhtml 2008-04-24 09:56:08 UTC (rev 8109)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<ui:composition template="../layout/layout.xhtml">
+ <rich:dataTable value="1" id="_Selenium_Test_DataTable">
+ <rich:column>
+ <f:facet name="header">
+ <ui:insert name="body" />
+ </f:facet>
+ </rich:column>
+ </rich:dataTable>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/main/webapp/template/modalPanelTemplate.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/template/modalPanelTemplate.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/template/modalPanelTemplate.xhtml 2008-04-24 09:56:08 UTC (rev 8109)
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<ui:composition template="../layout/layout.xhtml">
+ <rich:modalPanel id="_Selenium_Test_ModelPanel">
+ <ui:insert name="body" />
+ </rich:modalPanel>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/main/webapp/template/simpleTemplate.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/template/simpleTemplate.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/template/simpleTemplate.xhtml 2008-04-24 09:56:08 UTC (rev 8109)
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<ui:composition template="../layout/layout.xhtml">
+ <ui:insert name="body" />
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml 2008-04-24 09:25:39 UTC (rev 8108)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml 2008-04-24 09:56:08 UTC (rev 8109)
@@ -4,7 +4,8 @@
<parameter name="browser" value="*iexplore"/>
<packages>
<package name="org.richfaces" />
- </packages>
+ </packages>
+
</test>
<test name="FireFoxFunctionalTests">
<parameter name="browser" value="*firefox"/>
16 years, 8 months
JBoss Rich Faces SVN: r8108 - trunk/test-applications/jsp/src/main/webapp/InputNumberSpinner.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-04-24 05:25:39 -0400 (Thu, 24 Apr 2008)
New Revision: 8108
Modified:
trunk/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinner.jsp
Log:
oninput* instead of on* events
Modified: trunk/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinner.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinner.jsp 2008-04-24 09:15:22 UTC (rev 8107)
+++ trunk/test-applications/jsp/src/main/webapp/InputNumberSpinner/InputNumberSpinner.jsp 2008-04-24 09:25:39 UTC (rev 8108)
@@ -11,7 +11,16 @@
step="#{inputNumberSpinner.step}" rendered="#{inputNumberSpinner.rendered}" value="#{inputNumberSpinner.value}"
inputClass="#{style.inputClass}" styleClass="#{style.styleClass}" inputStyle="#{style.inputStyle}" style="#{style.style}"
enableManualInput="#{inputNumberSpinner.manualInput}" inputSize="#{inputNumberSpinner.inputSize}"
- onmousedown="#{event.onmousedown}" onblur="#{event.onblur}"
- onchange="#{event.onchange}" onclick="#{event.onclick}" ondblclick="#{event.ondblclick}" onerror="#{event.onerror}" onfocus="#{event.onfocus}" onselect="#{event.onselect}" onkeydown="#{event.onkeydown}" onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}" onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}" ondownclick="#{event.ondownclick}" onupclick="#{event.onupclick}"></rich:inputNumberSpinner>
+ oninputmousedown="#{event.onmousedown}" onblur="#{event.onblur}"
+ onchange="#{event.onchange}" onclick="#{event.onclick}"
+ ondblclick="#{event.ondblclick}" onerror="#{event.onerror}"
+ onfocus="#{event.onfocus}" onselect="#{event.onselect}"
+ oninputkeydown="#{event.onkeydown}" oninputkeypress="#{event.onkeypress}"
+ oninputkeyup="#{event.onkeyup}" oninputmousemove="#{event.onmousemove}"
+ oninputmouseout="#{event.onmouseout}" oninputmouseover="#{event.onmouseover}"
+ onmouseup="#{event.onmouseup}" ondownclick="#{event.ondownclick}"
+ onupclick="#{event.onupclick}"
+ accesskey="y">
+ </rich:inputNumberSpinner>
<rich:spacer height="20px"></rich:spacer>
</f:subview>
16 years, 8 months
JBoss Rich Faces SVN: r8107 - in trunk/test-applications/jsp/src/main: webapp/FileUpload and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-04-24 05:15:22 -0400 (Thu, 24 Apr 2008)
New Revision: 8107
Modified:
trunk/test-applications/jsp/src/main/java/util/event/Event.java
trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp
trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp
trunk/test-applications/jsp/src/main/webapp/styles/styles.css
Log:
onclear, ontyperejected...(new events for fileUpload)
Modified: trunk/test-applications/jsp/src/main/java/util/event/Event.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-04-24 09:10:22 UTC (rev 8106)
+++ trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-04-24 09:15:22 UTC (rev 8107)
@@ -5,7 +5,7 @@
/**
* User: ayanul Date: Feb 11, 2008 Time: 10:15:14 AM
- */
+ */
public class Event {
private String onmouseup;
private String ontabenter;
@@ -32,6 +32,7 @@
private String onclick;
private String oncollapse;
private String oncomplete;
+ private String onclear;
private String ondblclick;
private String ondragend;
private String ondragenter;
@@ -101,6 +102,11 @@
private String oninputmouseout;
private String oninputmouseover;
private String oninputmouseup;
+ private String onsizerejected;
+ private String ontyperejected;
+ private String onupload;
+ private String onuploadcanceled;
+ private String onuploadcomplete;
private String onviewactivated;
private String onviewactivation;
@@ -123,6 +129,7 @@
oncollapse = "showEvent('oncollapseInputID', 'oncollapse work!')";
oncomplete = "showEvent('oncompleteInputID', 'oncomplete work!')";
oncontextmenu = "showEvent('oncontextmenuInputID', 'oncontextmenu work!')";
+ onclear = "showEvent('onclearInputID', 'onclear work!')";
oncurrentdateselect = "showEvent('oncurrentdateselectInputID', 'oncurrentdateselect work!')";
ondatemouseout = "showEvent('ondatemouseoutInputID', 'ondatemouseout work!')";
ondatemouseover = "showEvent('ondatemouseoverInputID', 'ondatemouseover work!')";
@@ -200,6 +207,11 @@
oninputmouseout = "showEvent('oninputmouseoutInputID', 'oninputmouseout work!')";
oninputmouseover = "showEvent('oninputmouseoverInputID', 'oninputmouseover work!')";
oninputmouseup = "showEvent('oninputmouseupInputID', 'oninputmouseup work!')";
+ onsizerejected = "showEvent('onsizerejectedInputID', 'onsizerejected work!')";
+ ontyperejected = "showEvent('ontyperejectedInputID', 'ontyperejected work!')";
+ onupload = "showEvent('onuploadInputID', 'onupload work!')";
+ onuploadcanceled = "showEvent('onuploadcanceledInputID', 'onuploadcanceled work!')";
+ onuploadcomplete = "showEvent('onuploadcompleteInputID', 'onuploadcomplete work!')";
onviewactivated = "showEvent('onviewactivatedInputID', 'onviewactivated work!')";
onviewactivation = "showEvent('onviewactivationInputID', 'onviewactivation work!')";
}
@@ -1172,4 +1184,52 @@
this.oninputdblclick = oninputdblclick;
}
+ public String getOnclear() {
+ return onclear;
+ }
+
+ public void setOnclear(String onclear) {
+ this.onclear = onclear;
+ }
+
+ public String getOnsizerejected() {
+ return onsizerejected;
+ }
+
+ public void setOnsizerejected(String onsizerejected) {
+ this.onsizerejected = onsizerejected;
+ }
+
+ public String getOntyperejected() {
+ return ontyperejected;
+ }
+
+ public void setOntyperejected(String ontyperejected) {
+ this.ontyperejected = ontyperejected;
+ }
+
+ public String getOnupload() {
+ return onupload;
+ }
+
+ public void setOnupload(String onupload) {
+ this.onupload = onupload;
+ }
+
+ public String getOnuploadcanceled() {
+ return onuploadcanceled;
+ }
+
+ public void setOnuploadcanceled(String onuploadcanceled) {
+ this.onuploadcanceled = onuploadcanceled;
+ }
+
+ public String getOnuploadcomplete() {
+ return onuploadcomplete;
+ }
+
+ public void setOnuploadcomplete(String onuploadcomplete) {
+ this.onuploadcomplete = onuploadcomplete;
+ }
+
}
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp 2008-04-24 09:10:22 UTC (rev 8106)
+++ trunk/test-applications/jsp/src/main/webapp/FileUpload/FileUpload.jsp 2008-04-24 09:15:22 UTC (rev 8107)
@@ -14,7 +14,30 @@
listWidth="#{fileUpload.listWidth}"
maxFilesQuantity="#{fileUpload.maxFilesQuantity}"
fileUploadListener="#{fileUpload.fileUploadListener}"
- cleanButtonClass="style" onuploadcanceled="alert('hi')">
+ cleanButtonClass="test"
+ onuploadcanceled="#{event.onuploadcanceled}"
+ onclear="#{event.onclear}"
+ onblur="#{event.onblur}"
+ onchange="#{event.onchange}"
+ onclick="#{event.onclick}"
+ ondblclick="#{event.ondblclick}"
+ onerror="#{event.onerror}"
+ onfocus="#{event.onfocus}"
+ onkeydown="#{event.onkeydown}"
+ onkeypress="#{event.onkeypress}"
+ onkeyup="#{event.onkeyup}"
+ onmousedown="#{event.onmousedown}"
+ onmousemove="#{event.onmousemove}"
+ onmouseout="#{event.onmousemout}"
+ onmouseover="#{event.onmouseover}"
+ onmouseup="#{event.onmouseup}"
+ onselect="#{event.onselect}"
+ onsizerejected="#{event.onsizerejected}"
+ ontyperejected="#{event.ontyperejected}"
+ onupload="#{event.onupload}"
+ onuploadcomplete="#{event.onuploadcomplete}"
+ accesskey="y"
+ >
<f:facet name="label">
<h:outputText value="{_KB}KB from {KB}KB uploaded :[ {mm}:{ss} ]"></h:outputText>
</f:facet>
Modified: trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp 2008-04-24 09:10:22 UTC (rev 8106)
+++ trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp 2008-04-24 09:15:22 UTC (rev 8107)
@@ -14,8 +14,6 @@
<f:verbatim><div style="position: relative"><input id="oninputmouseupInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input id="onviewactivatedInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input id="onviewactivationInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
-
-
<f:verbatim><div style="position: relative"><input id="onmouseupInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input id="ontabenterInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input id="ontableaveInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
@@ -101,4 +99,11 @@
<f:verbatim><div style="position: relative"><input id="ongroupexpandInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input id="oncontextmenuInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input id="ongroupcollapseInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+
+ <f:verbatim><div style="position: relative"><input id="onclearInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="onuploadInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="onuploadcanceledInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="onuploadcompleteInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="onsizerejectedInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="ontyperejectedInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
</f:subview>
Modified: trunk/test-applications/jsp/src/main/webapp/styles/styles.css
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/styles/styles.css 2008-04-24 09:10:22 UTC (rev 8106)
+++ trunk/test-applications/jsp/src/main/webapp/styles/styles.css 2008-04-24 09:15:22 UTC (rev 8107)
@@ -249,4 +249,14 @@
.body {
background-color: pink;
+}
+.test{
+ color: red;
+ background-color: span;
+ font: italic;
+ font-family: sans-serif;
+ font-size: 12px;
+ font-weight: bold;
+ caption-side: top;
+ border: thick;
}
\ No newline at end of file
16 years, 8 months
JBoss Rich Faces SVN: r8106 - trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-04-24 05:10:22 -0400 (Thu, 24 Apr 2008)
New Revision: 8106
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
Log:
build fix
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2008-04-24 06:28:44 UTC (rev 8105)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2008-04-24 09:10:22 UTC (rev 8106)
@@ -1,692 +1,692 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.config;
-
-import java.beans.PropertyDescriptor;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.naming.ConfigurationException;
-
-import org.ajax4jsf.builder.generator.Logger;
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.commons.digester.Digester;
-import org.apache.commons.digester.ExtendedBaseRules;
-import org.apache.tools.ant.BuildException;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.EntityResolver2;
-
-/**
- * Parse builder config file for use with component creation.
- *
- * @author asmirnov(a)exadel.com (latest modification by $Author: ishabalov $)
- * @version $Revision: 1.1.2.10 $ $Date: 2007/02/20 20:57:58 $
- *
- */
-public class BuilderConfig implements LoaderHolder {
-
- /**
- * Resource path to config file schemas and entities
- */
- public static final String COMPONENT_SCHEMA_BASE = "/META-INF/schema/";
-
- /**
- * Resource path to config file schemas and entities
- */
- public static final String ENTITIES_FOLDER = "entities";
-
- /**
- * default URI to dtd in classpath
- */
- private static final String COMPONENT_CONFIG_DTD_URI = COMPONENT_SCHEMA_BASE
- + "component-config.dtd";
-
- /**
- * root element of configuration file
- */
- private static final String GENERATOR_CONFIG_ROOT_ELEMENT = "components";
-
- /**
- * PUBLIC Id of configuration schema
- */
- private static final String GENERATOR_CONFIG_PUBLIC_ID = "-//AJAX4JSF//CDK Generator config/EN";
-
- /**
- * components described in this configuration
- */
- private List<ComponentBean> components = new ArrayList<ComponentBean>();
-
- /**
- * validators described in this configuration
- */
- private List<ValidatorBean> validators = new ArrayList<ValidatorBean>();
-
- /**
- * components described in this configuration
- */
- private List<ConverterBean> converters = new ArrayList<ConverterBean>();
-
- /**
- * renderers described in this configuration
- */
- private List<RendererBean> renderers = new ArrayList<RendererBean>();
-
- private List<ListenerBean> listeners = new ArrayList<ListenerBean>();
-
- private List<FunctionBean> functions = new ArrayList<FunctionBean>();
-
- private ClassLoader _loader;
-
- private Logger _log;
-
- /**
- * @param project -
- * current ant project
- */
- public BuilderConfig(ClassLoader loader, Logger log) {
- _loader = loader;
- _log = log;
- }
-
- /**
- * Parsing builder configuration file
- *
- * @param configFile
- * @throws ParsingException
- */
- public void parseConfig(final File configFile) throws ParsingException {
- getLog().info(" Parse config file " + configFile.toString());
- Digester digester = new Digester();
- digester.setRules(new ExtendedBaseRules());
- digester.setValidating(false);
- digester.setNamespaceAware(false);
- // try {
- // URL dtd =
- // this.getClass().getClassLoader().getResource(COMPONENT_CONFIG_DTD_URI);
- // new
- // URL("resource:/com/exadel/vcp/builder/config/component-config.dtd");
- getLog()
- .debug("Register config DTD as URI " + COMPONENT_CONFIG_DTD_URI);
- digester.register(GENERATOR_CONFIG_PUBLIC_ID, COMPONENT_CONFIG_DTD_URI);
- // } catch (MalformedURLException e) {
- // throw new ParsingException("Malformed URL for internal DTD
- // reference",e);
- // }
-
- // setup custom entity resolver for handle file-resource path's
- // resolve DTD even it not pointed in file, and, for entities - resolve
- // it in
- // classpath if entity registered in DTD witn path /META-INF/schema
- digester.setEntityResolver(new EntityResolver2() {
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
- * java.lang.String)
- */
- public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException, IOException {
- getLog().debug(
- "Request for entity with systemId " + systemId
- + " and publicId " + publicId);
- if (GENERATOR_CONFIG_PUBLIC_ID.equals(publicId)) {
- return getDTDSource();
- } else if (null != publicId && null != systemId
- && systemId.contains(ENTITIES_FOLDER)) {
- int base = systemId.indexOf(ENTITIES_FOLDER);
- String entity = COMPONENT_SCHEMA_BASE
- + systemId.substring(base);
- getLog().debug(
- "attempt to load entity from classpath " + entity);
- InputStream entityStream = BuilderConfig.class
- .getResourceAsStream(entity);
- if (null != entityStream) {
- return new InputSource(entityStream);
- }
- }
- return null;
- }
-
- public InputSource getExternalSubset(String name, String baseURI)
- throws SAXException, IOException {
- getLog().debug(
- "Request for ExternalSubset with name " + name
- + " and baseURI " + baseURI);
- if (GENERATOR_CONFIG_ROOT_ELEMENT.equals(name)) {
- return getDTDSource();
- }
- return null;
- }
-
- public InputSource resolveEntity(String name, String publicId,
- String baseURI, String systemId) throws SAXException,
- IOException {
- getLog().debug(
- "Request for extended entity with systemId " + systemId
- + " and publicId " + publicId);
- getLog().debug(
- "additional parameters with name " + name
- + " and baseURI " + baseURI);
- if ("[dtd]".equals(name)
- && GENERATOR_CONFIG_PUBLIC_ID.equals(publicId)) {
- return getDTDSource();
- } else if (null == name
- || (!name.startsWith("[") && !name.startsWith("&"))) {
- return resolveEntity(publicId, systemId);
- }
- return null;
- }
-
- /**
- * Resolve config DTD from classpath
- *
- * @return source of config file DTD
- */
- private InputSource getDTDSource() {
- return new InputSource(BuilderConfig.class
- .getResourceAsStream(COMPONENT_CONFIG_DTD_URI));
- }
-
- });
-
- // Parsing rules.
-
- // Components
- String path = "components/component";
- digester.addObjectCreate(path, ComponentBean.class);
- digester.addBeanPropertySetter(path + "/name");
- digester.addBeanPropertySetter(path + "/family");
- digester.addBeanPropertySetter(path + "/classname");
- digester.addBeanPropertySetter(path + "/superclass");
- digester.addBeanPropertySetter(path + "/description");
- digester.addBeanPropertySetter(path + "/displayname");
- digester.addBeanPropertySetter(path + "/icon");
- // TODO - for superclass, populate from description in config file, if
- // exist
- digester.addSetProperties(path);
- digester.addSetNext(path, "addComponent");
- path = "components/renderer";
- digester.addObjectCreate(path, RendererBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addRenderer");
- path = "components/component/renderer";
- digester.addObjectCreate(path, RendererBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setRenderer");
-
- path = "components/component/facet";
- digester.addObjectCreate(path, JsfBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addFacet");
- path = "components/component/event";
- digester.addObjectCreate(path, EventBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addEvent");
-
- // Validators
-
- path = "components/validator";
- digester.addObjectCreate(path, ValidatorBean.class);
- digester.addBeanPropertySetter(path + "/id");
- digester.addBeanPropertySetter(path + "/classname");
- digester.addBeanPropertySetter(path + "/superclass");
- digester.addBeanPropertySetter(path + "/description");
- digester.addBeanPropertySetter(path + "/displayname");
- digester.addBeanPropertySetter(path + "/icon");
- // TODO - for superclass, populate from description in config file, if
- // exist
- digester.addSetProperties(path);
- digester.addSetNext(path, "addValidator");
-
- path = "components/validator/property";
- digester.addObjectCreate(path, PropertyBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addProperty");
-
- // Converters
-
- path = "components/converter";
- digester.addObjectCreate(path, ConverterBean.class);
- digester.addBeanPropertySetter(path + "/id");
- digester.addBeanPropertySetter(path + "/classname");
- digester.addBeanPropertySetter(path + "/superclass");
- digester.addBeanPropertySetter(path + "/description");
- digester.addBeanPropertySetter(path + "/displayname");
- digester.addBeanPropertySetter(path + "/icon");
- digester.addBeanPropertySetter(path + "/forclass");
- // TODO - for superclass, populate from description in config file, if
- // exist
- digester.addSetProperties(path);
- digester.addSetNext(path, "addConverter");
-
- // Functions
-
- path = "components/function";
- digester.addObjectCreate(path, FunctionBean.class);
- digester.addBeanPropertySetter(path + "/name");
- digester.addBeanPropertySetter(path + "/description");
- digester.addBeanPropertySetter(path + "/method");
- digester.addSetNext(path, "addFunction");
-
- // - Tags & Tag handlers
-
- path = "components/component/tag";
- digester.addObjectCreate(path, TagBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setTag");
-
- path = "components/validator/tag";
- digester.addObjectCreate(path, TagBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setTag");
-
- path = "components/converter/tag";
- digester.addObjectCreate(path, TagBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setTag");
-
- path = "components/component/tag/test";
- digester.addObjectCreate(path, TagTestClassHolder.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setTest");
-
- path = "components/component/test";
- digester.addObjectCreate(path, TestClassHolder.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setTest");
-
- path = "components/component/taghandler";
- digester.addObjectCreate(path, TagHandlerBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setTaghandler");
- /*
- * path = "components/component/taghandler/test";
- * digester.addObjectCreate(path, TestClassHolder.class);
- * digester.addBeanPropertySetter(path+"/?");
- * digester.addSetProperties(path); digester.addSetNext(path,
- * "setTest");
- */
-
- // Properties
- path = "components/component/property";
- digester.addObjectCreate(path, PropertyBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addProperty");
-
- // path = "components/validator/property";
- // digester.addObjectCreate(path, PropertyBean.class);
- // digester.addBeanPropertySetter(path+"/?");
- // digester.addSetProperties(path);
- // digester.addSetNext(path, "addProperty");
-
- path = "components/converter/property";
- digester.addObjectCreate(path, PropertyBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addProperty");
-
- path = "*/properties/property";
- digester.addObjectCreate(path, PropertyBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addProperty");
-
- // Listeners
-
- path = "components/listener";
- digester.addObjectCreate(path, ListenerBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addListener");
- path = "components/listener/tag";
- digester.addObjectCreate(path, TagBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setTag");
- path = "components/listener/taghandler";
- digester.addObjectCreate(path, TagHandlerBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "setTaghandler");
- path = "components/listener/property";
- digester.addObjectCreate(path, PropertyBean.class);
- digester.addBeanPropertySetter(path + "/?");
- digester.addSetProperties(path);
- digester.addSetNext(path, "addProperty");
-
- // Set this config as root.
- digester.push(this);
- try {
- digester.parse(configFile);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- throw new ParsingException("I/O error on parsing config file ", e);
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- throw new ParsingException("SAX Parsing error in config file ", e);
- }
- // checkComopnentProperties();
- // return this;
- }
-
- /**
- * Check all components for existing and default properties.
- *
- * @param classpath -
- * classpath to find user components, renderers, tags
- * @throws ConfigurationException
- */
- public void checkComponentProperties() throws ParsingException {
- // ClassLoader loader = getProject().createClassLoader(classpath);
- // if(null == loader) {
- // loader = this.getClass().getClassLoader();
- // }
- // setLoader(loader);
-
- for (ListenerBean listener : getListeners()) {
- try {
- Class<?> listenerClass = Class.forName(listener
- .getComponentclass(), false, getLoader());
-
- for (ComponentBean bean : getComponents()) {
- if (bean.getSuperclass() != null) {
- Class<?> componentSClass = Class.forName(bean
- .getSuperclass(), false, getLoader());
-
- if (listenerClass.isAssignableFrom(componentSClass)) {
-
- PropertyBean listenerProperty = bean
- .getProperty(listener.getName());
-
- if (null == listenerProperty) {
- listenerProperty = new PropertyBean();
- listenerProperty.setName(listener.getName());
- bean.addProperty(listenerProperty);
- listenerProperty.setClassname("javax.el.MethodExpression");
- }
-
- Map<String, PropertyDescriptor> map =
- getPropertyDescriptors(componentSClass);
-
- PropertyDescriptor propertyDescriptor =
- map.get(listener.getName());
-
- if (propertyDescriptor != null) {
- String componentPropertyName = propertyDescriptor.getPropertyType().getName();
-
- if (!componentPropertyName.equals(listenerProperty.getClassname())) {
- _log.error(
- String.format("Overriding property type %s with %s for %s.%s",
- listenerProperty.getClassname(),
- componentPropertyName,
- bean.getClassname(),
- listener.getName()
- ));
- }
-
- listenerProperty.setClassname(componentPropertyName);
- }
-
- // TODO - check existing property for compability with this listener.
- listenerProperty.setEl(true);
- listenerProperty.setElonly(true);
- listenerProperty.setAttachedstate(true);
- listenerProperty.setMethodargs(listener
- .getEventclass());
- listener.addSuitableComponent(bean);
- }
- }
- }
- } catch (ClassNotFoundException e) {
- throw new BuildException(e);
- }
-
- listener.checkProperties();
- }
-
- for (Iterator iter = this.getComponents().iterator(); iter.hasNext();) {
- ComponentBaseBean component = (ComponentBaseBean) iter.next();
- component.checkProperties();
- }
-
- for (Iterator iter = this.getValidators().iterator(); iter.hasNext();) {
- ComponentBaseBean component = (ComponentBaseBean) iter.next();
- component.checkProperties();
- }
-
- for (Iterator iter = this.getConverters().iterator(); iter.hasNext();) {
- ComponentBaseBean component = (ComponentBaseBean) iter.next();
- component.checkProperties();
- }
-
- }
-
-
- private Map<String, PropertyDescriptor> getPropertyDescriptors(Class<?> clazz) {
-
- if (clazz.equals(Object.class)) {
- return Collections.emptyMap();
- }
-
- Map<String, PropertyDescriptor> m =
- new TreeMap<String, PropertyDescriptor>();
-
- Class<?> superclass = clazz.getSuperclass();
- if (superclass != null) {
- m.putAll(getPropertyDescriptors(superclass));
- }
-
- Class<?>[] interfaces = clazz.getInterfaces();
- if (interfaces != null) {
- for (Class<?> intrfc : interfaces) {
- m.putAll(getPropertyDescriptors(intrfc));
- }
- }
-
- PropertyDescriptor[] descriptors =
- PropertyUtils.getPropertyDescriptors(clazz);
-
- for (PropertyDescriptor propertyDescriptor : descriptors) {
- m.put(propertyDescriptor.getName(), propertyDescriptor);
- }
-
- return m;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.exadel.vcp.builder.config.LoaderHolder#getLoader()
- */
- public ClassLoader getLoader() {
- return _loader;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.exadel.vcp.builder.config.LoaderHolder#setLoader(java.lang.ClassLoader)
- */
- public void setLoader(ClassLoader loader) {
- _loader = loader;
- }
-
- public Logger getLog() {
- return _log;
- }
-
- public void addComponent(ComponentBean component) {
- this.components.add(component);
- component.setParent(this);
- }
-
- public void addValidator(ValidatorBean validator) {
- this.validators.add(validator);
- validator.setParent(this);
- }
-
- public void addConverter(ConverterBean converter) {
- this.converters.add(converter);
- converter.setParent(this);
- }
-
- public void addRenderer(RendererBean renderer) {
- this.renderers.add(renderer);
- renderer.setParent(this);
- }
-
- public void addListener(ListenerBean listener) {
- this.listeners.add(listener);
- listener.setParent(this);
- }
-
- public void addFunction(FunctionBean function) {
- this.functions.add(function);
- function.setParent(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#clear()
- */
- public void clear() {
- components.clear();
- renderers.clear();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#contains(java.lang.Object)
- */
- public boolean contains(Object o) {
- return components.contains(o);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#get(int)
- */
- public ComponentBaseBean get(int index) {
- return components.get(index);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#indexOf(java.lang.Object)
- */
- public int indexOf(ComponentBaseBean o) {
- return components.indexOf(o);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#isEmpty()
- */
- public boolean isEmpty() {
- return components.isEmpty();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#listIterator()
- */
- public List<ComponentBean> getComponents() {
- return components;
- }
-
- public List<ConverterBean> getConverters() {
- return converters;
- }
-
- public List<ValidatorBean> getValidators() {
- return validators;
- }
-
- public List<ListenerBean> getListeners() {
- return listeners;
- }
-
- /**
- * @return the renderers
- */
- public List<RendererBean> getRenderers() {
- return this.renderers;
- }
-
- public List<FunctionBean> getFunctions() {
- return functions;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#remove(int)
- */
- public ComponentBaseBean remove(int index) {
- return components.remove(index);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#remove(java.lang.Object)
- */
- public boolean remove(ComponentBaseBean o) {
- return components.remove(o);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.List#size()
- */
- public int size() {
- return components.size();
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.builder.config;
+
+import java.beans.PropertyDescriptor;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.naming.ConfigurationException;
+
+import org.ajax4jsf.builder.generator.Logger;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.ExtendedBaseRules;
+import org.apache.tools.ant.BuildException;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
+/**
+ * Parse builder config file for use with component creation.
+ *
+ * @author asmirnov(a)exadel.com (latest modification by $Author: ishabalov $)
+ * @version $Revision: 1.1.2.10 $ $Date: 2007/02/20 20:57:58 $
+ *
+ */
+public class BuilderConfig implements LoaderHolder {
+
+ /**
+ * Resource path to config file schemas and entities
+ */
+ public static final String COMPONENT_SCHEMA_BASE = "/META-INF/schema/";
+
+ /**
+ * Resource path to config file schemas and entities
+ */
+ public static final String ENTITIES_FOLDER = "entities";
+
+ /**
+ * default URI to dtd in classpath
+ */
+ private static final String COMPONENT_CONFIG_DTD_URI = COMPONENT_SCHEMA_BASE
+ + "component-config.dtd";
+
+ /**
+ * root element of configuration file
+ */
+ private static final String GENERATOR_CONFIG_ROOT_ELEMENT = "components";
+
+ /**
+ * PUBLIC Id of configuration schema
+ */
+ private static final String GENERATOR_CONFIG_PUBLIC_ID = "-//AJAX4JSF//CDK Generator config/EN";
+
+ /**
+ * components described in this configuration
+ */
+ private List<ComponentBean> components = new ArrayList<ComponentBean>();
+
+ /**
+ * validators described in this configuration
+ */
+ private List<ValidatorBean> validators = new ArrayList<ValidatorBean>();
+
+ /**
+ * components described in this configuration
+ */
+ private List<ConverterBean> converters = new ArrayList<ConverterBean>();
+
+ /**
+ * renderers described in this configuration
+ */
+ private List<RendererBean> renderers = new ArrayList<RendererBean>();
+
+ private List<ListenerBean> listeners = new ArrayList<ListenerBean>();
+
+ private List<FunctionBean> functions = new ArrayList<FunctionBean>();
+
+ private ClassLoader _loader;
+
+ private Logger _log;
+
+ /**
+ * @param project -
+ * current ant project
+ */
+ public BuilderConfig(ClassLoader loader, Logger log) {
+ _loader = loader;
+ _log = log;
+ }
+
+ /**
+ * Parsing builder configuration file
+ *
+ * @param configFile
+ * @throws ParsingException
+ */
+ public void parseConfig(final File configFile) throws ParsingException {
+ getLog().info(" Parse config file " + configFile.toString());
+ Digester digester = new Digester();
+ digester.setRules(new ExtendedBaseRules());
+ digester.setValidating(false);
+ digester.setNamespaceAware(false);
+ // try {
+ // URL dtd =
+ // this.getClass().getClassLoader().getResource(COMPONENT_CONFIG_DTD_URI);
+ // new
+ // URL("resource:/com/exadel/vcp/builder/config/component-config.dtd");
+ getLog()
+ .debug("Register config DTD as URI " + COMPONENT_CONFIG_DTD_URI);
+ digester.register(GENERATOR_CONFIG_PUBLIC_ID, COMPONENT_CONFIG_DTD_URI);
+ // } catch (MalformedURLException e) {
+ // throw new ParsingException("Malformed URL for internal DTD
+ // reference",e);
+ // }
+
+ // setup custom entity resolver for handle file-resource path's
+ // resolve DTD even it not pointed in file, and, for entities - resolve
+ // it in
+ // classpath if entity registered in DTD witn path /META-INF/schema
+ digester.setEntityResolver(new EntityResolver2() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String,
+ * java.lang.String)
+ */
+ public InputSource resolveEntity(String publicId, String systemId)
+ throws SAXException, IOException {
+ getLog().debug(
+ "Request for entity with systemId " + systemId
+ + " and publicId " + publicId);
+ if (GENERATOR_CONFIG_PUBLIC_ID.equals(publicId)) {
+ return getDTDSource();
+ } else if (null != publicId && null != systemId
+ && systemId.contains(ENTITIES_FOLDER)) {
+ int base = systemId.indexOf(ENTITIES_FOLDER);
+ String entity = COMPONENT_SCHEMA_BASE
+ + systemId.substring(base);
+ getLog().debug(
+ "attempt to load entity from classpath " + entity);
+ InputStream entityStream = BuilderConfig.class
+ .getResourceAsStream(entity);
+ if (null != entityStream) {
+ return new InputSource(entityStream);
+ }
+ }
+ return null;
+ }
+
+ public InputSource getExternalSubset(String name, String baseURI)
+ throws SAXException, IOException {
+ getLog().debug(
+ "Request for ExternalSubset with name " + name
+ + " and baseURI " + baseURI);
+ if (GENERATOR_CONFIG_ROOT_ELEMENT.equals(name)) {
+ return getDTDSource();
+ }
+ return null;
+ }
+
+ public InputSource resolveEntity(String name, String publicId,
+ String baseURI, String systemId) throws SAXException,
+ IOException {
+ getLog().debug(
+ "Request for extended entity with systemId " + systemId
+ + " and publicId " + publicId);
+ getLog().debug(
+ "additional parameters with name " + name
+ + " and baseURI " + baseURI);
+ if ("[dtd]".equals(name)
+ && GENERATOR_CONFIG_PUBLIC_ID.equals(publicId)) {
+ return getDTDSource();
+ } else if (null == name
+ || (!name.startsWith("[") && !name.startsWith("&"))) {
+ return resolveEntity(publicId, systemId);
+ }
+ return null;
+ }
+
+ /**
+ * Resolve config DTD from classpath
+ *
+ * @return source of config file DTD
+ */
+ private InputSource getDTDSource() {
+ return new InputSource(BuilderConfig.class
+ .getResourceAsStream(COMPONENT_CONFIG_DTD_URI));
+ }
+
+ });
+
+ // Parsing rules.
+
+ // Components
+ String path = "components/component";
+ digester.addObjectCreate(path, ComponentBean.class);
+ digester.addBeanPropertySetter(path + "/name");
+ digester.addBeanPropertySetter(path + "/family");
+ digester.addBeanPropertySetter(path + "/classname");
+ digester.addBeanPropertySetter(path + "/superclass");
+ digester.addBeanPropertySetter(path + "/description");
+ digester.addBeanPropertySetter(path + "/displayname");
+ digester.addBeanPropertySetter(path + "/icon");
+ // TODO - for superclass, populate from description in config file, if
+ // exist
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addComponent");
+ path = "components/renderer";
+ digester.addObjectCreate(path, RendererBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addRenderer");
+ path = "components/component/renderer";
+ digester.addObjectCreate(path, RendererBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setRenderer");
+
+ path = "components/component/facet";
+ digester.addObjectCreate(path, JsfBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addFacet");
+ path = "components/component/event";
+ digester.addObjectCreate(path, EventBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addEvent");
+
+ // Validators
+
+ path = "components/validator";
+ digester.addObjectCreate(path, ValidatorBean.class);
+ digester.addBeanPropertySetter(path + "/id");
+ digester.addBeanPropertySetter(path + "/classname");
+ digester.addBeanPropertySetter(path + "/superclass");
+ digester.addBeanPropertySetter(path + "/description");
+ digester.addBeanPropertySetter(path + "/displayname");
+ digester.addBeanPropertySetter(path + "/icon");
+ // TODO - for superclass, populate from description in config file, if
+ // exist
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addValidator");
+
+ path = "components/validator/property";
+ digester.addObjectCreate(path, PropertyBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addProperty");
+
+ // Converters
+
+ path = "components/converter";
+ digester.addObjectCreate(path, ConverterBean.class);
+ digester.addBeanPropertySetter(path + "/id");
+ digester.addBeanPropertySetter(path + "/classname");
+ digester.addBeanPropertySetter(path + "/superclass");
+ digester.addBeanPropertySetter(path + "/description");
+ digester.addBeanPropertySetter(path + "/displayname");
+ digester.addBeanPropertySetter(path + "/icon");
+ digester.addBeanPropertySetter(path + "/forclass");
+ // TODO - for superclass, populate from description in config file, if
+ // exist
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addConverter");
+
+ // Functions
+
+ path = "components/function";
+ digester.addObjectCreate(path, FunctionBean.class);
+ digester.addBeanPropertySetter(path + "/name");
+ digester.addBeanPropertySetter(path + "/description");
+ digester.addBeanPropertySetter(path + "/method");
+ digester.addSetNext(path, "addFunction");
+
+ // - Tags & Tag handlers
+
+ path = "components/component/tag";
+ digester.addObjectCreate(path, TagBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setTag");
+
+ path = "components/validator/tag";
+ digester.addObjectCreate(path, TagBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setTag");
+
+ path = "components/converter/tag";
+ digester.addObjectCreate(path, TagBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setTag");
+
+ path = "components/component/tag/test";
+ digester.addObjectCreate(path, TagTestClassHolder.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setTest");
+
+ path = "components/component/test";
+ digester.addObjectCreate(path, TestClassHolder.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setTest");
+
+ path = "components/component/taghandler";
+ digester.addObjectCreate(path, TagHandlerBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setTaghandler");
+ /*
+ * path = "components/component/taghandler/test";
+ * digester.addObjectCreate(path, TestClassHolder.class);
+ * digester.addBeanPropertySetter(path+"/?");
+ * digester.addSetProperties(path); digester.addSetNext(path,
+ * "setTest");
+ */
+
+ // Properties
+ path = "components/component/property";
+ digester.addObjectCreate(path, PropertyBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addProperty");
+
+ // path = "components/validator/property";
+ // digester.addObjectCreate(path, PropertyBean.class);
+ // digester.addBeanPropertySetter(path+"/?");
+ // digester.addSetProperties(path);
+ // digester.addSetNext(path, "addProperty");
+
+ path = "components/converter/property";
+ digester.addObjectCreate(path, PropertyBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addProperty");
+
+ path = "*/properties/property";
+ digester.addObjectCreate(path, PropertyBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addProperty");
+
+ // Listeners
+
+ path = "components/listener";
+ digester.addObjectCreate(path, ListenerBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addListener");
+ path = "components/listener/tag";
+ digester.addObjectCreate(path, TagBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setTag");
+ path = "components/listener/taghandler";
+ digester.addObjectCreate(path, TagHandlerBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "setTaghandler");
+ path = "components/listener/property";
+ digester.addObjectCreate(path, PropertyBean.class);
+ digester.addBeanPropertySetter(path + "/?");
+ digester.addSetProperties(path);
+ digester.addSetNext(path, "addProperty");
+
+ // Set this config as root.
+ digester.push(this);
+ try {
+ digester.parse(configFile.toString());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ throw new ParsingException("I/O error on parsing config file ", e);
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ throw new ParsingException("SAX Parsing error in config file ", e);
+ }
+ // checkComopnentProperties();
+ // return this;
+ }
+
+ /**
+ * Check all components for existing and default properties.
+ *
+ * @param classpath -
+ * classpath to find user components, renderers, tags
+ * @throws ConfigurationException
+ */
+ public void checkComponentProperties() throws ParsingException {
+ // ClassLoader loader = getProject().createClassLoader(classpath);
+ // if(null == loader) {
+ // loader = this.getClass().getClassLoader();
+ // }
+ // setLoader(loader);
+
+ for (ListenerBean listener : getListeners()) {
+ try {
+ Class<?> listenerClass = Class.forName(listener
+ .getComponentclass(), false, getLoader());
+
+ for (ComponentBean bean : getComponents()) {
+ if (bean.getSuperclass() != null) {
+ Class<?> componentSClass = Class.forName(bean
+ .getSuperclass(), false, getLoader());
+
+ if (listenerClass.isAssignableFrom(componentSClass)) {
+
+ PropertyBean listenerProperty = bean
+ .getProperty(listener.getName());
+
+ if (null == listenerProperty) {
+ listenerProperty = new PropertyBean();
+ listenerProperty.setName(listener.getName());
+ bean.addProperty(listenerProperty);
+ listenerProperty.setClassname("javax.el.MethodExpression");
+ }
+
+ Map<String, PropertyDescriptor> map =
+ getPropertyDescriptors(componentSClass);
+
+ PropertyDescriptor propertyDescriptor =
+ map.get(listener.getName());
+
+ if (propertyDescriptor != null) {
+ String componentPropertyName = propertyDescriptor.getPropertyType().getName();
+
+ if (!componentPropertyName.equals(listenerProperty.getClassname())) {
+ _log.error(
+ String.format("Overriding property type %s with %s for %s.%s",
+ listenerProperty.getClassname(),
+ componentPropertyName,
+ bean.getClassname(),
+ listener.getName()
+ ));
+ }
+
+ listenerProperty.setClassname(componentPropertyName);
+ }
+
+ // TODO - check existing property for compability with this listener.
+ listenerProperty.setEl(true);
+ listenerProperty.setElonly(true);
+ listenerProperty.setAttachedstate(true);
+ listenerProperty.setMethodargs(listener
+ .getEventclass());
+ listener.addSuitableComponent(bean);
+ }
+ }
+ }
+ } catch (ClassNotFoundException e) {
+ throw new BuildException(e);
+ }
+
+ listener.checkProperties();
+ }
+
+ for (Iterator iter = this.getComponents().iterator(); iter.hasNext();) {
+ ComponentBaseBean component = (ComponentBaseBean) iter.next();
+ component.checkProperties();
+ }
+
+ for (Iterator iter = this.getValidators().iterator(); iter.hasNext();) {
+ ComponentBaseBean component = (ComponentBaseBean) iter.next();
+ component.checkProperties();
+ }
+
+ for (Iterator iter = this.getConverters().iterator(); iter.hasNext();) {
+ ComponentBaseBean component = (ComponentBaseBean) iter.next();
+ component.checkProperties();
+ }
+
+ }
+
+
+ private Map<String, PropertyDescriptor> getPropertyDescriptors(Class<?> clazz) {
+
+ if (clazz.equals(Object.class)) {
+ return Collections.emptyMap();
+ }
+
+ Map<String, PropertyDescriptor> m =
+ new TreeMap<String, PropertyDescriptor>();
+
+ Class<?> superclass = clazz.getSuperclass();
+ if (superclass != null) {
+ m.putAll(getPropertyDescriptors(superclass));
+ }
+
+ Class<?>[] interfaces = clazz.getInterfaces();
+ if (interfaces != null) {
+ for (Class<?> intrfc : interfaces) {
+ m.putAll(getPropertyDescriptors(intrfc));
+ }
+ }
+
+ PropertyDescriptor[] descriptors =
+ PropertyUtils.getPropertyDescriptors(clazz);
+
+ for (PropertyDescriptor propertyDescriptor : descriptors) {
+ m.put(propertyDescriptor.getName(), propertyDescriptor);
+ }
+
+ return m;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.exadel.vcp.builder.config.LoaderHolder#getLoader()
+ */
+ public ClassLoader getLoader() {
+ return _loader;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.exadel.vcp.builder.config.LoaderHolder#setLoader(java.lang.ClassLoader)
+ */
+ public void setLoader(ClassLoader loader) {
+ _loader = loader;
+ }
+
+ public Logger getLog() {
+ return _log;
+ }
+
+ public void addComponent(ComponentBean component) {
+ this.components.add(component);
+ component.setParent(this);
+ }
+
+ public void addValidator(ValidatorBean validator) {
+ this.validators.add(validator);
+ validator.setParent(this);
+ }
+
+ public void addConverter(ConverterBean converter) {
+ this.converters.add(converter);
+ converter.setParent(this);
+ }
+
+ public void addRenderer(RendererBean renderer) {
+ this.renderers.add(renderer);
+ renderer.setParent(this);
+ }
+
+ public void addListener(ListenerBean listener) {
+ this.listeners.add(listener);
+ listener.setParent(this);
+ }
+
+ public void addFunction(FunctionBean function) {
+ this.functions.add(function);
+ function.setParent(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#clear()
+ */
+ public void clear() {
+ components.clear();
+ renderers.clear();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#contains(java.lang.Object)
+ */
+ public boolean contains(Object o) {
+ return components.contains(o);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#get(int)
+ */
+ public ComponentBaseBean get(int index) {
+ return components.get(index);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#indexOf(java.lang.Object)
+ */
+ public int indexOf(ComponentBaseBean o) {
+ return components.indexOf(o);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#isEmpty()
+ */
+ public boolean isEmpty() {
+ return components.isEmpty();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#listIterator()
+ */
+ public List<ComponentBean> getComponents() {
+ return components;
+ }
+
+ public List<ConverterBean> getConverters() {
+ return converters;
+ }
+
+ public List<ValidatorBean> getValidators() {
+ return validators;
+ }
+
+ public List<ListenerBean> getListeners() {
+ return listeners;
+ }
+
+ /**
+ * @return the renderers
+ */
+ public List<RendererBean> getRenderers() {
+ return this.renderers;
+ }
+
+ public List<FunctionBean> getFunctions() {
+ return functions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#remove(int)
+ */
+ public ComponentBaseBean remove(int index) {
+ return components.remove(index);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#remove(java.lang.Object)
+ */
+ public boolean remove(ComponentBaseBean o) {
+ return components.remove(o);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.List#size()
+ */
+ public int size() {
+ return components.size();
+ }
+}
16 years, 8 months
JBoss Rich Faces SVN: r8105 - in trunk/docs/userguide/en/src/main: resources/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-04-24 02:28:44 -0400 (Thu, 24 Apr 2008)
New Revision: 8105
Added:
trunk/docs/userguide/en/src/main/resources/images/dataDefinitionList_oc.png
trunk/docs/userguide/en/src/main/resources/images/dataDefinitionList_pc.png
trunk/docs/userguide/en/src/main/resources/images/dataOrderedList_oc.png
trunk/docs/userguide/en/src/main/resources/images/dataOrderedList_pc.png
trunk/docs/userguide/en/src/main/resources/images/menuGroup_oc.png
trunk/docs/userguide/en/src/main/resources/images/menuGroup_pc.png
trunk/docs/userguide/en/src/main/resources/images/menuItem_oc.png
trunk/docs/userguide/en/src/main/resources/images/menuItem_pc.png
trunk/docs/userguide/en/src/main/resources/images/menuSeparator_pc.png
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml
trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml
trunk/docs/userguide/en/src/main/docbook/included/menuSeparator.xml
Log:
RF-1052 - done for dataOrderedList, dataDefinitionList, menuGroup(-Item, Separator):added information and screens
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2008-04-24 00:14:18 UTC (rev 8104)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2008-04-24 06:28:44 UTC (rev 8105)
@@ -197,7 +197,7 @@
</mediaobject>
</figure>
- <table>
+ <table id="tab_dDL">
<title>Classes names that define a list appearance</title>
<tgroup cols="2">
<thead>
@@ -226,14 +226,60 @@
<para>In order to redefine styles for all <emphasis role="bold">
<property><rich:dataDefinitionList></property>
</emphasis> components on a page using CSS, it's enough to create classes with the
- same names and define necessary properties in them.</para>
+ same names (possible classes could be found in the tables <link linkend="tab_dDL"> above</link>) and define necessary properties in them. </para>
- <para>To change styles of particular <emphasis role="bold">
- <property><rich:dataDefinitionList></property>
- </emphasis> components, define your own style classes in the corresponding <emphasis
- role="bold">
- <property><rich:dataDefinitionList></property>
- </emphasis>attributes.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.rich-definition-term{
+ font-weight:bold;
+}
+...]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/dataDefinitionList_pc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example a term font weight was changed.</para>
+
+ <para>Also it’s possible to change styles of particular <emphasis role="bold"
+ ><property><rich:dataDefinitionList></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
+ ><property><rich:dataDefinitionList></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[...
+.myClass{
+ font-style: italic;
+}
+...]]></programlisting>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[<rich:dataDefinitionList ... rowClasses="myClass"/>
+]]></programlisting>
+
+ <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/dataDefinitionList_oc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As it could be seen on the picture above, the font style for rows was changed.</para>
</section>
<section>
<title>Relevant Resources Links</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2008-04-24 00:14:18 UTC (rev 8104)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2008-04-24 06:28:44 UTC (rev 8105)
@@ -195,7 +195,7 @@
</mediaobject>
</figure>
- <table>
+ <table id="tab_dOL">
<title>Classes names that define a list appearance</title>
<tgroup cols="2">
<thead>
@@ -218,16 +218,62 @@
</table>
<para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:dataOrderedList></property>
- </emphasis> components on a page using CSS, it's enough to create classes with the
- same names and define necessary properties in them.</para>
-
- <para>To change styles of particular <emphasis role="bold">
- <property><rich:dataOrderedList></property>
- </emphasis> components, define your own style classes in the corresponding <emphasis
- role="bold">
- <property><rich:dataOrderedList></property>
- </emphasis>attributes.</para>
+ <property><rich:dataOrderedList></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="tab_dOL"> above</link>) and define necessary properties in them. </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.rich-orderedlist{
+ background-color: #ebf3fd;
+}
+...]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/dataOrderedList_pc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example background color was changed.</para>
+
+ <para>Also it’s possible to change styles of particular <emphasis role="bold"
+ ><property><rich:dataOrderedList></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
+ ><property><rich:dataOrderedList></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[...
+.myClass{
+ font-style: italic;
+}
+...]]></programlisting>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[<rich:dataOrderedList ... styleClass="myClass"/>
+]]></programlisting>
+
+ <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/dataOrderedList_oc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As it could be seen on the picture above, the font style was changed.</para>
</section>
<section>
<title>Relevant Resources Links</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml 2008-04-24 00:14:18 UTC (rev 8104)
+++ trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml 2008-04-24 06:28:44 UTC (rev 8105)
@@ -261,7 +261,7 @@
</imageobject>
</mediaobject>
</figure>
- <table>
+ <table id="tab_mG">
<title>Classes names that define an appearance of group elements</title>
<tgroup cols="2">
<thead>
@@ -331,14 +331,64 @@
<para>In order to redefine styles for all <emphasis role="bold">
<property><rich:menuGroup></property>
</emphasis> components on a page using CSS, it's enough to create classes with the
- same names and define necessary properties in them.</para>
+ same names (possible classes could be found in the tables <link linkend="tab_mG"> above</link>) and define necessary properties in them. </para>
- <para>To change styles of particular <emphasis role="bold">
- <property><rich:menuGroup></property>
- </emphasis> components, define your own style classes in the corresponding <emphasis
- role="bold">
- <property><rich:menuGroup></property>
- </emphasis>attributes.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.rich-menu-item-label-disabled{
+ font-style: italic;
+}
+...]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/menuGroup_pc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example a disabled label font style was changed.</para>
+
+ <para>Also it’s possible to change styles of particular <emphasis role="bold"
+ ><property><rich:menuGroup></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
+ ><property><rich:menuGroup></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[...
+.myClass{
+ background-color: #acbece;
+ border: none;
+}
+...]]></programlisting>
+ <para>The <emphasis><property>"styleClass"</property></emphasis> attribute for <emphasis role="bold"
+ ><property><rich:menuGroup></property></emphasis> is defined as it’s shown in the example below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[<rich:menuGroup value="Save As..." selectClass="myClass">
+]]></programlisting>
+
+ <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/menuGroup_oc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As it could be seen on the picture above, the background color for selected class was changed. Also selected class has no border.</para>
</section>
<section>
<title>Relevant Resources Links</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml 2008-04-24 00:14:18 UTC (rev 8104)
+++ trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml 2008-04-24 06:28:44 UTC (rev 8105)
@@ -289,7 +289,7 @@
</imageobject>
</mediaobject>
</figure>
- <table>
+ <table id="tab_mI">
<title>Classes names that define an appearance of item elements</title>
<tgroup cols="2">
<thead>
@@ -369,16 +369,66 @@
</tgroup>
</table>
<para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:menuItem></property>
- </emphasis> components on a page using CSS, it's enough to create classes with
- the same names and define necessary properties in them.</para>
-
- <para>To change styles of particular <emphasis role="bold">
- <property><rich:menuItem></property>
- </emphasis> components, define your own style classes in the corresponding <emphasis
- role="bold">
- <property><rich:menuItem></property>
- </emphasis>attributes.</para>
+ <property><rich:menuItem></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="tab_mI"> above</link>) and define necessary properties in them. </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.rich-menu-item-disabled{
+ font-style: italic;
+}
+...]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/menuItem_pc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example a disabled item font style was changed.</para>
+
+ <para>Also it’s possible to change styles of particular <emphasis role="bold"
+ ><property><rich:menuItem></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
+ ><property><rich:menuItem></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[...
+.myClass{
+ border-color: #bed6f8;
+ background-color: #ffffff;
+}
+...]]></programlisting>
+ <para>The <emphasis><property>"styleClass"</property></emphasis> attribute for <emphasis role="bold"
+ ><property><rich:menuItem></property></emphasis> is defined as it’s shown in the example below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[<rich:menuItem ... selectStyle="myClass">
+]]></programlisting>
+
+ <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/menuItem_oc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As it could be seen on the picture above, the background color and border color for selected item were changed. </para>
</section>
<section>
<title>Relevant Resources Links</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/menuSeparator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/menuSeparator.xml 2008-04-24 00:14:18 UTC (rev 8104)
+++ trunk/docs/userguide/en/src/main/docbook/included/menuSeparator.xml 2008-04-24 06:28:44 UTC (rev 8105)
@@ -132,7 +132,7 @@
</imageobject>
</mediaobject>
</figure>
- <table>
+ <table id="tab_mS">
<title>Classes names that define separator element appearance.</title>
<tgroup cols="2">
<thead>
@@ -150,16 +150,31 @@
</tgroup>
</table>
<para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:separator></property>
- </emphasis> components on a page using CSS, it's enough to create class with the
- same name and define necessary properties in it.</para>
+ <property><rich:menuSeparator></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="tab_mS"> above</link>) and define necessary properties in them. </para>
- <para>To change styles of particular <emphasis role="bold">
- <property><rich:separator></property>
- </emphasis> components, define your own style class in the corresponding <emphasis
- role="bold">
- <property><rich:separator></property>
- </emphasis>attributes.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.rich-menu-separator{
+ border-color: #acbece;
+}
+...]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/menuSeparator_pc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example a menu separator border color was changed.</para>
</section>
<section>
<title>Relevant Resources Links</title>
Added: trunk/docs/userguide/en/src/main/resources/images/dataDefinitionList_oc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/dataDefinitionList_oc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/dataDefinitionList_pc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/dataDefinitionList_pc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/dataOrderedList_oc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/dataOrderedList_oc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/dataOrderedList_pc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/dataOrderedList_pc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/menuGroup_oc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/menuGroup_oc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/menuGroup_pc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/menuGroup_pc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/menuItem_oc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/menuItem_oc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/menuItem_pc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/menuItem_pc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/menuSeparator_pc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/menuSeparator_pc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 8 months
JBoss Rich Faces SVN: r8104 - trunk/framework/impl/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-04-23 20:14:18 -0400 (Wed, 23 Apr 2008)
New Revision: 8104
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
Log:
Fix http://jira.jboss.com/jira/browse/RF-2297
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-04-24 00:10:21 UTC (rev 8103)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-04-24 00:14:18 UTC (rev 8104)
@@ -1294,6 +1294,15 @@
*/
public void queueEvent(FacesEvent event) {
if (event.getComponent() != this) {
+ // For Ajax events, keep row value.
+ if (event.getPhaseId() == PhaseId.RENDER_RESPONSE) {
+ Object eventRowKey = getRowKey();
+ if (null != eventRowKey) {
+ this._ajaxRowKey = eventRowKey;
+ this._ajaxRowKeysMap.put(getBaseClientId(getFacesContext()),
+ eventRowKey);
+ }
+ }
event = new IndexedEvent(this, event, getRowKey());
}
// Send event directly to parent, to avoid wrapping in superclass.
@@ -1324,11 +1333,6 @@
setRowKey(faces, eventRowKey);
FacesEvent rowEvent = revent.getTarget();
rowEvent.getComponent().broadcast(rowEvent);
- // For Ajax events, keep row value.
- if (!(rowEvent.getPhaseId() == PhaseId.RENDER_RESPONSE)) {
- this._ajaxRowKey = eventRowKey;
- // this._ajaxRowKeysMap.put(getBaseClientId(faces), eventRowKey);
- }
setRowKey(faces, oldRowKey);
restoreOrigValue(faces);
// }
16 years, 8 months
JBoss Rich Faces SVN: r8103 - in branches/3.1.x/samples/richfaces-demo/src/main: java/org/richfaces/datatablescroller and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-23 20:10:21 -0400 (Wed, 23 Apr 2008)
New Revision: 8103
Modified:
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/datatable/UpdateBean.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/Environment.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionDataModel.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionDataProvider.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionItem.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaBean.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaData.java
branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java
branches/3.1.x/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
richfaces-demo made compatible with JDK 1.4/JSF 1.1
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/datatable/UpdateBean.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/datatable/UpdateBean.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/datatable/UpdateBean.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -10,7 +10,7 @@
HtmlInputText priceRef;
private UIRepeat repeater=null;
- private Set<Integer> keys = null;
+ private Set keys = null;
/**
* @return the keys
@@ -44,8 +44,8 @@
public String change(){
- HashSet keys = new HashSet<Integer>();
- int rowKey = repeater.getRowIndex();
+ HashSet keys = new HashSet();
+ Integer rowKey = new Integer(repeater.getRowIndex());
keys.add(rowKey);
setKeys(keys);
priceRef.processValidators(FacesContext.getCurrentInstance());
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -21,16 +21,16 @@
*/
public class DataTableScrollerBean {
private SimpleSelection selection = new SimpleSelection();
- private ArrayList<DemoInventoryItem> selectedCars = new ArrayList<DemoInventoryItem>();
+ private ArrayList selectedCars = new ArrayList();
private static int DECIMALS = 1;
private static int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;
- private static List <DemoInventoryItem> allCars = null;
+ private static List allCars = null;
- public List <DemoInventoryItem> getAllCars() {
+ public List getAllCars() {
synchronized (this) {
if (allCars == null) {
- allCars = new ArrayList<DemoInventoryItem>();
+ allCars = new ArrayList();
for (int k = 0; k <= 5; k++) {
try{
switch (k) {
@@ -77,8 +77,8 @@
return allCars;
}
- public List<DemoInventoryItem> getTenRandomCars() {
- List<DemoInventoryItem> result = new ArrayList<DemoInventoryItem>();
+ public List getTenRandomCars() {
+ List result = new ArrayList();
int size = getAllCars().size()-1;
for (int i = 0; i < 10; i++) {
result.add(getAllCars().get(rand(1, size)));
@@ -90,9 +90,9 @@
return rand(1,10000);
}
- public List <DemoInventoryItem> createCar(String make, String model, int count){
+ public List createCar(String make, String model, int count){
- ArrayList <DemoInventoryItem> iiList = null;
+ ArrayList iiList = null;
try{
int arrayCount = count;
@@ -121,7 +121,7 @@
}
- iiList = new ArrayList<DemoInventoryItem>(Arrays.asList(demoInventoryItemArrays));
+ iiList = new ArrayList(Arrays.asList(demoInventoryItemArrays));
}catch(Exception e){
System.out.println("!!!!!!createCategory Error: " + e.getMessage());
@@ -163,19 +163,19 @@
public String takeSelection() {
getSelectedCars().clear();
- Iterator<SimpleRowKey> iterator = getSelection().getKeys();
+ Iterator iterator = getSelection().getKeys();
while (iterator.hasNext()){
- SimpleRowKey key = iterator.next();
+ SimpleRowKey key = (SimpleRowKey) iterator.next();
getSelectedCars().add(getAllCars().get(key.intValue()));
}
return null;
}
- public ArrayList<DemoInventoryItem> getSelectedCars() {
+ public ArrayList getSelectedCars() {
return selectedCars;
}
- public void setSelectedCars(ArrayList<DemoInventoryItem> selectedCars) {
+ public void setSelectedCars(ArrayList selectedCars) {
this.selectedCars = selectedCars;
}
}
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -13,14 +13,14 @@
import org.xml.sax.SAXException;
public class CapitalsBean {
- private ArrayList<Capital> capitals = new ArrayList<Capital>();
+ private ArrayList capitals = new ArrayList();
private String capital = "";
- public List<Capital> autocomplete(Object suggest) {
+ public List autocomplete(Object suggest) {
String pref = (String)suggest;
- ArrayList<Capital> result = new ArrayList<Capital>();
+ ArrayList result = new ArrayList();
- Iterator<Capital> iterator = getCapitals().iterator();
+ Iterator iterator = getCapitals().iterator();
while (iterator.hasNext()) {
Capital elem = ((Capital) iterator.next());
if ((elem.getName() != null && elem.getName().toLowerCase().indexOf(pref.toLowerCase()) == 0) || "".equals(pref))
@@ -50,7 +50,7 @@
return null;
}
- public ArrayList<Capital> getCapitals() {
+ public ArrayList getCapitals() {
return capitals;
}
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/Environment.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/Environment.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/Environment.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -3,12 +3,9 @@
import java.util.HashMap;
import java.util.Map;
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-
public class Environment {
private Map params = new HashMap();
- private String version;
+ private Object version;
public Map getParams() {
return params;
}
@@ -17,8 +14,12 @@
this.params = params;
}
- public String getVersion() {
- String shortVersion = FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createValueExpression(FacesContext.getCurrentInstance().getELContext(), "#{a4j.version}", String.class).getValue(FacesContext.getCurrentInstance().getELContext()).toString();
- return shortVersion.substring(0, shortVersion.indexOf("$Date"));
+ public void setVersion(Object version) {
+ this.version = version;
}
+
+ public Object getVersion() {
+ String sVersion = version.toString();
+ return sVersion.substring(0, sVersion.indexOf("$Date"));
+ }
}
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionDataModel.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionDataModel.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionDataModel.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -3,6 +3,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -27,8 +28,8 @@
private AuctionDataProvider dataProvider;
private Integer currentPk;
- private Map<Integer,AuctionItem> wrappedData = new HashMap<Integer,AuctionItem>();
- private List<Integer> wrappedKeys = null;
+ private Map wrappedData = new HashMap();
+ private List wrappedKeys = null;
private boolean detached = false;
/**
@@ -41,14 +42,12 @@
* (non-Javadoc)
* @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
*/
- @Override
public Object getRowKey() {
return currentPk;
}
/**
* This method normally called by Visitor before request Data Row.
*/
- @Override
public void setRowKey(Object key) {
this.currentPk = (Integer) key;
@@ -56,7 +55,6 @@
/**
* This is main part of Visitor pattern. Method called by framework many times during request processing.
*/
- @Override
public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException {
int firstRow = ((SequenceRange)range).getFirstRow();
int numberOfRows = ((SequenceRange)range).getRows();
@@ -65,13 +63,18 @@
// Such approach uses much more getByPk() operations, instead of just one request by range.
// Concrete case may be different from that, so you can just load data from data provider by range.
// We are using wrappedKeys list only to preserve actual order of items.
- for (Integer key:wrappedKeys) {
+ for (Iterator iterator = wrappedKeys.iterator(); iterator.hasNext();) {
+ Integer key = (Integer) iterator.next();
setRowKey(key);
visitor.process(context, key, argument);
}
} else { // if not serialized, than we request data from data provider
- wrappedKeys = new ArrayList<Integer>();
- for (AuctionItem item:dataProvider.getItemsByrange(new Integer(firstRow), numberOfRows, null, true)) {
+ wrappedKeys = new ArrayList();
+ for (Iterator iterator = dataProvider.getItemsByrange(new Integer(firstRow), numberOfRows, null, true).iterator();
+ iterator.hasNext();) {
+
+ AuctionItem item = (AuctionItem) iterator.next();
+
wrappedKeys.add(item.getPk());
wrappedData.put(item.getPk(), item);
visitor.process(context, item.getPk(), argument);
@@ -83,7 +86,7 @@
* to determine total number of data items.
*/
private Integer rowCount; // better to buffer row count locally
- @Override
+
public int getRowCount() {
if (rowCount==null) {
rowCount = new Integer(getDataProvider().getRowCount());
@@ -96,12 +99,11 @@
* This is main way to obtain data row. It is intensively used by framework.
* We strongly recommend use of local cache in that method.
*/
- @Override
public Object getRowData() {
if (currentPk==null) {
return null;
} else {
- AuctionItem ret = wrappedData.get(currentPk);
+ AuctionItem ret = (AuctionItem) wrappedData.get(currentPk);
if (ret==null) {
ret = getDataProvider().getAuctionItemByPk(currentPk);
wrappedData.put(currentPk, ret);
@@ -115,7 +117,6 @@
/**
* Unused rudiment from old JSF staff.
*/
- @Override
public int getRowIndex() {
throw new UnsupportedOperationException();
}
@@ -123,7 +124,6 @@
/**
* Unused rudiment from old JSF staff.
*/
- @Override
public Object getWrappedData() {
throw new UnsupportedOperationException();
}
@@ -131,7 +131,6 @@
/**
* Never called by framework.
*/
- @Override
public boolean isRowAvailable() {
if (currentPk==null) {
return false;
@@ -143,7 +142,6 @@
/**
* Unused rudiment from old JSF staff.
*/
- @Override
public void setRowIndex(int rowIndex) {
throw new UnsupportedOperationException();
}
@@ -151,7 +149,6 @@
/**
* Unused rudiment from old JSF staff.
*/
- @Override
public void setWrappedData(Object data) {
throw new UnsupportedOperationException();
}
@@ -175,7 +172,6 @@
* This is helper method that is called by framework after model update. In must delegate actual database update to
* Data Provider.
*/
- @Override
public void update() {
getDataProvider().update();
}
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionDataProvider.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionDataProvider.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionDataProvider.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -1,6 +1,7 @@
package org.richfaces.demo.extendeddatamodel;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.richfaces.demo.common.RandomDataHelper;
@@ -39,11 +40,11 @@
"NEW 30pcs HEAT SINKS ,50pcs insulation bushing and film",
"0.2% Class A Platinum Resistance Thermometers PT100"
};
- private List<AuctionItem> allItems = null;
+ private List allItems = null;
private static final int VOLUME = 200;
private synchronized void initData() {
- List<AuctionItem> data = new ArrayList<AuctionItem>();
+ List data = new ArrayList();
for (int counter=0; counter<VOLUME; counter++) {
AuctionItem item = new AuctionItem(new Integer(counter));
item.setDescription((String)RandomDataHelper.random(allDescriptions));
@@ -55,7 +56,7 @@
allItems = data;
}
- public List<AuctionItem> getAllItems() {
+ public List getAllItems() {
if (allItems!=null && allItems.size()>0) {
return allItems;
} else {
@@ -65,7 +66,8 @@
}
public AuctionItem getAuctionItemByPk(Integer pk) {
- for (AuctionItem item:getAllItems()) {
+ for (Iterator iterator = getAllItems().iterator(); iterator.hasNext();) {
+ AuctionItem item = (AuctionItem) iterator.next();
if (item.getPk().equals(pk)) {
return item;
}
@@ -73,7 +75,8 @@
throw new RuntimeException("Auction Item pk="+pk.toString()+" not found");
}
public boolean hasAuctionItemByPk(Integer pk) {
- for (AuctionItem item:getAllItems()) {
+ for (Iterator iterator = getAllItems().iterator(); iterator.hasNext();) {
+ AuctionItem item = (AuctionItem) iterator.next();
if (item.getPk().equals(pk)) {
return true;
}
@@ -82,8 +85,8 @@
}
- public List<AuctionItem> getItemsByrange(Integer startPk, int numberOfRows, String sortField, boolean ascending) {
- List<AuctionItem> ret = new ArrayList<AuctionItem>();
+ public List getItemsByrange(Integer startPk, int numberOfRows, String sortField, boolean ascending) {
+ List ret = new ArrayList();
for (int counter=0; counter<numberOfRows; counter++) {
ret.add(getAllItems().get(startPk.intValue()+counter));
}
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionItem.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionItem.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/extendeddatamodel/AuctionItem.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -18,7 +18,6 @@
private boolean loose = false;
private Double amount;
- @SuppressWarnings("unused")
private AuctionItem() {};
public AuctionItem(Integer pk) {
@@ -65,7 +64,7 @@
FacesContext ctx = FacesContext.getCurrentInstance();
if (bid!=null) {
System.out.println("place bid for pk="+getPk()+" bid="+getBid()+" qty="+getQtyRequested());
- if (bid<=highestBid) {
+ if (bid.doubleValue()<=highestBid.doubleValue()) {
ctx.addMessage(event.getComponent().getClientId(ctx), new FacesMessage(FacesMessage.SEVERITY_WARN,"Bid amount is lower that highest bid","You need to bid amount higher that highest bid"));
won = false;
loose = true;
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/listShuttle/ToolBar.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -4,8 +4,8 @@
import java.util.List;
public class ToolBar {
- private List<ToolBarItem> items = new ArrayList<ToolBarItem>();
- private List<ToolBarItem> freeItems = new ArrayList<ToolBarItem>();
+ private List items = new ArrayList();
+ private List freeItems = new ArrayList();
public ToolBar() {
ToolBarItem item = new ToolBarItem();
item.setIcon("create_folder");
@@ -37,18 +37,18 @@
freeItems.add(item);
}
- public List<ToolBarItem> getItems() {
+ public List getItems() {
return items;
}
- public void setItems(List<ToolBarItem> items) {
+ public void setItems(List items) {
this.items = items;
}
- public List<ToolBarItem> getFreeItems() {
+ public List getFreeItems() {
return freeItems;
}
- public void setFreeItems(List<ToolBarItem> freeItems) {
+ public void setFreeItems(List freeItems) {
this.freeItems = freeItems;
}
}
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaBean.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaBean.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaBean.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -12,12 +12,14 @@
if (data instanceof MediaData) {
MediaData paintData = (MediaData) data;
- BufferedImage img = new BufferedImage(paintData.getWidth(),paintData.getHeight(),BufferedImage.TYPE_INT_RGB);
+ int paintDataHeight = paintData.getHeight().intValue();
+ int paintDataWidth = paintData.getWidth().intValue();
+ BufferedImage img = new BufferedImage(paintDataWidth,paintDataHeight,BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = img.createGraphics();
graphics2D.setBackground(paintData.getBackground());
graphics2D.setColor(paintData.getDrawColor());
- graphics2D.clearRect(0,0,paintData.getWidth(),paintData.getHeight());
- graphics2D.drawLine(5,5,paintData.getWidth()-5,paintData.getHeight()-5);
+ graphics2D.clearRect(0,0,paintDataWidth,paintDataHeight);
+ graphics2D.drawLine(5,5,paintDataWidth-5,paintDataHeight-5);
graphics2D.drawChars(new String("RichFaces").toCharArray(),0,9,40,15);
graphics2D.drawChars(new String("mediaOutput").toCharArray(),0,11,5,45);
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaData.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaData.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/media/MediaData.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -6,8 +6,8 @@
public class MediaData implements Serializable{
private static final long serialVersionUID = 1L;
- Integer Width=110;
- Integer Height=50;
+ Integer Width=new Integer(110);
+ Integer Height=new Integer(50);
Color Background=new Color(0,0,0);
Color DrawColor=new Color(255,255,255);
public MediaData() {
Modified: branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java 2008-04-24 00:10:21 UTC (rev 8103)
@@ -149,13 +149,13 @@
this.state2 = state2;
}
- public void walk(TreeNode node, List<TreeNode> appendTo, Class<? extends TreeNode> type) {
+ public void walk(TreeNode node, List appendTo, Class type) {
if (type.isInstance(node)){
appendTo.add(node);
}
- Iterator<Map.Entry<Object, TreeNode>> iterator = node.getChildren();
+ Iterator iterator = node.getChildren();
while(iterator.hasNext()) {
- walk(iterator.next().getValue(), appendTo, type);
+ walk((TreeNode) ((Map.Entry) iterator.next()).getValue(), appendTo, type);
}
}
Modified: branches/3.1.x/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/3.1.x/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-04-23 19:53:19 UTC (rev 8102)
+++ branches/3.1.x/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-04-24 00:10:21 UTC (rev 8103)
@@ -105,6 +105,10 @@
<managed-bean-class>org.richfaces.demo.common.Environment</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
+ <property-name>version</property-name>
+ <value>#{a4j.version}</value>
+ </managed-property>
+ <managed-property>
<property-name>params</property-name>
<property-class>java.util.Map</property-class>
<map-entries>
16 years, 8 months
JBoss Rich Faces SVN: r8102 - trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-23 15:53:19 -0400 (Wed, 23 Apr 2008)
New Revision: 8102
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
Log:
http://jira.jboss.com/jira/browse/AJSF-74
http://jira.jboss.com/jira/browse/RF-3158
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2008-04-23 19:04:14 UTC (rev 8101)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2008-04-23 19:53:19 UTC (rev 8102)
@@ -397,7 +397,7 @@
// Set this config as root.
digester.push(this);
try {
- digester.parse(configFile.toString());
+ digester.parse(configFile);
} catch (IOException e) {
// TODO Auto-generated catch block
throw new ParsingException("I/O error on parsing config file ", e);
16 years, 8 months