JBoss Rich Faces SVN: r1847 - trunk/sandbox/ui/message/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-25 10:31:16 -0400 (Wed, 25 Jul 2007)
New Revision: 1847
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
Log:
move isPassed to decode 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-25 14:24:35 UTC (rev 1846)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-25 14:31:16 UTC (rev 1847)
@@ -32,8 +32,8 @@
}
}
- public void restoreState(FacesContext context, Object state) {
+ public void decode(FacesContext context) {
isPassed = true;
- super.restoreState(context, state);
+ super.decode(context);
}
}
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1846 - in trunk/sandbox: ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-25 10:24:35 -0400 (Wed, 25 Jul 2007)
New Revision: 1846
Modified:
trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
Modified: trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-07-25 14:18:13 UTC (rev 1845)
+++ trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-07-25 14:24:35 UTC (rev 1846)
@@ -42,12 +42,12 @@
<f:validator validatorId="org.richfaces.CalendarValidator" />
<h:panelGrid columns="2">
- <f:verbatim><p style="padding: 10px;" class="largeText">{day}</p></f:verbatim>
- <h:panelGrid>
+ <f:verbatim><p style="padding: 2px;" <%-- class="largeText"--%>>{day}</p></f:verbatim>
+ <%-- h:panelGrid>
<h:outputText styleClass="smallText" value="{data.enLabel}" />
<h:outputText styleClass="smallText" value="{data.frLabel}" />
<h:outputText styleClass="smallText" value="{data.deLabel}" />
- </h:panelGrid>
+ </h:panelGrid--%>
</h:panelGrid>
</calendar:calendar>
Modified: trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-25 14:18:13 UTC (rev 1845)
+++ trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-25 14:24:35 UTC (rev 1846)
@@ -6,36 +6,106 @@
Richfaces.Calendar={};
Richfaces.Calendar.setElementPosition = function(element, baseElement, jointPoint, direction, offset)
{
+ // parameters:
+ // jointPoint: {x:,y:} or ('left-top','right-top','left-bottom','right-bottom')
+ // direction: ('left-top','right-top','left-bottom','right-bottom', 'auto')
+
var elementDim = {width: element.getWidth(), height: element.getHeight()};
var baseElementDim = {width: baseElement.getWidth(), height: baseElement.getHeight()};
- var windowDim = Richfaces.Calendar.getWindowDimensions();
- var windowOffset = Richfaces.Calendar.getWindowScrollOffset();
+ var windowRect = Richfaces.Calendar.getWindowViewport();
var baseOffset = Position.cumulativeOffset(baseElement);
- // jointPoint Correction
- var ox=0;
- var oy=0;
- if (jointPoint)
+ // jointPoint
+ var ox=baseOffset[0];
+ var oy=baseOffset[1];
+ var re = /^(top|bottom)-(left|right)$/;
+ var match;
+
+ if (typeof jointPoint=='object') {ox = jointPoint.x; oy=jointPoint.y}
+ else if ( jointPoint && (match=jointPoint.toLowerCase().match(re)) )
{
- var jp = jointPoint.toLowerCase().split('-');
- if (jp[0]=='bottom') oy=baseElementDim.height;
- if (jp[1]=='right') ox=baseElementDim.width;
+ if (match[2]=='right') ox+=baseElementDim.width;
+ if (match[1]=='bottom') oy+=baseElementDim.height;
+ } else
+ {
+ // ??? auto
}
- // direction Correction
- if (direction)
+ // direction
+ if (direction && (match=direction.toLowerCase().match(re)) )
{
var d = direction.toLowerCase().split('-');
- if (d[0]=='top') oy-=elementDim.height;
- if (d[1]=='left') ox-=elementDim.width;
- }
+ if (match[2]=='left') ox-=elementDim.width;
+ if (match[1]=='top') oy-=elementDim.height;
+ } else
+ {
+ // auto
+ var theBest = {square:0};
+ // jointPoint: right-bottom, direction: left-bottom
+ var rect = {right: baseOffset[0] + baseElementDim.width, top: baseOffset[1] + baseElementDim.height};
+ rect.left = rect.right - elementDim.width;
+ rect.bottom = rect.top + elementDim.height;
+ ox = rect.left; oy = rect.top;
+ var s = Richfaces.Calendar.checkCollision(rect, windowRect);
+ if (s!=0)
+ {
+ if (ox>=0 && oy>=0 && theBest.square<s) theBest = {x:ox, y:oy, square:s};
+ // jointPoint: right-top, direction: left-top
+ rect = {right: baseOffset[0] + baseElementDim.width, bottom: baseOffset[1]};
+ rect.left = rect.right - elementDim.width;
+ rect.top = rect.bottom - elementDim.height;
+ ox = rect.left; oy = rect.top;
+ s = Richfaces.Calendar.checkCollision(rect, windowRect);
+ if (s!=0)
+ {
+ if (ox>=0 && oy>=0 && theBest.square<s) theBest = {x:ox, y:oy, square:s};
+ // jointPoint: left-bottom, direction: right-bottom
+ rect = {left: baseOffset[0], top: baseOffset[1] + baseElementDim.height};
+ rect.right = rect.left + elementDim.width;
+ rect.bottom = rect.top + elementDim.height;
+ ox = rect.left; oy = rect.top;
+ s = Richfaces.Calendar.checkCollision(rect, windowRect);
+ if (s!=0)
+ {
+ if (ox>=0 && oy>=0 && theBest.square<s) theBest = {x:ox, y:oy, square:s};
+ // jointPoint: left-top, direction: right-top
+ rect = {left: baseOffset[0], bottom: baseOffset[1]};
+ rect.right = rect.left + elementDim.width;
+ rect.top = rect.bottom - elementDim.height;
+ ox = rect.left; oy = rect.top;
+ s = Richfaces.Calendar.checkCollision(rect, windowRect);
+ if (s!=0)
+ {
+ // the best way selection
+ if (ox<0 || oy<0 || theBest.square>s) {ox=theBest.x; oy=theBest.y}
+ }
+ }
+ }
+
+ }
+ }
- element.style.left = baseOffset[0] + ox + 'px';
- element.style.top = baseOffset[1] + oy + 'px';
+ element.style.left = ox + 'px';
+ element.style.top = oy + 'px';
+}
+
+Richfaces.Calendar.checkCollision = function(elementRect, windowRect, windowOffset)
+{
+ if (elementRect.left >= windowRect.left &&
+ elementRect.top >= windowRect.top &&
+ elementRect.right <= windowRect.right &&
+ elementRect.bottom <= windowRect.bottom)
+ return 0;
+ var rect = {left: (elementRect.left>windowRect.left ? elementRect.left : windowRect.left),
+ top: (elementRect.top>windowRect.top ? elementRect.top : windowRect.top),
+ right: (elementRect.right<windowRect.right ? elementRect.right : windowRect.right),
+ bottom: (elementRect.bottom<windowRect.bottom ? elementRect.bottom : windowRect.bottom)};
+ return (rect.right-rect.left)* (rect.bottom-rect.top);
}
+
Richfaces.Calendar.getWindowDimensions = function() {
var w = self.innerWidth
|| document.documentElement.clientWidth
@@ -60,6 +130,12 @@
return {left:dx, top: dy};
}
+Richfaces.Calendar.getWindowViewport = function() {
+ var windowDim = Richfaces.Calendar.getWindowDimensions();
+ var windowOffset = Richfaces.Calendar.getWindowScrollOffset();
+ return {left:windowOffset.left, top:windowOffset.top, right: windowDim.width+windowOffset.left, bottom: windowDim.height+windowOffset.top};
+}
+
/*Richfaces.Calendar.getPageDimensions = function() {
var x,y;
var test1 = document.body.scrollHeight;
@@ -257,8 +333,8 @@
this.daysData = {startDate:null, days:[]};
this.days = [];
- var htmlTextHeader = '<input id="'+this.id+'InputSelectedDate" name="'+this.id+'InputSelectedDate" type="hidden" value="'+this.getSelectedDateString(this.params.datePattern)+'"/>\n' +
- '<input id="'+this.id+'InputCurrentDate" name="'+this.id+'InputCurrentDate" type="hidden" value="'+this.getCurrentDate().format("MM/y")+'"/>\n' +
+ var htmlTextHeader = '<input id="'+this.id+'InputSelectedDate" name="'+this.id+'InputSelectedDate" type="hidden" style="display:none" value="'+this.getSelectedDateString(this.params.datePattern)+'"/>\n' +
+ '<input id="'+this.id+'InputCurrentDate" name="'+this.id+'InputCurrentDate" type="hidden" style="display:none" value="'+this.getCurrentDate().format("MM/y")+'"/>\n' +
'<table border="0" cellpadding="0" cellspacing="0" class="calendar_exterior"><tbody>\n';
var colspan = (this.params.showWeeksBar ? "8" : "7");
var htmlHeaderOptional = (this.params.headerOptionalMarkup) ? '<tr><td class="calendar_header" colspan="'+colspan+'" id="'+this.id+'HeaderOptional"></td></tr>' : '';
@@ -276,8 +352,8 @@
{
e.style.display='none';
e.style.position = 'absolute';
- e.style.left="0px";
- e.style.top="0px";
+ //e.style.left="0px";
+ //e.style.top="0px";
this.isVisible = false;
}
}
@@ -353,7 +429,7 @@
var base = $(this.POPUP_ID);
var e = $(this.id);
- Richfaces.Calendar.setElementPosition(e, base, this.params.jointPoint, this.params.direction);
+ Richfaces.Calendar.setElementPosition(e, base, this.params.jointPoint, "");//this.params.direction);
Element.show(this.id);
this.isVisible = true;
17 years, 5 months
JBoss Rich Faces SVN: r1845 - in trunk/ui/tooltip/src/main: java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-25 10:18:13 -0400 (Wed, 25 Jul 2007)
New Revision: 1845
Modified:
trunk/ui/tooltip/src/main/config/component/toolTip.xml
trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx
Log:
zorder implementation
Modified: trunk/ui/tooltip/src/main/config/component/toolTip.xml
===================================================================
--- trunk/ui/tooltip/src/main/config/component/toolTip.xml 2007-07-25 14:12:08 UTC (rev 1844)
+++ trunk/ui/tooltip/src/main/config/component/toolTip.xml 2007-07-25 14:18:13 UTC (rev 1845)
@@ -48,6 +48,12 @@
<defaultvalue><![CDATA[0]]></defaultvalue>
</property>
<property>
+ <name>zorder</name>
+ <classname>int</classname>
+ <description>The same as CSS z-index for toolTip.</description>
+ <defaultvalue><![CDATA[99]]></defaultvalue>
+ </property>
+ <property>
<name>oncomplete</name>
<classname>java.lang.String</classname>
<description></description>
Modified: trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
===================================================================
--- trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java 2007-07-25 14:12:08 UTC (rev 1844)
+++ trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java 2007-07-25 14:18:13 UTC (rev 1845)
@@ -96,6 +96,10 @@
public abstract int getDelay();
public abstract void setDelay(int delay);
+
+ public abstract int getZorder();
+
+ public abstract void setZorder(int delay);
public String getUsedElementType(){
Modified: trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
--- trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-25 14:12:08 UTC (rev 1844)
+++ trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-25 14:18:13 UTC (rev 1845)
@@ -22,7 +22,7 @@
</h:scripts-->
<f:clientid var="clientId"/>
- <span id="#{clientId}" style="position: absolute; display : none;z-index:99; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
+ <span id="#{clientId}" style="position: absolute; display : none;z-index:#{component.attributes['zorder']}; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
<f:call name="utils.encodePassThru" />
<span id="#{clientId}defaultContent" style="display:none">
<u:insertFacet name="defaultContent" />
Modified: trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx
===================================================================
--- trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx 2007-07-25 14:12:08 UTC (rev 1844)
+++ trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx 2007-07-25 14:18:13 UTC (rev 1845)
@@ -22,7 +22,7 @@
</h:scripts-->
<f:clientid var="clientId"/>
- <div id="#{clientId}" style="position: absolute; display : none;z-index:99; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
+ <div id="#{clientId}" style="position: absolute; display : none;z-index:#{component.attributes['zorder']}; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
<f:call name="utils.encodePassThru" />
<div id="#{clientId}defaultContent" style="display:none">
<u:insertFacet name="defaultContent" />
17 years, 5 months
JBoss Rich Faces SVN: r1844 - trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-25 10:12:08 -0400 (Wed, 25 Jul 2007)
New Revision: 1844
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/RichMessagesHtmlBaseRenderer.java
Log:
fix first rendering
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-25 14:05:40 UTC (rev 1843)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-25 14:12:08 UTC (rev 1844)
@@ -82,7 +82,9 @@
}else{
msgIter = getMessageIterator(context, forClientId, msgComponent);
-
+ writer.startElement(HTML.SPAN_ELEM, msgComponent);
+ getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, msgComponent.getClientId(context));
+
if(!msgIter.hasNext() && msgComponent.isPassed()){
encodingUIContent(msgComponent, context, null);
@@ -93,6 +95,8 @@
encodingUIContent(msgComponent, context, message);
}
+
+ writer.endElement(HTML.SPAN_ELEM);
}
}
@@ -100,14 +104,11 @@
ResponseWriter writer = context.getResponseWriter();
- writer.startElement(HTML.SPAN_ELEM, uiMsg);
- getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMsg.getClientId(context));
-
outerStyles(uiMsg, context, writer, facesMsg);
renderMarkerFacet(uiMsg,context, writer,facesMsg);
renderLabel(uiMsg, context, writer, facesMsg);
- writer.endElement(HTML.SPAN_ELEM);
+
}
public void renderOuterStyles(UIComponent component, FacesContext context, ResponseWriter writer,String outerStyle, String outerClass) throws IOException{
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java 2007-07-25 14:05:40 UTC (rev 1843)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java 2007-07-25 14:12:08 UTC (rev 1844)
@@ -114,11 +114,13 @@
throw e;
}
+ writer.startElement(HTML.SPAN_ELEM, component);
+ getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMessages.getClientId(context));
uiMessages.setIteratorLayout(true);
}else if((layout != null) && (layout.equals("list"))){
- writer.startElement("ul", component);
+ writer.startElement("dl", component);
getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMessages.getClientId(context));
renderComponentOuterStyles(uiMessages, context, writer);
@@ -133,7 +135,7 @@
if(uiMessages.isWroteTable()){
writer.startElement(HTML.TR_ELEMENT, component);
}else{
- writer.startElement("li", component);
+ writer.startElement("dt", component);
}
outerStyles(component, context, writer, facesMsg);
@@ -143,24 +145,29 @@
if(uiMessages.isWroteTable()){
writer.endElement(HTML.TR_ELEMENT);
}else{
- writer.endElement("li");
+ writer.endElement("dt");
}
-
- if(uiMessages.isWroteTable()){
- writer.endElement("tbody");
- writer.endElement("table");
- }else{
- writer.endElement("ul");
- }
-
+
}else{
Map requestMap = context.getExternalContext().getRequestMap();
requestMap.put(var, facesMsg);
-
+ renderChildren(context, uiMessages);
+
}
-
+
}
+
+ if(!uiMessages.isIteratorLayout()){
+ if(uiMessages.isWroteTable()){
+ writer.endElement("tbody");
+ writer.endElement("table");
+ }else{
+ writer.endElement("dl");
+ }
+ }else{
+ writer.endElement(HTML.SPAN_ELEM);
+ }
}
17 years, 5 months
JBoss Rich Faces SVN: r1843 - trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-25 10:05:40 -0400 (Wed, 25 Jul 2007)
New Revision: 1843
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
smart-positioning bugfix
Modified: trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
--- trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25 13:17:15 UTC (rev 1842)
+++ trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25 14:05:40 UTC (rev 1843)
@@ -181,124 +181,63 @@
toolTipX = x - offsets[0];
toolTipY = y - offsets[1];
- Element.setStyle(this.toolTip, {"left": toolTipX + "px", "top": toolTipY + "px"});
- //alert(this.toolTipW + 'x' + this.toolTipY);
-/*
- var p = Element.getStyle(this.toolTip.parentNode, 'position');
-
- if (p == 'relative'){
- toolTipX = cursorX - offsets[0];
- toolTipY = cursorY - offsets[1];
- //Element.setStyle(this.toolTip, {"left": - offsets[0] + cursorX + "px", "top": - offsets[1] + cursorY + "px"});
- } else {
- if(IE){
-
- var cumOffset = this.cumCumOffset(this.toolTip.parentNode);
- //Element.setStyle(this.toolTip, {"left": - cumOffset[0] + cursorX + "px", "top": - cumOffset[1] + cursorY + "px"});
- toolTipX = cursorX - cumOffset[0];
- toolTipY = cursorY - cumOffset[1];
-
-
- //Element.setStyle(this.toolTip, {"left": Event.pointerX(e) + "px", "top": Event.pointerY(e) + "px"});
- //Element.setStyle(this.toolTip, {"left": - offsets[0] + Event.pointerX(e) + "px", "top": - offsets[1] + Event.pointerY(e) + "px"});
- } else {
- toolTipX = cursorX;
- toolTipY = cursorY;
-
-// this.toolTip.style.top = cursorY;
-// this.toolTip.style.left = cursorX;
- }
- }
-*/
- //Element.setStyle(this.toolTip, {"left": toolTipX + "px", "top": toolTipY + "px"});
-
-//
- //Element.setStyle(this.toolTip, {"left": offsets[0] + "px", "top": offsets[1] + "px"});
-
-/*
- this.toolTip.style.top = cursorY;
- this.toolTip.style.left = cursorX;
-
- cursorX -= offsets[0];
- cursorY -= offsets[1];
-
- this.toolTip.style.top = cursorY;
- this.toolTip.style.left = cursorX;
-
-
- cursorX += this.parent.offsetLeft;
- cursorY += this.parent.offsetTop;
-
- this.toolTip.style.top = cursorY;
- this.toolTip.style.left = cursorX;
-*/
-
-
+ var windowDim = this.windowSize();
if(this.direction == "top-left"){
- toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
- toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
- /*
- if(cursorY - this.verticalOffset - this.toolTipH < 0){
- this.toolTip.style.top = cursorY + this.verticalOffset - this.toolTipH;
+
+ if(e.clientY - this.verticalOffset - this.toolTipH < 0){
+ toolTipY = toolTipY + this.verticalOffset;
} else {
- this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
}
- if(cursorX - this.horizontalOffset - this.toolTipW < 0){
- this.toolTip.style.left = cursorX + this.horizontalOffset;
+
+ if(e.clientX - this.horizontalOffset - this.toolTipW < 0){
+ toolTipX = toolTipX + this.horizontalOffset;
} else {
- this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
}
- */
+
} else if(this.direction == "bottom-left"){
- toolTipY = toolTipY + this.verticalOffset;
- toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
- /*
- if(cursorY + this.verticalOffset + this.toolTipH > windowDim[1]){
- this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+
+ if(e.clientY + this.verticalOffset + this.toolTipH > windowDim[1]){
+ toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
} else {
- this.toolTip.style.top = cursorY + this.verticalOffset;
+ toolTipY = toolTipY + this.verticalOffset;
}
- if(cursorX - this.horizontalOffset - this.toolTipW < 0){
- this.toolTip.style.left = cursorX + this.horizontalOffset ;
+
+ if(e.clientX - this.horizontalOffset - this.toolTipW < 0){
+ toolTipX = toolTipX + this.horizontalOffset;
} else {
- this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
}
- */
+
} else if(this.direction == "top-right"){
- toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
- toolTipX = toolTipX + this.horizontalOffset;
- /*
- if(cursorY - this.verticalOffset - this.toolTipH < 0){
- this.toolTip.style.top = cursorY + this.verticalOffset;
+
+ if(e.clientY - this.verticalOffset - this.toolTipH < 0){
+ toolTipY = toolTipY + this.verticalOffset;
} else {
- this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
}
- if(cursorX + this.horizontalOffset + this.toolTipW > windowDim[0]){
- this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ if(e.clientX + this.horizontalOffset + this.toolTipW > windowDim[0]){
+ toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
} else {
- this.toolTip.style.left = cursorX + this.horizontalOffset;
+ toolTipX = toolTipX + this.horizontalOffset;
}
- */
+
} else {
- // bottom-right is default
- toolTipY = toolTipY + this.verticalOffset;
- toolTipX = toolTipX + this.horizontalOffset;
- /*
- if(cursorY + this.verticalOffset - this.toolTip.clientHeight > windowDim[1]){
- this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+
+ if(e.clientY + this.verticalOffset + this.toolTipH > windowDim[1]){
+ toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
} else {
- this.toolTip.style.top = cursorY + this.verticalOffset;
+ toolTipY = toolTipY + this.verticalOffset;
}
- if(cursorX + this.horizontalOffset + this.toolTip.clientWidth > windowDim[0]){
- this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+
+ if(e.clientX + this.horizontalOffset + this.toolTipW > windowDim[0]){
+ toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
} else {
- this.toolTip.style.left = cursorX + this.horizontalOffset;
+ toolTipX = toolTipX + this.horizontalOffset;
}
- */
}
Element.setStyle(this.toolTip, {"left": toolTipX + "px", "top": toolTipY + "px"});
-
-
},
windowSize: function() {
@@ -331,17 +270,5 @@
eval(this.oncomplete);
}
}
- },
- cumCumOffset: function(element) {
- var valueT = 0, valueL = 0;
- do {
- var p = Element.getStyle(element, 'position');
- if (p == 'relative'){
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
- }
- element = element.offsetParent;
- } while (element);
- return [valueL, valueT];
- }
+ }
}
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1842 - trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-25 09:17:15 -0400 (Wed, 25 Jul 2007)
New Revision: 1842
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
Modified: trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
--- trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25 13:11:53 UTC (rev 1841)
+++ trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25 13:17:15 UTC (rev 1842)
@@ -169,7 +169,10 @@
var x = Event.pointerX(e);
var y = Event.pointerY(e);
-
+
+ var toolTipDim = Element.getDimensions(this.toolTip);
+ this.toolTipW = toolTipDim.width;
+ this.toolTipH = toolTipDim.height;
var offsets = Position.cumulativeOffset(this.toolTip);
offsets[0] -= this.toolTip.offsetLeft || 0;
@@ -177,6 +180,9 @@
toolTipX = x - offsets[0];
toolTipY = y - offsets[1];
+
+ Element.setStyle(this.toolTip, {"left": toolTipX + "px", "top": toolTipY + "px"});
+ //alert(this.toolTipW + 'x' + this.toolTipY);
/*
var p = Element.getStyle(this.toolTip.parentNode, 'position');
@@ -229,8 +235,8 @@
if(this.direction == "top-left"){
- this.toolTip.style.top = toolTipY - this.verticalOffset - this.toolTipH;
- this.toolTip.style.left = toolTipX - this.horizontalOffset - this.toolTipW;
+ toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
+ toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
/*
if(cursorY - this.verticalOffset - this.toolTipH < 0){
this.toolTip.style.top = cursorY + this.verticalOffset - this.toolTipH;
@@ -244,8 +250,8 @@
}
*/
} else if(this.direction == "bottom-left"){
- this.toolTip.style.top = toolTipY + this.verticalOffset;
- this.toolTip.style.left = toolTipX - this.horizontalOffset - this.toolTipW;
+ toolTipY = toolTipY + this.verticalOffset;
+ toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
/*
if(cursorY + this.verticalOffset + this.toolTipH > windowDim[1]){
this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
@@ -259,8 +265,8 @@
}
*/
} else if(this.direction == "top-right"){
- this.toolTip.style.top = toolTipY - this.verticalOffset - this.toolTipH;
- this.toolTip.style.left = toolTipX + this.horizontalOffset;
+ toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
+ toolTipX = toolTipX + this.horizontalOffset;
/*
if(cursorY - this.verticalOffset - this.toolTipH < 0){
this.toolTip.style.top = cursorY + this.verticalOffset;
@@ -275,8 +281,8 @@
*/
} else {
// bottom-right is default
- this.toolTip.style.top = toolTipY + this.verticalOffset;
- this.toolTip.style.left = toolTipX + this.horizontalOffset;
+ toolTipY = toolTipY + this.verticalOffset;
+ toolTipX = toolTipX + this.horizontalOffset;
/*
if(cursorY + this.verticalOffset - this.toolTip.clientHeight > windowDim[1]){
this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
@@ -290,7 +296,9 @@
}
*/
}
+ Element.setStyle(this.toolTip, {"left": toolTipX + "px", "top": toolTipY + "px"});
+
},
windowSize: function() {
17 years, 5 months
JBoss Rich Faces SVN: r1841 - trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-25 09:11:53 -0400 (Wed, 25 Jul 2007)
New Revision: 1841
Modified:
trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
Log:
Test Updated
Modified: trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
===================================================================
--- trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2007-07-25 13:02:23 UTC (rev 1840)
+++ trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2007-07-25 13:11:53 UTC (rev 1841)
@@ -36,6 +36,7 @@
static {
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/events.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/json/json-dom.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/calendar.js");
@@ -146,7 +147,7 @@
htmlCalendar.getAttributeValue("class");
HtmlElement htmlCalendarInput = page.getHtmlElementById(calendar.getClientId(facesContext)+"Input");
- HtmlElement htmlCalendarButton = page.getHtmlElementById(calendar.getClientId(facesContext)+"Button");
+ HtmlElement htmlCalendarButton = page.getHtmlElementById(calendar.getClientId(facesContext)+"PopupButton");
assertNotNull(htmlCalendarInput);
assertNotNull(htmlCalendarButton);
assertTrue(htmlCalendarInput.getAttributeValue("class").contains("org.richfaces.component.html.HtmlCalendar"));
17 years, 5 months
JBoss Rich Faces SVN: r1840 - in trunk: sandbox/ui/calendar and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-25 09:02:23 -0400 (Wed, 25 Jul 2007)
New Revision: 1840
Modified:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
trunk/sandbox/ui/calendar/pom.xml
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
Log:
Converter converter = SelectUtils.getConverterForProperty(context, input, "value")
replaced with
Converter converter = new DateTimeConverter();
Modified: trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
===================================================================
--- trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-07-25 12:43:47 UTC (rev 1839)
+++ trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-07-25 13:02:23 UTC (rev 1840)
@@ -64,7 +64,7 @@
data.put("frLabel", frFormatter.format(date));
data.put("deLabel", deFormatter.format(date));
item.setData(data);
-
+
return item;
}
@@ -72,6 +72,7 @@
* @see org.richfaces.component.CalendarDataModel#getToolTip(java.util.Date)
*/
public Object getToolTip(Date date) {
+
// TODO Auto-generated method stub
return null;
}
Modified: trunk/sandbox/ui/calendar/pom.xml
===================================================================
--- trunk/sandbox/ui/calendar/pom.xml 2007-07-25 12:43:47 UTC (rev 1839)
+++ trunk/sandbox/ui/calendar/pom.xml 2007-07-25 13:02:23 UTC (rev 1840)
@@ -49,5 +49,18 @@
<version>3.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>clover</id>
+<properties>
+<cloverLicense>c:\clover-richfaces.license</cloverLicense>
+<clover.license.path>c:\clover-richfaces.license</clover.license.path>
+<stagingDirectory>C:\eclipse\workspaces\workspaceVCP30\trunk\sandbox\ui\calendar</stagingDirectory>
+<releaseRepository>C:\temp\repo</releaseRepository>
+<snapshotRepository>C:\temp\snap</snapshotRepository>
+ <tomcatPath>/path/to/tomcat/instance</tomcatPath>
+ </properties>
+ </profile>
+ </profiles>
</project>
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-25 12:43:47 UTC (rev 1839)
+++ trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-25 13:02:23 UTC (rev 1840)
@@ -38,6 +38,7 @@
import javax.faces.component.UIInput;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.convert.DateTimeConverter;
import javax.faces.el.ValueBinding;
@@ -123,7 +124,12 @@
public Calendar getCalendar() {
return Calendar.getInstance(getTimeZone(), getLocale());
}
-
+ public Converter getDateConverter(){
+ DateTimeConverter datetime = new DateTimeConverter();
+ return datetime;
+
+ }
+
public Date getConvertedValue(FacesContext context, String currentDateString)
throws ConverterException {
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-25 12:43:47 UTC (rev 1839)
+++ trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-25 13:02:23 UTC (rev 1840)
@@ -219,7 +219,9 @@
String value = (String) input.getSubmittedValue();
if(value == null){
Object curVal = input.getValue();
- Converter converter = SelectUtils.getConverterForProperty(context, input, "value");
+ Converter converter = new DateTimeConverter();
+ // Converter converter = SelectUtils.getConverterForProperty(context, input, "value");
+
if(converter != null){
value = converter.getAsString(context, input, curVal);
} else {
Modified: trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
===================================================================
--- trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2007-07-25 12:43:47 UTC (rev 1839)
+++ trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2007-07-25 13:02:23 UTC (rev 1840)
@@ -203,7 +203,7 @@
public void testRender() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- System.out.println(page.asXml());
+ //System.out.println(page.asXml());
HtmlElement div = page.getHtmlElementById(scroller.getClientId(facesContext));
assertNotNull(div);
@@ -257,7 +257,7 @@
HtmlPage page = renderView();
assertNotNull(page);
- System.out.println(page.asXml());
+ //System.out.println(page.asXml());
try {
page.getHtmlElementById(scroller.getClientId(facesContext));
assertTrue(false);
17 years, 5 months
JBoss Rich Faces SVN: r1839 - 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-25 08:43:47 -0400 (Wed, 25 Jul 2007)
New Revision: 1839
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/component/UIRichMessages.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java
trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msgs.css
Log:
pre-final message and messages (without headerLocation attribute) components impl
Modified: trunk/sandbox/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-25 11:33:03 UTC (rev 1838)
+++ trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-25 12:43:47 UTC (rev 1839)
@@ -75,6 +75,7 @@
<property>
<name>tooltip</name>
<classname>boolean</classname>
+ <defaultvalue>false</defaultvalue>
</property>
<property>
@@ -232,12 +233,13 @@
<property>
<name>layout</name>
<classname>java.lang.String</classname>
- <defaultvalue>"List"</defaultvalue>
+ <defaultvalue>"list"</defaultvalue>
</property>
<property>
<name>headerLocation</name>
<classname>java.lang.String</classname>
+ <defaultvalue>"top"</defaultvalue>
</property>
<property>
@@ -266,6 +268,7 @@
<property>
<name>tooltip</name>
<classname>boolean</classname>
+ <defaultvalue>false</defaultvalue>
</property>
<property>
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-25 11:33:03 UTC (rev 1838)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-25 12:43:47 UTC (rev 1839)
@@ -12,8 +12,6 @@
*/
public abstract class UIRichMessage extends UIMessage implements AjaxOutput{
- private String passedLabel = "passed";
-
private boolean isPassed = false;
public boolean isPassed() {
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java 2007-07-25 11:33:03 UTC (rev 1838)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java 2007-07-25 12:43:47 UTC (rev 1839)
@@ -15,7 +15,9 @@
private boolean wroteTable = false;
+ private boolean isIteratorLayout = false;
+
public boolean isWroteTable() {
return wroteTable;
}
@@ -24,6 +26,14 @@
this.wroteTable = wroteTable;
}
+ public boolean isIteratorLayout() {
+ return isIteratorLayout;
+ }
+
+ public void setIteratorLayout(boolean isIteratorLayout) {
+ this.isIteratorLayout = isIteratorLayout;
+ }
+
/* (non-Javadoc)
* @see org.ajax4jsf.component.AjaxOutput#isAjaxRendered()
*/
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-25 11:33:03 UTC (rev 1838)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-25 12:43:47 UTC (rev 1839)
@@ -153,6 +153,44 @@
renderLabelHtml(component, context, writer, facesMsg, labelClass, labelStyle, passLabel);
}
+ protected void outerStyles(UIComponent component, 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)component.getAttributes().get("errorClass");
+ outerStyle = (String)component.getAttributes().get("errorStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_FATAL){
+
+ outerClass = (String)component.getAttributes().get("fatalClass");
+ outerStyle = (String)component.getAttributes().get("fatalStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_WARN){
+
+ outerClass = (String)component.getAttributes().get("warnClass");
+ outerStyle = (String)component.getAttributes().get("warnStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_INFO){
+
+ outerClass = (String)component.getAttributes().get("infoClass");
+ outerStyle = (String)component.getAttributes().get("infoStyle");
+ }
+ }
+
+ renderOuterStyles(component, context, writer, outerStyle, outerClass);
+
+ }
+
protected UIComponent findForComponent(FacesContext context, String forClientId, UIComponent component) throws IOException{
if(null == forClientId || forClientId.length() == 0){
@@ -219,4 +257,6 @@
public abstract void renderLabelHtml(UIComponent component, FacesContext context, ResponseWriter writer,
FacesMessage facesMsg, String labelClass, String labelStyle, String passLabel) throws IOException;
+
+ public abstract void renderOuterStyles(UIComponent component, FacesContext context, ResponseWriter writer, String outerStyle, String outerClass) throws IOException;
}
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-25 11:33:03 UTC (rev 1838)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-25 12:43:47 UTC (rev 1839)
@@ -5,7 +5,6 @@
import java.util.Set;
import javax.faces.application.FacesMessage;
-import javax.faces.application.FacesMessage.Severity;
import javax.faces.component.UIComponent;
import javax.faces.component.UIMessage;
import javax.faces.context.FacesContext;
@@ -104,64 +103,47 @@
writer.startElement(HTML.SPAN_ELEM, uiMsg);
getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMsg.getClientId(context));
- renderOuterStyle(uiMsg, context, writer, facesMsg);
+ outerStyles(uiMsg, context, writer, facesMsg);
renderMarkerFacet(uiMsg,context, writer,facesMsg);
renderLabel(uiMsg, context, writer, facesMsg);
writer.endElement(HTML.SPAN_ELEM);
}
- protected void renderOuterStyle(UIRichMessage uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
+ public void renderOuterStyles(UIComponent component, FacesContext context, ResponseWriter writer,String outerStyle, String outerClass) 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");
- }
+ UIRichMessage uiMsg = null;
+
+ if(!(component instanceof UIRichMessage)){
+ return;
}
-
+
+ uiMsg = (UIRichMessage)component;
+
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 + " ," : "");
+ String richMessageStyle = (null != outerStyle ? outerStyle + " ," : "");
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);
-
}
- public void renderMarkerHtml(UIComponent uiMsg,UIComponent marker, FacesContext context,
+ public void renderMarkerHtml(UIComponent component,UIComponent marker, FacesContext context,
ResponseWriter writer,String markerClass, String markerStyle) throws IOException{
+ UIRichMessage uiMsg = null;
+
+ if(!(component instanceof UIRichMessage)){
+ return;
+ }
+
+ uiMsg = (UIRichMessage)component;
+
writer.startElement(HTML.SPAN_ELEM, uiMsg);
String classes = markerClass == null ? "rich-message-marker" : "rich-message-marker " + markerClass;
@@ -184,8 +166,14 @@
String title = null;
- UIRichMessage uiMsg = (UIRichMessage)component;
+ UIRichMessage uiMsg = null;
+ if(!(component instanceof UIRichMessage)){
+ return;
+ }
+
+ uiMsg = (UIRichMessage)component;
+
boolean isTooltip = getUtils().isBooleanAttribute(uiMsg, "tooltip");
boolean showSummary = uiMsg.isShowSummary();
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java 2007-07-25 11:33:03 UTC (rev 1838)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java 2007-07-25 12:43:47 UTC (rev 1839)
@@ -5,8 +5,10 @@
import java.io.IOException;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
+import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIMessages;
@@ -15,7 +17,6 @@
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.resource.InternetResource;
-import org.richfaces.component.UIRichMessage;
import org.richfaces.component.UIRichMessages;
/**
@@ -30,7 +31,9 @@
protected InternetResource[] getStyles(){
+
synchronized (this){
+
if(stylesAll == null){
InternetResource[] rsrcs = super.getStyles();
@@ -46,11 +49,12 @@
}
}else{
+
if(ignoreThis){
stylesAll = rsrcs;
}else{
+
Set rsrcsSet = new java.util.LinkedHashSet();
-
for(int i = 0; i < rsrcs.length; i++ ){
rsrcsSet.add(rsrcs[i]);
}
@@ -61,7 +65,9 @@
stylesAll = (InternetResource[]) rsrcsSet.toArray(new InternetResource[rsrcsSet.size()]);
}
+
}
+
}
}
@@ -76,7 +82,9 @@
String layout = null;
+ String var = null;
+
UIRichMessages uiMessages = (UIRichMessages)component;
if(uiMessages.isGlobalOnly()){
@@ -84,40 +92,76 @@
}
messagesIter = getMessageIterator(context, forIds, component);
-
+
+ layout = (String)uiMessages.getAttributes().get("layout");
if((layout != null) && (layout.equals("table"))){
writer.startElement("table", component);
getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMessages.getClientId(context));
+ getUtils().writeAttribute(writer, HTML.cellpadding_ATTRIBUTE, "0");
+ getUtils().writeAttribute(writer, HTML.cellspacing_ATTRIBUTE, "0");
+
renderHeaderFacet(writer, context, uiMessages);
+ renderComponentOuterStyles(uiMessages, context, writer);
writer.startElement("tbody", uiMessages);
uiMessages.setWroteTable(true);
}else if((layout != null) && (layout.equals("iterator"))){
- // TODO will implement this behaviour soon!!!
- }else{
+
+ var = (String)uiMessages.getAttributes().get("var");
+ if(var == null){
+ FacesException e = new FacesException(new IllegalArgumentException("var attribute is not defined"));
+ throw e;
+ }
+
+ uiMessages.setIteratorLayout(true);
+
+ }else if((layout != null) && (layout.equals("list"))){
+
writer.startElement("ul", component);
+ getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMessages.getClientId(context));
+ renderComponentOuterStyles(uiMessages, context, writer);
+
}
while(messagesIter.hasNext()){
FacesMessage facesMsg = (FacesMessage)(messagesIter.next());
- writer.startElement(HTML.TR_ELEMENT, component);
+ if(!uiMessages.isIteratorLayout()){
+
+ if(uiMessages.isWroteTable()){
+ writer.startElement(HTML.TR_ELEMENT, component);
+ }else{
+ writer.startElement("li", component);
+ }
+
+ outerStyles(component, context, writer, facesMsg);
+ renderMarkerFacet(uiMessages, context, writer, facesMsg);
+ renderLabel(uiMessages, context, writer, facesMsg);
+
+ if(uiMessages.isWroteTable()){
+ writer.endElement(HTML.TR_ELEMENT);
+ }else{
+ writer.endElement("li");
+ }
+
+ if(uiMessages.isWroteTable()){
+ writer.endElement("tbody");
+ writer.endElement("table");
+ }else{
+ writer.endElement("ul");
+ }
+
+ }else{
+
+ Map requestMap = context.getExternalContext().getRequestMap();
+ requestMap.put(var, facesMsg);
- renderMarkerFacet(uiMessages, context, writer, facesMsg);
- renderLabel(uiMessages, context, writer, facesMsg);
+ }
- writer.endElement(HTML.TR_ELEMENT);
}
-
- if(uiMessages.isWroteTable()){
- writer.endElement("tbody");
- writer.endElement("table");
- }else{
- writer.endElement("ul");
- }
-
+
}
public void renderLabelHtml(UIComponent component, FacesContext context, ResponseWriter writer,
@@ -129,36 +173,48 @@
String title = null;
- UIRichMessage uiMsg = (UIRichMessage)component;
+ UIRichMessages uiMessages = null;
- boolean isTooltip = getUtils().isBooleanAttribute(uiMsg, "tooltip");
+
+ if(!(component instanceof UIRichMessages)){
+ return;
+ }
+
+ uiMessages = (UIRichMessages)component;
+
+ boolean isTooltip = getUtils().isBooleanAttribute(uiMessages, "tooltip");
- boolean showSummary = uiMsg.isShowSummary();
+ boolean showSummary = uiMessages.isShowSummary();
- boolean showDetail = uiMsg.isShowDetail();
+ boolean showDetail = uiMessages.isShowDetail();
-
if(facesMsg != null){
summary = (null != (summary = facesMsg.getSummary())) ? summary : "";
detail = (null != (detail = facesMsg.getDetail())) ? detail : "";
}
- String classes = labelClass == null ? "rich-messages-label" : "rich-messages-label " + labelClass;
+ labelClass = labelClass == null ? "rich-messages-label" : "rich-messages-label " + labelClass;
+ if(uiMessages.isWroteTable()){
+ writer.startElement(HTML.td_ELEM, component);
+ }
- writer.startElement(HTML.td_ELEM, component);
+ writer.startElement(HTML.SPAN_ELEM, uiMessages);
- getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE,classes);
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE,labelClass);
getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, labelStyle);
if(facesMsg != null){
+
if(isTooltip){
- title = (String) uiMsg.getAttributes().get("title");
+
+ title = (String) uiMessages.getAttributes().get("title");
if(title != null){
getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, title);
}else{
getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, summary);
}
+
}
if(showDetail){
@@ -170,39 +226,91 @@
writer.writeText(summary, null);
writer.writeText("\t", null);
}
+
}else {
if(passLabel != null){
writer.writeText(passLabel, null);
writer.writeText("\t", null);
}
-
+
}
- writer.endElement(HTML.td_ELEM);
+ writer.endElement(HTML.SPAN_ELEM);
+ if(uiMessages.isWroteTable()){
+ writer.endElement(HTML.td_ELEM);
+ }
}
public void renderMarkerHtml(UIComponent component, UIComponent markerFacet, FacesContext context,
ResponseWriter writer, String markerClass, String markerStyle)throws IOException {
- UIRichMessages uiMessages = (UIRichMessages)component;
+ UIRichMessages uiMessages = null;
+
+
+ if(!(component instanceof UIRichMessages)){
+ return;
+ }
+
+ uiMessages = (UIRichMessages)component;
+
if(uiMessages.isWroteTable()){
-
writer.startElement(HTML.td_ELEM, component);
+ }else{
+ writer.startElement(HTML.SPAN_ELEM, component);
+ }
- String classes = markerClass == null ? "rich-messages-marker" : "rich-messages-marker " + markerClass;
- getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, classes);
- getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, markerStyle);
+ String classes = markerClass == null ? "rich-messages-marker" : "rich-messages-marker " + markerClass;
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, classes);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, markerStyle);
- renderChild(context, markerFacet);
+ renderChild(context, markerFacet);
+ if(uiMessages.isWroteTable()){
writer.endElement(HTML.td_ELEM);
-
}else{
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+
+ }
+
+ public void renderComponentOuterStyles(UIComponent component, FacesContext context, ResponseWriter writer) throws IOException {
+
+ UIRichMessages uiMessages = null;
+
+
+ if(!(component instanceof UIRichMessages)){
+ return;
}
+
+ uiMessages = (UIRichMessages)component;
+
+ String parentStyle = (String)uiMessages.getAttributes().get("style");
+ String parentClass = (String)uiMessages.getAttributes().get("styleClass");
+
+ String richMessageClass = "rich-messages";
+
+ parentClass = parentClass != null ? (richMessageClass + " " + parentClass) : richMessageClass;
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, parentClass);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, parentStyle);
+
}
+
+ public void renderOuterStyles(UIComponent component, FacesContext context, ResponseWriter writer,
+ String outerStyle, String outerClass) throws IOException {
+
+ String richMessageClass = null != outerClass ? outerClass:"";
+ String richMessageStyle = (null != outerStyle ? outerStyle : "");
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, richMessageClass);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, richMessageStyle);
+
+ }
+
+
public void renderHeaderFacet(ResponseWriter writer, FacesContext context, UIRichMessages uiMessages) throws IOException{
@@ -238,6 +346,7 @@
writer.endElement(HTML.TR_ELEMENT);
writer.endElement(HTML.THEAD_ELEMENT);
}
+
}
protected Class getComponentClass() {
Modified: trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msgs.css
===================================================================
--- trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msgs.css 2007-07-25 11:33:03 UTC (rev 1838)
+++ trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msgs.css 2007-07-25 12:43:47 UTC (rev 1839)
@@ -9,3 +9,7 @@
.rich-messages-header{
}
+
+SPAN.rich-messages-marker, SPAN.rich-messages-marker *{
+ vertical-align: middle;
+}
17 years, 5 months
JBoss Rich Faces SVN: r1838 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-25 07:33:03 -0400 (Wed, 25 Jul 2007)
New Revision: 1838
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
trunk/docs/userguide/en/src/main/docbook/included/virtualEarth.xml
Log:
fixed error with Rich-menu-list-border class
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2007-07-25 11:02:38 UTC (rev 1837)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2007-07-25 11:33:03 UTC (rev 1838)
@@ -492,7 +492,7 @@
</row>
<row>
- <entry>Rich-menu-list-border</entry>
+ <entry>Rich-menu-list-bg</entry>
<entry>Defines the class for a general background list</entry>
</row>
Modified: trunk/docs/userguide/en/src/main/docbook/included/virtualEarth.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/virtualEarth.xml 2007-07-25 11:02:38 UTC (rev 1837)
+++ trunk/docs/userguide/en/src/main/docbook/included/virtualEarth.xml 2007-07-25 11:33:03 UTC (rev 1838)
@@ -49,7 +49,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:virtualEarth var="map"/>
+ <rich:virtualEarth lat="..." lng="..."/>
...
]]></programlisting>
</section>
@@ -107,6 +107,7 @@
</mediaobject>
</figure>
<para>Code for this example is placed below:</para>
+ <emphasis role="bold">Example:</emphasis>
<programlisting role="XML"><![CDATA[...
<rich:virtualEarth style="width:800px;" id="vm" lat="48.833" lng="2.40"
dashboardSize="Normal" zoom="11" mapStyle="Hybrid" var="map" />
17 years, 5 months