JBoss Rich Faces SVN: r1797 - trunk/sandbox/ui/message/design/funcspec.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-23 13:32:02 -0400 (Mon, 23 Jul 2007)
New Revision: 1797
Modified:
trunk/sandbox/ui/message/design/funcspec/FuncSpec - RF Message Component.doc
Log:
remove markerLocation attribute from specification
Modified: trunk/sandbox/ui/message/design/funcspec/FuncSpec - RF Message Component.doc
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r1796 - in trunk/sandbox/ui/message/src/main: java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-23 13:27:05 -0400 (Mon, 23 Jul 2007)
New Revision: 1796
Modified:
trunk/sandbox/ui/message/src/main/config/component/message.xml
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
Log:
remove markerLocation attribute
Modified: trunk/sandbox/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-23 17:05:46 UTC (rev 1795)
+++ trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-23 17:27:05 UTC (rev 1796)
@@ -46,15 +46,6 @@
</description>
</property>
- <property attachedstate="true">
- <name>markerLocation</name>
- <classname>java.lang.String</classname>
- <description>
- marker location relatively to informational part. Possible values are left(default) and right
- </description>
- <defaultvalue>"left"</defaultvalue>
- </property>
-
<property>
<name>for</name>
<classname>java.lang.String</classname>
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-23 17:05:46 UTC (rev 1795)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-23 17:27:05 UTC (rev 1796)
@@ -18,8 +18,6 @@
private String passedLabel = "passed";
- private String markerLocation = "left";
-
private boolean isError = false;
public boolean isError() {
@@ -30,10 +28,6 @@
public abstract void setPassedLabel(String passedLabel);
- public abstract String getMarkerLocation();
-
- public abstract void setMarkerLocation(String markerLocation);
-
public boolean isAjaxRendered() {
return true;
}
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-23 17:05:46 UTC (rev 1795)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-23 17:27:05 UTC (rev 1796)
@@ -115,26 +115,15 @@
protected void encodingUIContent(UIRichMessage uiMsg, FacesContext context, FacesMessage facesMsg) throws IOException{
- String markerLocation = uiMsg.getMarkerLocation();
- markerLocation = markerLocation.toLowerCase();
-
ResponseWriter writer = context.getResponseWriter();
+
writer.startElement(HTML.SPAN_ELEM, uiMsg);
getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMsg.getClientId(context));
renderOuterStyle(uiMsg, context, writer, facesMsg);
-
- if(markerLocation.equals(uiMsg.MARKER_LOCATION_LEFT)){
+ renderMarkerFacet(uiMsg,context, writer,facesMsg);
+ renderLabel(uiMsg, context, writer, facesMsg);
- renderMarkerFacet(uiMsg,context, writer,facesMsg);
- renderLabel(uiMsg, context, writer, facesMsg);
-
- }else if(markerLocation.equals(uiMsg.MARKER_LOCATION_RIGHT)){
-
- renderLabel(uiMsg, context, writer, facesMsg);
- renderMarkerFacet(uiMsg,context, writer,facesMsg);
-
- }
writer.endElement(HTML.SPAN_ELEM);
}
17 years, 5 months
JBoss Rich Faces SVN: r1795 - trunk/docs/ajaxguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkukharchuk
Date: 2007-07-23 13:05:46 -0400 (Mon, 23 Jul 2007)
New Revision: 1795
Modified:
trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGfaq.xml
Log:
http://jira.jboss.com/jira/browse/AJSF-100
Modified: trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGfaq.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGfaq.xml 2007-07-23 15:24:27 UTC (rev 1794)
+++ trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGfaq.xml 2007-07-23 17:05:46 UTC (rev 1795)
@@ -367,6 +367,15 @@
content could be updated dynamically on AJAX.</para>
</section>
+ <section id="PreventDupRerenderingPoll">
+ <?dbhtml filename="PreventDupRerenderingPoll.html"?>
+ <title>How to prevent duplicate reRendering when using <a4j:poll>?</title>
+ <para>For information you can see discussion about this problem on the <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059731#..."
+ >Ajax4Jsf Users Forum. </ulink>
+ </para>
+ </section>
+
<section id="JSCallPropblemsInInclude">
<?dbhtml filename="JSCallPropblemsInInclude.html"?>
<title>Why does JavaScript call don't work in <a4j:include>?</title>
@@ -376,6 +385,15 @@
</para>
</section>
+ <section id="IncludeAndNavRules">
+ <?dbhtml filename="IncludeAndNavRules.html"?>
+ <title>How to use <a4j:include> and navigation rules?</title>
+ <para>For information you can see discussion about this problem on the <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062036#..."
+ >Ajax4Jsf Users Forum. </ulink>
+ </para>
+ </section>
+
<section id="ResourceNotRegisteredException">
<?dbhtml filename="ResourceNotRegisteredException.html"?>
<title>What does ResourceNotRegistered Exception mean?</title>
17 years, 5 months
JBoss Rich Faces SVN: r1791 - trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-23 10:53:04 -0400 (Mon, 23 Jul 2007)
New Revision: 1791
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
Log:
add renderOuterStyle() function
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-23 14:31:00 UTC (rev 1790)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-23 14:53:04 UTC (rev 1791)
@@ -121,6 +121,8 @@
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.SPAN_ELEM, uiMsg);
getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMsg.getClientId(context));
+
+ renderOuterStyle(uiMsg, context, writer, facesMsg);
if(markerLocation.equals(uiMsg.MARKER_LOCATION_LEFT)){
@@ -136,6 +138,55 @@
writer.endElement(HTML.SPAN_ELEM);
}
+ protected void renderOuterStyle(UIRichMessage uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
+
+ String outerClass = null;
+
+ String outerStyle = null;
+
+ Severity severity = null;
+
+
+ if(facesMsg != null){
+
+ severity = facesMsg.getSeverity();
+
+ if(severity == FacesMessage.SEVERITY_ERROR){
+
+ outerClass = (String)uiMsg.getAttributes().get("errorClass");
+ outerStyle = (String)uiMsg.getAttributes().get("errorStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_FATAL){
+
+ outerClass = (String)uiMsg.getAttributes().get("fatalClass");
+ outerStyle = (String)uiMsg.getAttributes().get("fatalStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_WARN){
+
+ outerClass = (String)uiMsg.getAttributes().get("warnClass");
+ outerStyle = (String)uiMsg.getAttributes().get("warnStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_INFO){
+
+ outerClass = (String)uiMsg.getAttributes().get("infoClass");
+ outerStyle = (String)uiMsg.getAttributes().get("infoStyle");
+ }
+ }
+
+ String parentStyle = (String)uiMsg.getAttributes().get("style");
+ String parentClass = (String)uiMsg.getAttributes().get("styleClass");
+
+ String richMessageClass = "rich-message" + (null != outerClass ? (outerClass + " ") : "");
+ String richMessageStyle = (null != outerStyle ? outerClass + " ," : "");
+
+ parentStyle = parentStyle != null ? (richMessageStyle + parentStyle) : richMessageStyle;
+ parentClass = parentClass != null ? (richMessageClass + parentClass) : richMessageClass;
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, parentClass);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, parentStyle);
+
+ }
+
protected void renderMarkerFacet(UIRichMessage uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
UIComponent marker = null;
@@ -216,10 +267,6 @@
String labelStyle = null;
- String outerClass = null;
-
- String outerStyle = null;
-
String passLabel = null;
Severity severity = null;
@@ -239,33 +286,21 @@
if(severity == FacesMessage.SEVERITY_ERROR){
- outerClass = (String)uiMsg.getAttributes().get("errorClass");
- outerStyle = (String)uiMsg.getAttributes().get("errorStyle");
-
labelClass = (String)uiMsg.getAttributes().get("errorLabelClass");
labelStyle = (String)uiMsg.getAttributes().get("errorLabelStyle");
}else if(severity == FacesMessage.SEVERITY_FATAL){
- outerClass = (String)uiMsg.getAttributes().get("fatalClass");
- outerStyle = (String)uiMsg.getAttributes().get("fatalStyle");
-
labelClass = (String)uiMsg.getAttributes().get("fatalLabelClass");
labelStyle = (String)uiMsg.getAttributes().get("fatalLabelStyle");
}else if(severity == FacesMessage.SEVERITY_WARN){
- outerClass = (String)uiMsg.getAttributes().get("warnClass");
- outerStyle = (String)uiMsg.getAttributes().get("warnStyle");
-
labelClass = (String)uiMsg.getAttributes().get("warnLabelClass");
labelStyle = (String)uiMsg.getAttributes().get("warnLabelStyle");
}else if(severity == FacesMessage.SEVERITY_INFO){
- outerClass = (String)uiMsg.getAttributes().get("infoClass");
- outerStyle = (String)uiMsg.getAttributes().get("infoStyle");
-
labelClass = (String)uiMsg.getAttributes().get("infoLabelClass");
labelStyle = (String)uiMsg.getAttributes().get("infoLabelStyle");
@@ -286,18 +321,6 @@
}
- String parentStyle = (String)uiMsg.getAttributes().get("style");
- String parentClass = (String)uiMsg.getAttributes().get("styleClass");
-
- String richMessageClass = "rich-message" + (null != outerClass ? (outerClass + " ") : "");
- String richMessageStyle = (null != outerStyle ? outerClass + " ," : "");
-
- parentStyle = parentStyle != null ? (richMessageStyle + parentStyle) : parentStyle;
- parentClass = parentClass != null ? (richMessageClass + parentClass) : parentClass;
-
- getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, parentClass);
- getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, parentStyle);
-
String classes = labelClass == null ? "rich-message-label" : "rich-message-label " + labelClass;
writer.startElement(HTML.SPAN_ELEM, uiMsg);
17 years, 5 months
JBoss Rich Faces SVN: r1790 - trunk/sandbox/ui/message/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-23 10:31:00 -0400 (Mon, 23 Jul 2007)
New Revision: 1790
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
Log:
remove setError method
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-23 14:28:39 UTC (rev 1789)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-23 14:31:00 UTC (rev 1790)
@@ -26,10 +26,6 @@
return isError;
}
- public void setError(boolean isError) {
- this.isError = isError;
- }
-
public abstract String getPassedLabel();
public abstract void setPassedLabel(String passedLabel);
17 years, 5 months
JBoss Rich Faces SVN: r1789 - trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-23 10:28:39 -0400 (Mon, 23 Jul 2007)
New Revision: 1789
Modified:
trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml
Log:
Modified: trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml
===================================================================
--- trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml 2007-07-23 14:28:34 UTC (rev 1788)
+++ trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml 2007-07-23 14:28:39 UTC (rev 1789)
@@ -22,7 +22,6 @@
</h:selectOneMenu>
<h:commandButton value="submit" />
<a4j:commandButton value="submit ajax" />
-
<r:message for="select"
tooltip="true"
@@ -55,6 +54,7 @@
</r:message>
<a4j:outputPanel ajaxRendered="true">
+
<r:message for="select"
tooltip="true"
showDetail="false"
17 years, 5 months
JBoss Rich Faces SVN: r1788 - trunk/sandbox/ui/scrollable-grid.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-23 10:28:34 -0400 (Mon, 23 Jul 2007)
New Revision: 1788
Removed:
trunk/sandbox/ui/scrollable-grid/.classpath
trunk/sandbox/ui/scrollable-grid/.project
trunk/sandbox/ui/scrollable-grid/.settings/
Log:
removed unneeded files
Deleted: trunk/sandbox/ui/scrollable-grid/.classpath
===================================================================
--- trunk/sandbox/ui/scrollable-grid/.classpath 2007-07-23 14:21:40 UTC (rev 1787)
+++ trunk/sandbox/ui/scrollable-grid/.classpath 2007-07-23 14:28:34 UTC (rev 1788)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" path="target/generated-component/java"/>
- <classpathentry excluding="**/*.java" kind="src" path="target/generated-component/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/xalan/xalan/2.6.0/xalan-2.6.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.0/jstl-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/ajax4jsf/test/1.1.1-SNAPSHOT/test-1.1.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/jdom/jdom/1.0/jdom-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.12/jsf-facelets-1.1.12.jar" sourcepath="M2_REPO/com/sun/facelets/jsf-facelets/1.1.12/jsf-facelets-1.1.12-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/jsp-api/2.0/jsp-api-2.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/el-impl/el-impl/1.0/el-impl-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.2/commons-io-1.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/richfaces/richfaces/3.0.1-SNAPSHOT/richfaces-3.0.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/htmlunit/htmlunit/1.10/htmlunit-1.10.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/faces/jsf-impl/1.1_02/jsf-impl-1.1_02.jar" sourcepath="M2_REPO/javax/faces/jsf-impl/1.1_02/jsf-impl-1.1_02-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/nekohtml/nekohtml/0.9.5/nekohtml-0.9.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.3.02/xml-apis-1.3.02.jar"/>
- <classpathentry kind="var" path="M2_REPO/rhino/js/1.6R2/js-1.6R2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/ccil/cowan/tagsoup/tagsoup/0.9.7/tagsoup-0.9.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/shale/shale-test/1.0.4/shale-test-1.0.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/faces/jsf-api/1.1_02/jsf-api-1.1_02.jar" sourcepath="M2_REPO/javax/faces/jsf-api/1.1_02/jsf-api-1.1_02-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar" sourcepath="M2_REPO/javax/el/el-api/1.0/el-api-1.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/xom/xom/1.0b3/xom-1.0b3.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/jaxen/jaxen/1.1-beta-11/jaxen-1.1-beta-11.jar"/>
- <classpathentry kind="lib" path="/ajax4jsf/framework/target/ajax4jsf-1.1.1-SNAPSHOT.jar" sourcepath="/ajax4jsf"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Deleted: trunk/sandbox/ui/scrollable-grid/.project
===================================================================
--- trunk/sandbox/ui/scrollable-grid/.project 2007-07-23 14:21:40 UTC (rev 1787)
+++ trunk/sandbox/ui/scrollable-grid/.project 2007-07-23 14:28:34 UTC (rev 1788)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>scrollable-grid</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- </natures>
-</projectDescription>
17 years, 5 months
JBoss Rich Faces SVN: r1786 - in trunk/sandbox/ui/message/src/main: java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-23 10:21:15 -0400 (Mon, 23 Jul 2007)
New Revision: 1786
Added:
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
Modified:
trunk/sandbox/ui/message/src/main/config/component/message.xml
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msg.css
Log:
Code review and new new span based mockup
Modified: trunk/sandbox/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-23 14:20:09 UTC (rev 1785)
+++ trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-23 14:21:15 UTC (rev 1786)
@@ -18,9 +18,10 @@
<![CDATA[ richfaces Message Component ]]>
</description>
- <renderer generate="true" override="true">
- <name>org.richfaces.renderkit.html.RichMessageRenderer</name>
- <template>org/richfaces/message.jspx</template>
+ <renderer generate="false" override="true">
+ <name>org.richfaces.renderkit.html.RichMessageBaseRenderer</name>
+ <classname>org.richfaces.renderkit.html.RichMessageHtmlBaseRenderer</classname>
+ <superclass>org.richfaces.renderkit.html.RichMessageBaseRenderer</superclass>
</renderer>
<tag>
<name>message</name>
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-23 14:20:09 UTC (rev 1785)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-23 14:21:15 UTC (rev 1786)
@@ -1,6 +1,7 @@
package org.richfaces.component;
import javax.faces.component.UIMessage;
+import javax.faces.context.FacesContext;
import org.ajax4jsf.component.AjaxOutput;
@@ -18,7 +19,17 @@
private String passedLabel = "passed";
private String markerLocation = "left";
+
+ private boolean isError = false;
+ public boolean isError() {
+ return isError;
+ }
+
+ public void setError(boolean isError) {
+ this.isError = isError;
+ }
+
public abstract String getPassedLabel();
public abstract void setPassedLabel(String passedLabel);
@@ -27,4 +38,18 @@
public abstract void setMarkerLocation(String markerLocation);
+ public boolean isAjaxRendered() {
+ return true;
+ }
+
+ public void setAjaxRendered(boolean ajaxRendered) {
+ if(!ajaxRendered){
+ new IllegalArgumentException();
+ }
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ isError = true;
+ super.restoreState(context, state);
+ }
}
\ No newline at end of file
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-23 14:20:09 UTC (rev 1785)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-23 14:21:15 UTC (rev 1786)
@@ -1,329 +1,49 @@
package org.richfaces.renderkit.html;
import java.io.IOException;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
-import javax.faces.application.FacesMessage;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIMessage;
import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.renderkit.ComponentVariables;
-import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
-import org.ajax4jsf.renderkit.RendererBase;
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.richfaces.component.UIRichMessage;
-
-/**
- * @author Anton Belevich
- *
- */
public class RichMessageBaseRenderer extends HeaderResourcesRendererBase{
- private static final Log log = LogFactory.getLog(RichMessageBaseRenderer.class);
+ protected static final Log log = LogFactory.getLog(RichMessageHtmlBaseRenderer.class);
public static final String NULL_PARAMETER_ERROR_MESSAGE = "null parameter ERROR";
public static final String COMPONENT_NOT_FOUND_IN_VIEW_WARN_MESSAGE = "component not found in the view WARNING";
- //TODO nick - anton - local fields are not allowed in renderers
- public boolean isError = false;
- private RendererBase messageTemplate = null;
-
-
- public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+ protected Iterator getMessageIterator(FacesContext context, String forClientId, UIComponent component) throws IOException{
Iterator msgIter = null;
- //TODO nick - anton - use || instead of &&
- if(component == null && context == null){
- throw new NullPointerException(NULL_PARAMETER_ERROR_MESSAGE);
- }
-
- if(log.isTraceEnabled()){
- log.trace("begin encoding component: " + component.getId());
- }
-
- if (!component.isRendered()){
- if(log.isTraceEnabled()){
- log.trace("stop encoding component: "
- + component.getId() + " 'rendered' attribute is set to false");
- }
- return;
- }
-
- UIRichMessage msgComponent = (UIRichMessage)component;
- String clientId = msgComponent.getClientId(context);
- String forClientId = msgComponent.getFor();
-
- //TODO nick - anton - stop encoding messages. we should ALWAYS encode root tag of the component
- // to handle AJAX re-rendering even if messages are absent
- if(forClientId == null){
- if(log.isInfoEnabled()){
- //TODO nick - anton - error or info?
- log.info(NULL_PARAMETER_ERROR_MESSAGE);
- }
- }
-
- msgIter = getMessageIterator(context, forClientId, msgComponent);
- ResponseWriter writer = context.getResponseWriter();
-
- if(!msgIter.hasNext() && isError){
- //TODO nick - anton - that part of code fully ignores marker location
+ if(forClientId != null && forClientId.length() != 0){
- //TODO nick - anton - check getFacet(...) for null, that wouldn't cause creation of facets map.
- // refer to JavaDoc for more
- if(msgComponent.getFacets().containsKey("passedMarker")){
-
- UIComponent facet = msgComponent.getFacet("passedMarker");
-
- String markerClass = (String) msgComponent.getAttributes().get("markerClass");
- String markerStyle = (String) msgComponent.getAttributes().get("markerStyle");
-
- //TODO nick - anton - huge attributes list
- renderMarkerFacet(msgComponent, facet, context, writer, markerClass, markerStyle);
- }
-
- //TODO nick - anton - store variable here and use it then
- if(msgComponent.getPassedLabel() != null){
-
- String passLabel = (String) msgComponent.getPassedLabel();
- String labelClass = (String) msgComponent.getAttributes().get("labelClass");
- String labelStyle = (String) msgComponent.getAttributes().get("labelStyle");
-
- //TODO nick - anton - huge attributes list
- renderLabel(msgComponent, null, context, writer, labelClass,
- labelStyle, false, false, false,passLabel,true);
+ UIComponent result = findForComponent(context, forClientId,component);
+ if (result == null) {
+ msgIter = CollectionUtils.EMPTY_COLLECTION.iterator();
+ } else {
+ msgIter = context.getMessages(result.getClientId(context));
}
-
- }else if(msgIter.hasNext() ){
-
- FacesMessage message = (FacesMessage)msgIter.next();
- encodingUIContent(msgComponent, context, message);
- isError = true;
- }
-
- doEncodeEnd(writer, context, msgComponent);
-
- //TODO nick - anton - too late to add component to re-rendering
- if(isError){
-
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- Set ajaxRenderedAreas = ajaxContext.getAjaxRenderedAreas();
-
- if(null != ajaxRenderedAreas) {
- ajaxRenderedAreas.add(clientId);
- }
- }
- }
-
-
- protected void encodingUIContent(UIRichMessage uiMsg, FacesContext context, FacesMessage facesMsg) throws IOException{
-
- boolean showSummary = uiMsg.isShowSummary();
-
- boolean showDetail = uiMsg.isShowDetail();
-
- //TODO nick - anton - use getUtils().isBooleanAttribute(component, name)
- // why not make it boolean?
- Object tooltip = uiMsg.getAttributes().get("tooltip");
- boolean isTooltip = false;
- if(tooltip instanceof Boolean){
- isTooltip = ((Boolean)tooltip).booleanValue();
- }
-
- String tableClass = null;
- String tableStyle = null;
-
- String markerClass = null;
- String markerStyle = null;
-
- String labelClass = null;
- String labelStyle = null;
-
- UIComponent markerFacet = null;
-
-
- if(facesMsg.getSeverity() == FacesMessage.SEVERITY_ERROR){
-
- tableClass = (String)uiMsg.getAttributes().get("errorClass");
- tableStyle = (String)uiMsg.getAttributes().get("errorStyle");
-
- markerClass = (String)uiMsg.getAttributes().get("errorMarkerClass");
- markerStyle = (String)uiMsg.getAttributes().get("errorMarkerStyle");
-
- labelClass = (String)uiMsg.getAttributes().get("errorLabelClass");
- labelStyle = (String)uiMsg.getAttributes().get("errorLabelStyle");
-
- markerFacet = uiMsg.getFacet("errorMarker");
-
- }else if(facesMsg.getSeverity() == FacesMessage.SEVERITY_FATAL){
-
- tableClass = (String)uiMsg.getAttributes().get("fatalClass");
- tableStyle = (String)uiMsg.getAttributes().get("fatalStyle");
-
- markerClass = (String)uiMsg.getAttributes().get("fatalMarkerClass");
- markerStyle = (String)uiMsg.getAttributes().get("fatalMarkerStyle");
-
- labelClass = (String)uiMsg.getAttributes().get("fatalLabelClass");
- labelStyle = (String)uiMsg.getAttributes().get("fatalLabelStyle");
-
- markerFacet = uiMsg.getFacet("fatalMarker");
-
- }else if(facesMsg.getSeverity() == FacesMessage.SEVERITY_WARN){
-
- tableClass = (String)uiMsg.getAttributes().get("warnClass");
- tableStyle = (String)uiMsg.getAttributes().get("warnStyle");
-
- markerClass = (String)uiMsg.getAttributes().get("warnMarkerClass");
- markerStyle = (String)uiMsg.getAttributes().get("warnMarkerStyle");
-
- labelClass = (String)uiMsg.getAttributes().get("warnLabelClass");
- labelStyle = (String)uiMsg.getAttributes().get("warnLabelStyle");
-
- markerFacet = uiMsg.getFacet("warnMarker");
-
- }else if(facesMsg.getSeverity() == FacesMessage.SEVERITY_INFO){
-
- tableClass = (String)uiMsg.getAttributes().get("infoClass");
- tableStyle = (String)uiMsg.getAttributes().get("infoStyle");
-
- markerClass = (String)uiMsg.getAttributes().get("infoMarkerClass");
- markerStyle = (String)uiMsg.getAttributes().get("infoMarkerStyle");
-
- labelClass = (String)uiMsg.getAttributes().get("infoLabelClass");
- labelStyle = (String)uiMsg.getAttributes().get("infoLabelStyle");
-
- markerFacet = uiMsg.getFacet("infoMarker");
- }
-
- String markerLocation = uiMsg.getMarkerLocation();
- markerLocation = markerLocation.toLowerCase();
-
- ResponseWriter writer = context.getResponseWriter();
-
- messageTemplate = getMessageTemplate();
-
- ComponentVariables variables = ComponentsVariableResolver.getVariables(messageTemplate, uiMsg);
- variables.setVariable("tableClass", tableClass);
- variables.setVariable("tableStyle", tableStyle);
-
- if(markerLocation.equals(uiMsg.MARKER_LOCATION_LEFT)){
- renderMarkerFacet(uiMsg,markerFacet,context, writer, markerClass, markerStyle);
- renderLabel(uiMsg, facesMsg, context, writer, labelClass,
- labelStyle, isTooltip, showDetail,showSummary,null,false);
- }else if(markerLocation.equals(uiMsg.MARKER_LOCATION_RIGHT)){
- renderLabel(uiMsg, facesMsg, context, writer, labelClass,
- labelStyle, isTooltip, showDetail, showSummary,null,false);
- renderMarkerFacet(uiMsg,markerFacet,context, writer, markerClass, markerStyle);
- }
- }
-
- protected void renderMarkerFacet(UIRichMessage uiMsg, UIComponent marker, FacesContext context, ResponseWriter writer, String markerClass, String markerStyle) throws IOException{
-
- //TODO nick - anton - check if marker is rendered
- if(marker == null){
- return;
- }
-
- //TODO nick - anton - default message element is rendered as span. Consider revising FuncSpec-RF-M-NFR-010-1.0 layout
- writer.startElement(HTML.td_ELEM, uiMsg);
-
- String classes = markerClass == null ? "rich-message-marker" : "rich-message-marker " + markerClass;
-
- getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, classes);
- getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, markerStyle);
-
- renderChild(context, marker);
-
- writer.endElement(HTML.td_ELEM);
-
- }
-
- protected void renderLabel(UIRichMessage uiMsg, FacesMessage msg, FacesContext context,
- ResponseWriter writer, String labelClass, String labelStyle,
- boolean isTooltip, boolean showDetail, boolean showSummary,
- String passLabel, boolean isPassLabel) throws IOException{
-
- String summary = null;
-
- String detail = null;
-
- if(msg != null){
- summary = (null != (summary = msg.getSummary())) ? summary : "";
- detail = (null != (detail = msg.getDetail())) ? detail : "";
- }
-
- String classes = labelClass == null ? "rich-message-label" : "rich-message-label " + labelClass;
-
- writer.startElement(HTML.td_ELEM, uiMsg);
- writer.startElement(HTML.SPAN_ELEM, uiMsg);
-
- getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE,classes);
- getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, labelStyle);
-
- if(isTooltip){
- getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, summary);
- }
-
- if(showDetail){
- writer.writeText(detail, null);
- writer.writeText("\t", null);
- }
-
- if(showSummary){
- writer.writeText(summary, null);
- writer.writeText("\t", null);
- }
-
- if(isPassLabel){
- writer.writeText(passLabel, null);
- writer.writeText("\t", null);
- }
-
- writer.endElement(HTML.SPAN_ELEM);
- writer.endElement(HTML.td_ELEM);
-
- }
-
- protected Iterator getMessageIterator(FacesContext context, String forClientId, UIComponent component){
-
- Iterator msgIter = null;
-
- if(forClientId != null){
-
- if(forClientId.length() == 0){
- msgIter = context.getMessages(null);
- }else{
- UIComponent result = findForComponent(context, forClientId,component);
- if (result == null) {
- //TODO nick - anton consider using CollectionUtils.EMPTY_COLLECTION.iterator()
- msgIter = Collections.EMPTY_LIST.iterator();
- } else {
- msgIter = context.getMessages(result.getClientId(context));
- }
- }
}else{
- //TODO nick - anton - no need for global messages
+ msgIter = context.getMessages(null);
msgIter = context.getMessages();
}
return msgIter;
}
- //TODO nick - anton - candidate for utility method
- protected UIComponent findForComponent(FacesContext context, String forClientId, UIComponent component){
+ protected UIComponent findForComponent(FacesContext context, String forClientId, UIComponent component) throws IOException{
if(null == forClientId || forClientId.length() == 0){
return null;
@@ -332,25 +52,19 @@
UIComponent result = null;
UIComponent parent = component;
- try{
- while(parent != null){
- result = parent.findComponent(forClientId);
-
- if(result != null){
- break;
- }
- parent = parent.getParent();
- }
-
- if(result == null){
- result = findComponentBelow(context.getViewRoot(), forClientId);
+ while(parent != null){
+ result = parent.findComponent(forClientId);
+
+ if(result != null){
+ break;
}
-
- } catch(Throwable t){
- //TODO nick - anton - do not catch Throwables!!! you can catch OutOfMemoryError and swallow it here
- throw new RuntimeException(COMPONENT_NOT_FOUND_IN_VIEW_WARN_MESSAGE + ":"+ forClientId);
+ parent = parent.getParent();
+ }
+
+ if(result == null){
+ result = findComponentBelow(context.getViewRoot(), forClientId);
}
-
+
if(result == null){
if(log.isWarnEnabled()){
log.warn(COMPONENT_NOT_FOUND_IN_VIEW_WARN_MESSAGE + ":"+ forClientId);
@@ -363,7 +77,11 @@
protected UIComponent findComponentBelow(UIComponent startComponent, String forClientId){
UIComponent retComp = null;
- //TODO nick - anton - better check if getChildCount() == 0 first
+
+ if(startComponent.getChildCount() == 0){
+ return null;
+ }
+
List children = startComponent.getChildren();
for(int i = 0, size = children.size(); i < size; i++){
@@ -386,29 +104,9 @@
return retComp;
};
- private RendererBase getMessageTemplate(){
- //TODO nick - anton - really so no need for external template renderer
- //TODO nick - anton - such code blocks should be somehow synchronized
- if (messageTemplate == null) {
- try {
-
- messageTemplate = (RendererBase)Class.forName("org.richfaces.renderkit.html.RichMessageRenderer").newInstance();
+ protected Class getComponentClass() {
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- }
-
- return messageTemplate;
+ return UIMessage.class;
}
-
- protected Class getComponentClass(){
- //TODO nick - anton - return UIMessage.class here
- return getClass();
- }
+
}
-
\ No newline at end of file
Added: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java (rev 0)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-23 14:21:15 UTC (rev 1786)
@@ -0,0 +1,333 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.resource.InternetResource;
+import org.richfaces.component.UIRichMessage;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class RichMessageHtmlBaseRenderer extends RichMessageBaseRenderer{
+
+ private final InternetResource[] styles = {getResource("/org/richfaces/renderkit/html/css/msg.css")};
+
+ private InternetResource[] stylesAll = null;
+
+
+ protected InternetResource[] getStyles() {
+ synchronized (this) {
+ if (stylesAll == null) {
+ InternetResource[] rsrcs = super.getStyles();
+ boolean ignoreSuper = rsrcs == null || rsrcs.length == 0;
+ boolean ignoreThis = styles == null || styles.length == 0;
+
+ if (ignoreSuper) {
+ if (ignoreThis) {
+ stylesAll = new InternetResource[0];
+ } else {
+ stylesAll = styles;
+ }
+ } else {
+ if (ignoreThis) {
+ stylesAll = rsrcs;
+ } else {
+ java.util.Set rsrcsSet = new java.util.LinkedHashSet();
+
+ for (int i = 0; i < rsrcs.length; i++ ) {
+ rsrcsSet.add(rsrcs[i]);
+ }
+
+ for (int i = 0; i < styles.length; i++ ) {
+ rsrcsSet.add(styles[i]);
+ }
+
+ stylesAll = (InternetResource[]) rsrcsSet.toArray(new InternetResource[rsrcsSet.size()]);
+ }
+ }
+ }
+ }
+
+ return stylesAll;
+ }
+
+ public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+
+ Iterator msgIter = null;
+
+ if(component == null || context == null){
+ throw new NullPointerException(NULL_PARAMETER_ERROR_MESSAGE);
+ }
+
+ if(log.isTraceEnabled()){
+ log.trace("begin encoding component: " + component.getId());
+ }
+
+ if (!component.isRendered()){
+
+ if(log.isTraceEnabled()){
+ log.trace("stop encoding component: "
+ + component.getId() + " 'rendered' attribute is set to false");
+ }
+
+ return;
+ }
+
+ UIRichMessage msgComponent = (UIRichMessage)component;
+ String forClientId = msgComponent.getFor();
+
+ if(forClientId == null){
+
+ if(log.isInfoEnabled()){
+ log.info(NULL_PARAMETER_ERROR_MESSAGE);
+ }
+
+ }else{
+
+ msgIter = getMessageIterator(context, forClientId, msgComponent);
+ ResponseWriter writer = context.getResponseWriter();
+
+ if(!msgIter.hasNext() && msgComponent.isError()){
+
+ encodingUIContent(msgComponent, context, null);
+
+ }else if(msgIter.hasNext() ){
+
+ FacesMessage message = (FacesMessage)msgIter.next();
+ encodingUIContent(msgComponent, context, message);
+
+ }
+
+ doEncodeEnd(writer, context, msgComponent);
+
+ }
+ }
+
+ protected void encodingUIContent(UIRichMessage uiMsg, FacesContext context, FacesMessage facesMsg) throws IOException{
+
+ String markerLocation = uiMsg.getMarkerLocation();
+ markerLocation = markerLocation.toLowerCase();
+
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement(HTML.SPAN_ELEM, uiMsg);
+ getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMsg.getClientId(context));
+
+ if(markerLocation.equals(uiMsg.MARKER_LOCATION_LEFT)){
+
+ renderMarkerFacet(uiMsg,context, writer,facesMsg);
+ renderLabel(uiMsg, context, writer, facesMsg);
+
+ }else if(markerLocation.equals(uiMsg.MARKER_LOCATION_RIGHT)){
+
+ renderLabel(uiMsg, context, writer, facesMsg);
+ renderMarkerFacet(uiMsg,context, writer,facesMsg);
+
+ }
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+
+ protected void renderMarkerFacet(UIRichMessage uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
+
+ UIComponent marker = null;
+
+ String markerClass = null;
+
+ String markerStyle = null;
+
+ Severity severity = null;
+
+
+ if(facesMsg != null){
+
+ severity = facesMsg.getSeverity();
+
+ if(severity == FacesMessage.SEVERITY_ERROR){
+
+ markerClass = (String)uiMsg.getAttributes().get("errorMarkerClass");
+ markerStyle = (String)uiMsg.getAttributes().get("errorMarkerStyle");
+ marker = uiMsg.getFacet("errorMarker");
+
+ }else if (severity == FacesMessage.SEVERITY_FATAL) {
+
+ markerClass = (String)uiMsg.getAttributes().get("fatalMarkerClass");
+ markerStyle = (String)uiMsg.getAttributes().get("fatalMarkerStyle");
+ marker = uiMsg.getFacet("fatalMarker");
+
+ }else if (severity == FacesMessage.SEVERITY_INFO) {
+
+ markerClass = (String)uiMsg.getAttributes().get("infoMarkerClass");
+ markerStyle = (String)uiMsg.getAttributes().get("infoMarkerStyle");
+ marker = uiMsg.getFacet("infoMarker");
+
+ }else if (severity == FacesMessage.SEVERITY_WARN) {
+
+ markerClass = (String)uiMsg.getAttributes().get("warnMarkerClass");
+ markerStyle = (String)uiMsg.getAttributes().get("warnMarkerStyle");
+ marker = uiMsg.getFacet("infoMarker");
+
+ }
+
+ }else if(uiMsg.getFacet("passedMarker") != null){
+
+ marker = uiMsg.getFacet("passedMarker");
+ markerClass = (String) uiMsg.getAttributes().get("markerClass");
+ markerStyle = (String) uiMsg.getAttributes().get("markerStyle");
+
+ }
+
+ if(marker == null){
+ return;
+ }
+
+ if(!marker.isRendered()){
+ return;
+ }
+
+ writer.startElement(HTML.SPAN_ELEM, uiMsg);
+
+ String classes = markerClass == null ? "rich-message-marker" : "rich-message-marker " + markerClass;
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, classes);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, markerStyle);
+
+ renderChild(context, marker);
+
+ writer.endElement(HTML.SPAN_ELEM);
+
+ }
+
+ protected void renderLabel(UIRichMessage uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
+
+ String summary = null;
+
+ String detail = null;
+
+ String labelClass = null;
+
+ String labelStyle = null;
+
+ String outerClass = null;
+
+ String outerStyle = null;
+
+ String passLabel = null;
+
+ Severity severity = null;
+
+ boolean isTooltip = getUtils().isBooleanAttribute(uiMsg, "tooltip");
+
+ boolean showSummary = uiMsg.isShowSummary();
+
+ boolean showDetail = uiMsg.isShowDetail();
+
+ boolean isPassLabel = false;
+
+ if(facesMsg != null){
+
+ severity = facesMsg.getSeverity();
+
+
+ if(severity == FacesMessage.SEVERITY_ERROR){
+
+ outerClass = (String)uiMsg.getAttributes().get("errorClass");
+ outerStyle = (String)uiMsg.getAttributes().get("errorStyle");
+
+ labelClass = (String)uiMsg.getAttributes().get("errorLabelClass");
+ labelStyle = (String)uiMsg.getAttributes().get("errorLabelStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_FATAL){
+
+ outerClass = (String)uiMsg.getAttributes().get("fatalClass");
+ outerStyle = (String)uiMsg.getAttributes().get("fatalStyle");
+
+ labelClass = (String)uiMsg.getAttributes().get("fatalLabelClass");
+ labelStyle = (String)uiMsg.getAttributes().get("fatalLabelStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_WARN){
+
+ outerClass = (String)uiMsg.getAttributes().get("warnClass");
+ outerStyle = (String)uiMsg.getAttributes().get("warnStyle");
+
+ labelClass = (String)uiMsg.getAttributes().get("warnLabelClass");
+ labelStyle = (String)uiMsg.getAttributes().get("warnLabelStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_INFO){
+
+ outerClass = (String)uiMsg.getAttributes().get("infoClass");
+ outerStyle = (String)uiMsg.getAttributes().get("infoStyle");
+
+ labelClass = (String)uiMsg.getAttributes().get("infoLabelClass");
+ labelStyle = (String)uiMsg.getAttributes().get("infoLabelStyle");
+
+ }
+
+ }else if(uiMsg.getPassedLabel() != null){
+
+ passLabel = (String) uiMsg.getPassedLabel();
+ labelClass = (String) uiMsg.getAttributes().get("labelClass");
+ labelStyle = (String) uiMsg.getAttributes().get("labelStyle");
+ isPassLabel = true;
+
+ }
+
+ if(facesMsg != null){
+ summary = (null != (summary = facesMsg.getSummary())) ? summary : "";
+ detail = (null != (detail = facesMsg.getDetail())) ? detail : "";
+ }
+
+
+ String parentStyle = (String)uiMsg.getAttributes().get("style");
+ String parentClass = (String)uiMsg.getAttributes().get("styleClass");
+
+ String richMessageClass = "rich-message" + (null != outerClass ? (outerClass + " ") : "");
+ String richMessageStyle = (null != outerStyle ? outerClass + " ," : "");
+
+ parentStyle = parentStyle != null ? (richMessageStyle + parentStyle) : parentStyle;
+ parentClass = parentClass != null ? (richMessageClass + parentClass) : parentClass;
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, parentClass);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, parentStyle);
+
+ String classes = labelClass == null ? "rich-message-label" : "rich-message-label " + labelClass;
+
+ writer.startElement(HTML.SPAN_ELEM, uiMsg);
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE,classes);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, labelStyle);
+
+ if(facesMsg != null){
+ if(isTooltip){
+ getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, summary);
+ }
+
+ if(showDetail){
+ writer.writeText(detail, null);
+ writer.writeText("\t", null);
+ }
+
+ if(showSummary){
+ writer.writeText(summary, null);
+ writer.writeText("\t", null);
+ }
+ }else {
+ if(isPassLabel){
+ writer.writeText(passLabel, null);
+ writer.writeText("\t", null);
+ }
+ }
+
+ writer.endElement(HTML.SPAN_ELEM);
+
+ }
+}
+
\ No newline at end of file
Modified: trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msg.css
===================================================================
--- trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msg.css 2007-07-23 14:20:09 UTC (rev 1785)
+++ trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msg.css 2007-07-23 14:21:15 UTC (rev 1786)
@@ -6,3 +6,9 @@
.rich-message-label{
}
+
+.rich-message-marker *{
+ vertical-align: middle;
+}
+
+
17 years, 5 months