JBoss Rich Faces SVN: r6698 - in trunk/ui/inplaceInput/src/main: java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-11 11:09:31 -0400 (Tue, 11 Mar 2008)
New Revision: 6698
Modified:
trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
add layout="block/inline"
Modified: trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-03-11 15:08:49 UTC (rev 6697)
+++ trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-03-11 15:09:31 UTC (rev 6698)
@@ -38,6 +38,7 @@
<name>layout</name>
<classname>java.lang.String</classname>
<description>inline/block</description>
+ <defaultvalue><![CDATA["inline"]]></defaultvalue>
</property>
<property>
<name>inputMaxLength</name>
@@ -67,7 +68,7 @@
<name>defaultLabel</name>
<classname>java.lang.String</classname>
<description></description>
- <defaultvalue><![CDATA[""]]></defaultvalue>
+ <defaultvalue><![CDATA["\u00a0\u00a0\u00a0"]]></defaultvalue>
</property>
<property>
<name>showControls</name>
Modified: trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-03-11 15:08:49 UTC (rev 6697)
+++ trunk/ui/inplaceInput/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2008-03-11 15:09:31 UTC (rev 6698)
@@ -5,9 +5,11 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.renderkit.ComponentVariables;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.ajax4jsf.util.InputUtils;
import org.apache.commons.logging.Log;
@@ -128,7 +130,7 @@
return attributes.toString();
}
-
+
public String encodeScriptEvents(FacesContext context, UIComponent component) {
StringBuffer events = new StringBuffer();
@@ -172,35 +174,35 @@
StringBuffer stringBuffer = new StringBuffer();
switch (key) {
- case NORMAL_KEY:
- stringBuffer.append(INPLACE_CSS_PUBLIC);
- stringBuffer.append(" ");
- stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + suffix);
- value = component.getAttributes().get(suffix + "Class");
- if (value != null) {
- stringBuffer.append(" ");
- stringBuffer.append(value);
- }
- break;
- case HOVERED_KEY:
- stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + "input-" + suffix + "-" + INPLACE_CSS_HOVER);
- value = component.getAttributes().get(suffix + "HoverClass");
- if (value != null) {
- stringBuffer.append(" ");
- stringBuffer.append(value);
- }
- break;
-
- case EDITABLE_KEY:
- stringBuffer.append(INPLACE_CSS_PUBLIC);
- stringBuffer.append(" ");
- stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + suffix);
- value = component.getAttributes().get(suffix + "Class");
- if (value != null) {
- stringBuffer.append(" ");
- stringBuffer.append(value);
- }
- break;
+ case NORMAL_KEY:
+ stringBuffer.append(INPLACE_CSS_PUBLIC);
+ stringBuffer.append(" ");
+ stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + suffix);
+ value = component.getAttributes().get(suffix + "Class");
+ if (value != null) {
+ stringBuffer.append(" ");
+ stringBuffer.append(value);
+ }
+ break;
+ case HOVERED_KEY:
+ stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + "input-" + suffix + "-" + INPLACE_CSS_HOVER);
+ value = component.getAttributes().get(suffix + "HoverClass");
+ if (value != null) {
+ stringBuffer.append(" ");
+ stringBuffer.append(value);
+ }
+ break;
+
+ case EDITABLE_KEY:
+ stringBuffer.append(INPLACE_CSS_PUBLIC);
+ stringBuffer.append(" ");
+ stringBuffer.append(INPLACE_CSS_PUBLIC + "-" + suffix);
+ value = component.getAttributes().get(suffix + "Class");
+ if (value != null) {
+ stringBuffer.append(" ");
+ stringBuffer.append(value);
+ }
+ break;
}
return stringBuffer.toString();
}
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-11 15:08:49 UTC (rev 6697)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-11 15:09:31 UTC (rev 6698)
@@ -21,7 +21,7 @@
<f:resource var="cancelIcon" name="org.richfaces.renderkit.html.images.CancelControlIcon"/>
<f:resource var="spacer" name="images/spacer.gif"/>
-
+
<f:clientid var="clientId" />
<jsp:scriptlet>
<![CDATA[
@@ -54,11 +54,31 @@
variables.setVariable("controlHoverClass", controlHoveredClass);
String controlPressedClass = (String)component.getAttributes().get("controlPressedClass");
variables.setVariable("controlPressedClass", controlPressedClass);
+
+ String layout = (String)component.getAttributes().get("layout");
+ if (layout != null && layout.length() != 0) {
+ if (!layout.equals("block")) {
+ layout = "inline";
+ }
+ } else {
+ layout = "inline";
+ }
+
+ if (layout.equals("inline")) {
+
]]>
</jsp:scriptlet>
+ <span id="#{clientId}" class='rich-inplace rich-inplace-view #{component.attributes["styleClass"]}'
+ x:passThruWithExclusions="id,styleClass,class,style">
+ <jsp:scriptlet>
+ } else {
+ </jsp:scriptlet>
+ <div id="#{clientId}" class='rich-inplace rich-inplace-view #{component.attributes["styleClass"]}'
+ x:passThruWithExclusions="id,styleClass,class,style">
+ <jsp:scriptlet>
+ }
+ </jsp:scriptlet>
- <span id="#{clientId}" class='rich-inplace rich-inplace-view #{component.attributes["styleClass"]}'
- x:passThruWithExclusions="id,styleClass,class,style">
<input id="#{clientId}tabber" type="button" value="" style="width: 1px; position: absolute; left: -32767px;" />
<input id='#{clientId}tempValue'
class='rich-inplace-field'
@@ -138,9 +158,20 @@
]]>
</jsp:scriptlet>
</div>
- #{value}
- </span>
+ #{value}
+ <jsp:scriptlet>
+
+ if (!layout.equals("inline")) {
+ </jsp:scriptlet>
+ </div>
+ <jsp:scriptlet>
+ } else {
+ </jsp:scriptlet>
+ </span>
+ <jsp:scriptlet>
+ }
+ </jsp:scriptlet>
<script type="text/javascript">
16 years, 10 months
JBoss Rich Faces SVN: r6697 - in trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html: scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-11 11:08:49 -0400 (Tue, 11 Mar 2008)
New Revision: 6697
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
fix button position
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-03-11 14:40:31 UTC (rev 6696)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/css/inplaceinput.xcss 2008-03-11 15:08:49 UTC (rev 6697)
@@ -8,7 +8,7 @@
<![CDATA[
.rich-inplace {
- position:relative;
+ /*position:relative;*/
}
.rich-inplace-changed {
@@ -73,6 +73,7 @@
.rich-inplace-input-controls-set {
white-space : nowrap;
+ z-index: 3;
}
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-11 14:40:31 UTC (rev 6696)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-11 15:08:49 UTC (rev 6697)
@@ -167,6 +167,7 @@
},*/
endEditableState : function() {
+ this.inplaceInput.style.position = "";
if (this.bar) {
this.bar.hide();
}
@@ -179,6 +180,8 @@
},*/
startEditableState : function(textSize) {
+ this.inplaceInput.style.position = "relative";
+
this.changeState(Richfaces.InplaceInput.STATES[1]);
var inputSize = this.setInputWidth(textSize);
16 years, 10 months
JBoss Rich Faces SVN: r6696 - trunk/test-applications/jsp/src/main/webapp/InplaceSelect.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2008-03-11 10:40:31 -0400 (Tue, 11 Mar 2008)
New Revision: 6696
Modified:
trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelect.jsp
Log:
+ fix
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelect.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelect.jsp 2008-03-11 14:39:54 UTC (rev 6695)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelect.jsp 2008-03-11 14:40:31 UTC (rev 6696)
@@ -7,8 +7,8 @@
This is because such an error can easily be made at programming level, <br />
and while invisible for the user who does not understand or cannot <br />
acquire the source code, many of those
-<rich:inplaceSelect
-
+<rich:inplaceSelect id="inplaceSelectID"
+
tabindex="#{inplaceSelect.tabindex}"
editEvent="#{inplaceSelect.editEvent}"
maxSelectWidth="#{inplaceSelect.maxSelectWidth}"
@@ -40,7 +40,7 @@
<h:panelGrid columns="2">
<h:outputText value="value"></h:outputText>
-
+ <h:inputText value="#{inplaceSelect.value}"></h:inputText>
<h:outputText value="defaultLabel"></h:outputText>
<h:inputText value="#{inplaceSelect.defaultLabel}"
16 years, 10 months
JBoss Rich Faces SVN: r6695 - trunk/test-applications/facelets/src/main/webapp/InplaceSelect.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2008-03-11 10:39:54 -0400 (Tue, 11 Mar 2008)
New Revision: 6695
Modified:
trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelect.xhtml
Log:
+ fix
Modified: trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelect.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelect.xhtml 2008-03-11 14:35:10 UTC (rev 6694)
+++ trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelect.xhtml 2008-03-11 14:39:54 UTC (rev 6695)
@@ -3,7 +3,7 @@
This is because such an error can easily be made at programming level, <br />
and while invisible for the user who does not understand or cannot <br />
acquire the source code, many of those
-<rich:inplaceSelect
+<rich:inplaceSelect id="inplaceSelectID"
tabindex="#{inplaceSelect.tabindex}"
editEvent="#{inplaceSelect.editEvent}"
@@ -36,7 +36,7 @@
<h:panelGrid columns="2">
<h:outputText value="value"></h:outputText>
-
+ <h:inputText value="#{inplaceSelect.value}"></h:inputText>
<h:outputText value="defaultLabel"></h:outputText>
<h:inputText value="#{inplaceSelect.defaultLabel}"
16 years, 10 months
JBoss Rich Faces SVN: r6694 - trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-11 10:35:10 -0400 (Tue, 11 Mar 2008)
New Revision: 6694
Modified:
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
Log:
Modified: trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
===================================================================
--- trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-03-11 14:13:39 UTC (rev 6693)
+++ trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-03-11 14:35:10 UTC (rev 6694)
@@ -120,7 +120,8 @@
private Object [] initArray(int row) {
Object [] arr = new Object [columns.size()];
for (int i = 0; i < arr.length; i++) {
- arr[i] = ((Double)(Math.random() * 100.0)).intValue();
+ int r = ((Double)(Math.random() * 100.0)).intValue();
+ arr[i] = (r < 10) ? "0" + Integer.toString(r) : Integer.toString(r);
}
return arr;
}
16 years, 10 months
JBoss Rich Faces SVN: r6693 - trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-11 10:13:39 -0400 (Tue, 11 Mar 2008)
New Revision: 6693
Modified:
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
Log:
Modified: trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
===================================================================
--- trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-03-11 14:04:37 UTC (rev 6692)
+++ trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-03-11 14:13:39 UTC (rev 6693)
@@ -117,10 +117,10 @@
}
}
- private String [] initArray(int row) {
- String [] arr = new String [columns.size()];
+ private Object [] initArray(int row) {
+ Object [] arr = new Object [columns.size()];
for (int i = 0; i < arr.length; i++) {
- arr[i] = Integer.toString(row+i);
+ arr[i] = ((Double)(Math.random() * 100.0)).intValue();
}
return arr;
}
16 years, 10 months
JBoss Rich Faces SVN: r6692 - in trunk/samples/columnsDemo/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-11 10:04:37 -0400 (Tue, 11 Mar 2008)
New Revision: 6692
Added:
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Column.java
Modified:
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
trunk/samples/columnsDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/columnsDemo/src/main/webapp/pages/index.xhtml
Log:
RF-2413
Modified: trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
===================================================================
--- trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-03-11 14:03:41 UTC (rev 6691)
+++ trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-03-11 14:04:37 UTC (rev 6692)
@@ -27,6 +27,8 @@
import java.util.List;
import java.util.Map;
+import org.richfaces.model.Ordering;
+
/**
* @author k
*
@@ -104,11 +106,13 @@
private void initColumns () {
String header;
String footer;
+ Ordering ordering = Ordering.UNSORTED;
for (int i = 0; i < columnsCount; i++) {
header = "Header" + Integer.toString(i);
footer = "Footer" + Integer.toString(i);
- Facet facet = new Facet(header,footer);
- columns.add(facet);
+ Column column = new Column(header, footer, ordering);
+ //Facet facet = new Facet(header,footer);
+ columns.add(column);
}
}
@@ -121,14 +125,8 @@
return arr;
}
- private void initMap(Map map, int row) {
-// Iterator it = columns.iterator();
-// while (it.hasNext()) {
-// String column = (String) it.next();
-// map.put(column, column + row);
-// }
- }
+
/**
* @return the model
*/
Added: trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Column.java
===================================================================
--- trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Column.java (rev 0)
+++ trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Column.java 2008-03-11 14:04:37 UTC (rev 6692)
@@ -0,0 +1,81 @@
+/*
+ * Column.java Date created: 11.03.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.sandbox.samples;
+
+import org.richfaces.model.Ordering;
+
+/**
+ * TODO Class description goes here.
+ * @author "Andrey Markavtsov"
+ *
+ */
+public class Column {
+
+ private String header;
+
+ private String footer;
+
+ private Ordering ordering;
+
+ /**
+ * TODO Description goes here.
+ * @param header
+ * @param footer
+ * @param ordering
+ */
+ public Column(String header, String footer, Ordering ordering) {
+ super();
+ this.header = header;
+ this.footer = footer;
+ this.ordering = ordering;
+ }
+
+ /**
+ * @return the header
+ */
+ public String getHeader() {
+ return header;
+ }
+
+ /**
+ * @param header the header to set
+ */
+ public void setHeader(String header) {
+ this.header = header;
+ }
+
+ /**
+ * @return the footer
+ */
+ public String getFooter() {
+ return footer;
+ }
+
+ /**
+ * @param footer the footer to set
+ */
+ public void setFooter(String footer) {
+ this.footer = footer;
+ }
+
+ /**
+ * @return the ordering
+ */
+ public Ordering getOrdering() {
+ return ordering;
+ }
+
+ /**
+ * @param ordering the ordering to set
+ */
+ public void setOrdering(Ordering ordering) {
+ this.ordering = ordering;
+ }
+
+
+
+}
Modified: trunk/samples/columnsDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/columnsDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-11 14:03:41 UTC (rev 6691)
+++ trunk/samples/columnsDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-11 14:04:37 UTC (rev 6692)
@@ -7,6 +7,11 @@
<managed-bean-class>org.richfaces.sandbox.samples.Bean</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>columns</managed-bean-name>
+ <managed-bean-class>org.richfaces.sandbox.samples.Columns</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<display-name>xhtml</display-name>
<navigation-case>
Modified: trunk/samples/columnsDemo/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/samples/columnsDemo/src/main/webapp/pages/index.xhtml 2008-03-11 14:03:41 UTC (rev 6691)
+++ trunk/samples/columnsDemo/src/main/webapp/pages/index.xhtml 2008-03-11 14:04:37 UTC (rev 6692)
@@ -14,33 +14,48 @@
Columns: <h:inputText value="#{bean.columnsCountStr}"></h:inputText> <br/>
Rows: <h:inputText value="#{bean.rowCountStr}"></h:inputText> <br/>
-
+
+
+ <a4j:commandButton value="Submit" action="#{bean.xhtml}" reRender="tb"></a4j:commandButton>
+
+ <br/>
- <a4j:commandButton value="Submit" action="#{bean.xhtml}" reRender="tb"></a4j:commandButton>
-
- <br/>
-
<dt:dataTable value="#{bean.model}" var="var" id="tb">
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="crack"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="crack"></h:outputText>
+ </f:facet>
+ <h:outputText value="crack"></h:outputText>
+ </dt:column>
<columns:columns value="#{bean.columns}" var="col" index="counter"
- style="color: Red;" width="100px;">
- <f:facet name="header">
- <h:outputText value="#{col.header}"></h:outputText>
- </f:facet>
- <f:facet name="footer">
- <h:outputText value="#{col.footer}"></h:outputText>
- </f:facet>
+ style="color: Blue; text-align: right;" width="200px;"
+ begin="0" end="10"
+ sortBy="#{var[counter]}" sortOrder="#{col.ordering}">
+ <f:facet name="header">
+ <h:outputText value="#{col.header}"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="#{col.footer}"></h:outputText>
+ </f:facet>
<h:outputText value="#{var[counter]}"></h:outputText>
- <h:inputText value="#{var[counter]}"></h:inputText>
</columns:columns>
+
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="crack"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="crack"></h:outputText>
+ </f:facet>
+ <h:outputText value="crack"></h:outputText>
+ </dt:column>
</dt:dataTable>
- <dt:dataTable value="#{bean.model}" var="var" id="tb2">
- <columns:columns end="#{bean.columnsCountStr}" var="col" index="counter"
- style="color: Red;" width="100px;">
- <h:outputText value="#{var[counter]}"></h:outputText>
- </columns:columns>
- </dt:dataTable>
+ <h:commandButton value="Submit" action="xhtml"></h:commandButton>
</h:form>
16 years, 10 months
JBoss Rich Faces SVN: r6691 - in trunk/ui/columns/src/main: java/org/richfaces/taglib and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-11 10:03:41 -0400 (Tue, 11 Mar 2008)
New Revision: 6691
Added:
trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java
Removed:
trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTagHandler.java
trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java
Modified:
trunk/ui/columns/src/main/config/component/columns.xml
Log:
RF-2413
Modified: trunk/ui/columns/src/main/config/component/columns.xml
===================================================================
--- trunk/ui/columns/src/main/config/component/columns.xml 2008-03-11 14:02:16 UTC (rev 6690)
+++ trunk/ui/columns/src/main/config/component/columns.xml 2008-03-11 14:03:41 UTC (rev 6691)
@@ -21,7 +21,7 @@
<test/>
</tag>
<taghandler generate="false">
- <classname>org.richfaces.taglib.ColumnsTagHandler</classname>
+ <classname>org.richfaces.taglib.ComponentHandler</classname>
</taghandler>
&ui_data_attributes;
&attributes;
Deleted: trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTagHandler.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTagHandler.java 2008-03-11 14:02:16 UTC (rev 6690)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTagHandler.java 2008-03-11 14:03:41 UTC (rev 6691)
@@ -1,393 +0,0 @@
-/*
- * ColumnsHandler.java Date created: 07.12.2007
- * Last modified by: $Author$
- * $Revision$ $Date$
- */
-
-package org.richfaces.taglib;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.servlet.jsp.JspTagException;
-
-import org.richfaces.iterator.ForEachIterator;
-import org.richfaces.iterator.SimpleForEachIterator;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-
-
-/**
- * TODO Class description goes here.
- *
- * @author "Andrey Markavtsov"
- *
- */
-public class ColumnsTagHandler extends ComponentHandler {
-
- /** value attribute */
- private TagAttribute value;
-
- /** end attribute */
- private TagAttribute columns;
-
- /** begin attribute */
- private TagAttribute begin;
-
- /** var attribute */
- private TagAttribute var;
-
- /** index attribute */
- private TagAttribute index;
-
- /** end attribute */
- private TagAttribute end;
-
- /** Iterator for columns's tag value attribute */
- protected ForEachIterator items; // our 'digested' items
-
- /** Value attribute value */
- protected Object rawItems; // our 'raw' items
-
- /** Var attr - defines page variable for current item */
- private String _indexId;
-
- /** Integer value begin attr */
- private Integer _begin;
-
- /** Integer value end attr */
- private Integer _end;
-
- /** Integer value of end attr. */
- private Integer _columns;
-
- /** String value of var attr */
- private String _itemId = null;
-
- /** Current column counter */
- private Integer _index = 0;
-
- /** Expression for var item */
- private IteratedExpression iteratedExpression;
-
- /**
- * TODO Description goes here.
- *
- * @param config
- */
- public ColumnsTagHandler(ComponentConfig config) {
- super(config);
-
- }
-
- /**
- * Extracts tags attributes values
- */
- private void initVariables(FaceletContext ctx) {
- initColumnsCount(ctx);
- initIndex(ctx);
- initVar(ctx);
- initBegin(ctx);
- initEnd(ctx);
- }
-
- /**
- * Method prepares all we need for starting of tag rendering
- *
- * @throws JspTagException
- */
- private void prepare(FaceletContext ctx) {
-
- initVariables(ctx);
-
- try {
-
- this.value = getAttribute("value");
-
- // produce the right sort of ForEachIterator
- if (value != null) {
- // If this is a deferred expression, make a note and get
- // the 'items' instance.
-
- rawItems = value.getObject(ctx);
-
- // extract an iterator over the 'items' we've got
- items = SimpleForEachIterator
- .supportedTypeForEachIterator(rawItems);
- } else {
- // no 'items', so use 'begin' and 'end'
- items = SimpleForEachIterator
- .beginEndForEachIterator(_columns - 1);
- }
- } catch (Exception e) {
- // TODO: handle exception
- }
-
- correctFirst(ctx);
- }
-
- /**
- * Inits first iteration item
- */
- private void correctFirst(FaceletContext ctx) {
- if (items != null) {
- if (_begin > 0 && (_index < _begin)) {
- while ((_index < _begin && hasNext())) {
- next(ctx);
- }
- if (!hasNext()) {
- _index = 0;
- }
- }
- }
- }
-
- /**
- * Return true if we didn't complete column's count
- *
- * @return
- * @throws JspTagException
- */
- private boolean hasNext() {
- try {
- if (_end != 0) {
- return (_index < _end) ? items.hasNext() : false;
- } else {
- return items.hasNext();
- }
- } catch (Exception e) {
- return false;
- }
-
- }
-
- /**
- * Iterate to next column
- *
- * @return
- * @throws JspTagException
- */
- private Object next(FaceletContext ctx) {
- try {
- Object o = items.next();
- _index++;
- return o;
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Extracts integer value from end attr
- */
- private void initColumnsCount(FaceletContext ctx) {
- this.columns = getAttribute("columns");
- if (columns != null) {
- try {
- _columns = Integer.parseInt((String) columns.getObject(ctx));
- if (_columns < 0) {
- _columns = 0; // If end is negative set up zero
- }
- } catch (Exception e) {
- _columns = 0;
- }
- } else {
- _columns = 0;
- }
- }
-
- /**
- * Extracts integer value from begin attr
- */
- private void initBegin(FaceletContext ctx) {
- this.begin = getAttribute("begin");
- if (begin != null) {
- try {
- _begin = Integer.parseInt((String) begin.getObject(ctx));
- _begin--;
- if (_begin < 0) {
- _begin = 0; // If end is negative set up zero
- }
- } catch (Exception e) {
- _begin = 0;
- }
- } else {
- _begin = 0;
- }
- }
-
- /**
- * Extracts integer value from end attr
- */
- private void initEnd(FaceletContext ctx) {
- this.end = getAttribute("end");
- if (end != null) {
- try {
- _end = Integer.parseInt((String) end.getObject(ctx));
- if (_end < 0) {
- _end = 0; // If end is negative set up zero
- }
- } catch (Exception e) {
- _end = 0;
- }
- } else {
- _end = 0;
- }
- }
-
- /**
- * Extracts string value from var attr
- */
- private void initVar(FaceletContext ctx) {
- this.var = getAttribute("var");
- if (var != null) {
- try {
- _itemId = (String) var.getObject(ctx);
- } catch (ClassCastException e) {
- _itemId = null;
- }
-
- }
- }
-
- /**
- * Extracts string value from index attr
- */
- private void initIndex(FaceletContext ctx) {
- this.index = getAttribute("index");
- if (index != null) {
- try {
- _indexId = (String) index.getObject(ctx);
- } catch (ClassCastException e) {
- _indexId = null;
- }
-
- }
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.taglib.ComponentHandler#apply(com.sun.facelets.FaceletContext, javax.faces.component.UIComponent)
- */
- @Override
- public void apply(FaceletContext ctx, UIComponent parent)
- throws IOException, FacesException, ELException {
-
- prepare(ctx); // prepare data
-
- try {
- while (hasNext()) { // for each
- exposeVariables(ctx, _index);
- super.apply(ctx, parent);
- next(ctx);
- }
- } catch (Exception e) {
- // TODO: handle exception
- } finally {
- release();
- unExposeVariables(ctx);
- }
-
- }
-
- protected void applyNextHandler(FaceletContext ctx, UIComponent c)
- throws IOException, FacesException, ELException {
- // TODO Auto-generated method stub
- super.applyNextHandler(ctx, c);
- }
-
-
- /**
- * Sets page request variables
- *
- * @throws JspTagException
- */
- private void exposeVariables(FaceletContext ctx, int k) {
-
- VariableMapper vm = ctx.getVariableMapper();
-
- if (_itemId != null) {
- if (vm != null) {
- if (value != null) {
- ValueExpression srcVE = value.getValueExpression(ctx,
- Object.class);
- ValueExpression ve = getVarExpression(ctx, srcVE, k);
- vm.setVariable(_itemId, ve);
- }
- }
-
- }
-
- // Set up index variable
-
- if (_indexId != null) {
- if (vm != null) {
- ValueExpression ve = new IteratedIndexExpression(k);
- vm.setVariable(_indexId, ve);
- }
-
- }
-
- }
-
- /**
- * Removes page attributes that we have exposed and, if applicable, restores
- * them to their prior values (and scopes).
- */
- private void unExposeVariables(FaceletContext ctx) {
- VariableMapper vm = ctx.getVariableMapper();
- // "nested" variables are now simply removed
- if (_itemId != null) {
- if (vm != null)
- vm.setVariable(_itemId, null);
- }
- if (_indexId != null) {
- if (vm != null)
- vm.setVariable(_indexId, null);
- }
- }
-
- /**
- * Return expression for page variables
- *
- * @param expr
- * @return
- */
- private ValueExpression getVarExpression(FaceletContext ctx,
- ValueExpression expr, int k) {
- Object o = expr.getValue(ctx.getFacesContext().getELContext());
- if (o.getClass().isArray() || o instanceof List) {
- return new IndexedValueExpression(expr, k);
- }
-
- if (o instanceof Collection || o instanceof Iterator
- || o instanceof Enumeration || o instanceof Map
- || o instanceof String) {
-
- if (iteratedExpression == null) {
- iteratedExpression = new IteratedExpression(expr, ",");
- }
- return new IteratedValueExpression(iteratedExpression, k);
- }
-
- throw new ELException("FOREACH_BAD_ITEMS");
- }
-
- /**
- * Release iteration variables
- */
- private void release() {
- this.items = null;
- this._index = 0;
- }
-}
Deleted: trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java 2008-03-11 14:02:16 UTC (rev 6690)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java 2008-03-11 14:03:41 UTC (rev 6691)
@@ -1,284 +0,0 @@
-/**
- * Licensed under the Common Development and Distribution License,
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.sun.com/cddl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.richfaces.taglib;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.el.ELException;
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.component.ActionSource;
-import javax.faces.component.ActionSource2;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.component.ValueHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.el.ValueBinding;
-import javax.faces.event.ActionEvent;
-import javax.faces.event.MethodExpressionActionListener;
-import javax.faces.event.MethodExpressionValueChangeListener;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.validator.MethodExpressionValidator;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.ELAdaptor;
-import com.sun.facelets.el.LegacyMethodBinding;
-import com.sun.facelets.el.LegacyValueBinding;
-import com.sun.facelets.tag.MetaTagHandler;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.MetaRuleset;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-import com.sun.facelets.tag.jsf.ComponentSupport;
-import com.sun.facelets.tag.jsf.EditableValueHolderRule;
-import com.sun.facelets.util.FacesAPI;
-
-/**
- * Implementation of the tag logic used in the JSF specification. This is your
- * golden hammer for wiring UIComponents to Facelets.
- *
- * @author Jacob Hookom
- * @version $Id: ComponentHandler.java,v 1.12 2006/01/11 05:40:56 jhook Exp $
- */
-public class ComponentHandler extends MetaTagHandler {
-
- private final static Logger log = Logger
- .getLogger("facelets.tag.component");
-
- private final TagAttribute binding;
-
- private final String componentType;
-
- private final TagAttribute id;
-
- private final String rendererType;
-
- public ComponentHandler(ComponentConfig config) {
- super(config);
- this.componentType = config.getComponentType();
- this.rendererType = config.getRendererType();
- this.id = this.getAttribute("id");
- this.binding = this.getAttribute("binding");
- }
-
- /**
- * Method handles UIComponent tree creation in accordance with the JSF 1.2
- * spec.
- * <ol>
- * <li>First determines this UIComponent's id by calling
- * {@link #getId(FaceletContext) getId(FaceletContext)}.</li>
- * <li>Search the parent for an existing UIComponent of the id we just
- * grabbed</li>
- * <li>If found, {@link #markForDeletion(UIComponent) mark} its children
- * for deletion.</li>
- * <li>If <i>not</i> found, call
- * {@link #createComponent(FaceletContext) createComponent}.
- * <ol>
- * <li>Only here do we apply
- * {@link ObjectHandler#setAttributes(FaceletContext, Object) attributes}</li>
- * <li>Set the UIComponent's id</li>
- * <li>Set the RendererType of this instance</li>
- * </ol>
- * </li>
- * <li>Now apply the nextHandler, passing the UIComponent we've
- * created/found.</li>
- * <li>Now add the UIComponent to the passed parent</li>
- * <li>Lastly, if the UIComponent already existed (found), then
- * {@link #finalizeForDeletion(UIComponent) finalize} for deletion.</li>
- * </ol>
- *
- * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
- * javax.faces.component.UIComponent)
- *
- * @throws TagException
- * if the UIComponent parent is null
- */
- public void apply(FaceletContext ctx, UIComponent parent)
- throws IOException, FacesException, ELException {
- // make sure our parent is not null
- if (parent == null) {
- throw new TagException(this.tag, "Parent UIComponent was null");
- }
-
- // our id
- String id = ctx.generateUniqueId(this.tagId);
-
- // grab our component
- UIComponent c = ComponentSupport.findChildByTagId(parent, id);
- boolean componentFound = false;
- if (c != null) {
- componentFound = true;
- // mark all children for cleaning
- if (log.isLoggable(Level.FINE)) {
- log.fine(this.tag
- + " Component["+id+"] Found, marking children for cleanup");
- }
- ComponentSupport.markForDeletion(c);
- } else {
- c = this.createComponent(ctx);
- if (log.isLoggable(Level.FINE)) {
- log.fine(this.tag + " Component["+id+"] Created: "
- + c.getClass().getName());
- }
- this.setAttributes(ctx, c);
-
- // mark it owned by a facelet instance
- c.getAttributes().put(ComponentSupport.MARK_CREATED, id);
-
- // assign our unique id
- if (this.id != null) {
- c.setId(ctx.generateUniqueId(this.id.getValue(ctx)));
- } else {
- UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent);
- if (root != null) {
- c.setId(root.createUniqueId());
- }
- }
-
- if (this.rendererType != null) {
- c.setRendererType(this.rendererType);
- }
-
- // hook method
- this.onComponentCreated(ctx, c, parent);
- }
-
- // first allow c to get populated
- this.nextHandler.apply(ctx, c);
-
- // finish cleaning up orphaned children
- if (componentFound) {
- ComponentSupport.finalizeForDeletion(c);
- parent.getChildren().remove(c);
- }
-
- // add to the tree afterwards
- // this allows children to determine if it's
- // been part of the tree or not yet
- parent.getChildren().add(c);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.jsf.ComponentHandler#applyNextHandler(com.sun.facelets.FaceletContext,
- * javax.faces.component.UIComponent)
- */
-
- protected void applyNextHandler(FaceletContext ctx, UIComponent c)
- throws IOException, FacesException, ELException {
-
- }
-
- /**
- * If the binding attribute was specified, use that in conjuction with our
- * componentType String variable to call createComponent on the Application,
- * otherwise just pass the componentType String.
- * <p />
- * If the binding was used, then set the ValueExpression "binding" on the
- * created UIComponent.
- *
- * @see Application#createComponent(javax.faces.el.ValueBinding,
- * javax.faces.context.FacesContext, java.lang.String)
- * @see Application#createComponent(java.lang.String)
- * @param ctx
- * FaceletContext to use in creating a component
- * @return
- */
- protected UIComponent createComponent(FaceletContext ctx) {
- UIComponent c = null;
- FacesContext faces = ctx.getFacesContext();
- Application app = faces.getApplication();
- if (this.binding != null) {
- ValueExpression ve = this.binding.getValueExpression(ctx,
- Object.class);
- if (FacesAPI.getVersion() >= 12) {
- c = app.createComponent(ve, faces, this.componentType);
- if (c != null) {
- // Make sure the component supports 1.2
- if (FacesAPI.getComponentVersion(c) >= 12) {
- c.setValueExpression("binding", ve);
- } else {
- ValueBinding vb = new LegacyValueBinding(ve);
- c.setValueBinding("binding", vb);
- }
-
- }
- } else {
- ValueBinding vb = new LegacyValueBinding(ve);
- c = app.createComponent(vb, faces, this.componentType);
- if (c != null) {
- c.setValueBinding("binding", vb);
- }
- }
- } else {
- c = app.createComponent(this.componentType);
- }
- return c;
- }
-
- /**
- * If the id TagAttribute was specified, get it's value, otherwise generate
- * a unique id from our tagId.
- *
- * @see TagAttribute#getValue(FaceletContext)
- * @param ctx
- * FaceletContext to use
- * @return what should be a unique Id
- */
- protected String getId(FaceletContext ctx) {
- if (this.id != null) {
- return this.id.getValue(ctx);
- }
- return ctx.generateUniqueId(this.tagId);
- }
-
- /* (non-Javadoc)
- * @see com.sun.facelets.tag.MetaTagHandler#createMetaRuleset(java.lang.Class)
- */
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset ruleset = super.createMetaRuleset(type);
- ruleset.ignore("var");
- ruleset.ignore("index");
- ruleset.ignore("columns");
- ruleset.ignore("begin");
- ruleset.ignore("end");
- ruleset.ignore("value");
- return ruleset;
-
- }
-
- /**
- * A hook method for allowing developers to do additional processing once Facelets
- * creates the component. The 'setAttributes' method is still perferred, but this
- * method will provide the parent UIComponent before it's been added to the tree and
- * before any children have been added to the newly created UIComponent.
- *
- * @param ctx
- * @param c
- * @param parent
- */
- protected void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent) {
- // do nothing
- }
-}
Added: trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java (rev 0)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java 2008-03-11 14:03:41 UTC (rev 6691)
@@ -0,0 +1,401 @@
+/*
+ * ColumnsHandler.java Date created: 07.12.2007
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.taglib;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.servlet.jsp.JspTagException;
+
+import org.richfaces.iterator.ForEachIterator;
+import org.richfaces.iterator.SimpleForEachIterator;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.MetaTagHandler;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+
+
+
+/**
+ * TODO Class description goes here.
+ *
+ * @author "Andrey Markavtsov"
+ *
+ */
+public class ComponentHandler extends MetaTagHandler {
+
+ com.sun.facelets.tag.jsf.ComponentHandler handler;
+
+ /** value attribute */
+ private TagAttribute value;
+
+ /** end attribute */
+ private TagAttribute columns;
+
+ /** begin attribute */
+ private TagAttribute begin;
+
+ /** var attribute */
+ private TagAttribute var;
+
+ /** index attribute */
+ private TagAttribute index;
+
+ /** end attribute */
+ private TagAttribute end;
+
+ /** Iterator for columns's tag value attribute */
+ protected ForEachIterator items; // our 'digested' items
+
+ /** Value attribute value */
+ protected Object rawItems; // our 'raw' items
+
+ /** Var attr - defines page variable for current item */
+ private String _indexId;
+
+ /** Integer value begin attr */
+ private Integer _begin;
+
+ /** Integer value end attr */
+ private Integer _end;
+
+ /** Integer value of end attr. */
+ private Integer _columns;
+
+ /** String value of var attr */
+ private String _itemId = null;
+
+ /** Current column counter */
+ private Integer _index = 0;
+
+ /** Expression for var item */
+ private IteratedExpression iteratedExpression;
+
+ /**
+ * TODO Description goes here.
+ *
+ * @param config
+ */
+ public ComponentHandler(ComponentConfig config) {
+ super(config);
+ handler = new com.sun.facelets.tag.jsf.ComponentHandler(config);
+ }
+
+ /**
+ * Extracts tags attributes values
+ */
+ private void initVariables(FaceletContext ctx) {
+ initColumnsCount(ctx);
+ initIndex(ctx);
+ initVar(ctx);
+ initBegin(ctx);
+ initEnd(ctx);
+ }
+
+ /**
+ * Method prepares all we need for starting of tag rendering
+ *
+ * @throws JspTagException
+ */
+ private void prepare(FaceletContext ctx) {
+
+ initVariables(ctx);
+
+ try {
+
+ this.value = getAttribute("value");
+
+ // produce the right sort of ForEachIterator
+ if (value != null) {
+ // If this is a deferred expression, make a note and get
+ // the 'items' instance.
+
+ rawItems = value.getObject(ctx);
+
+ // extract an iterator over the 'items' we've got
+ items = SimpleForEachIterator
+ .supportedTypeForEachIterator(rawItems);
+ } else {
+ // no 'items', so use 'begin' and 'end'
+ items = SimpleForEachIterator
+ .beginEndForEachIterator(_columns - 1);
+ }
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+
+ correctFirst(ctx);
+ }
+
+ /**
+ * Inits first iteration item
+ */
+ private void correctFirst(FaceletContext ctx) {
+ if (items != null) {
+ if (_begin > 0 && (_index < _begin)) {
+ while ((_index < _begin && hasNext())) {
+ next(ctx);
+ }
+ if (!hasNext()) {
+ _index = 0;
+ }
+ }
+ }
+ }
+
+ /**
+ * Return true if we didn't complete column's count
+ *
+ * @return
+ * @throws JspTagException
+ */
+ private boolean hasNext() {
+ try {
+ if (_end != 0) {
+ return (_index < _end) ? items.hasNext() : false;
+ } else {
+ return items.hasNext();
+ }
+ } catch (Exception e) {
+ return false;
+ }
+
+ }
+
+ /**
+ * Iterate to next column
+ *
+ * @return
+ * @throws JspTagException
+ */
+ private Object next(FaceletContext ctx) {
+ try {
+ Object o = items.next();
+ _index++;
+ return o;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ /**
+ * Extracts integer value from end attr
+ */
+ private void initColumnsCount(FaceletContext ctx) {
+ this.columns = getAttribute("columns");
+ if (columns != null) {
+ try {
+ _columns = Integer.parseInt((String) columns.getObject(ctx));
+ if (_columns < 0) {
+ _columns = 0; // If end is negative set up zero
+ }
+ } catch (Exception e) {
+ _columns = 0;
+ }
+ } else {
+ _columns = 0;
+ }
+ }
+
+ /**
+ * Extracts integer value from begin attr
+ */
+ private void initBegin(FaceletContext ctx) {
+ this.begin = getAttribute("begin");
+ if (begin != null) {
+ try {
+ _begin = Integer.parseInt((String) begin.getObject(ctx));
+ _begin--;
+ if (_begin < 0) {
+ _begin = 0; // If end is negative set up zero
+ }
+ } catch (Exception e) {
+ _begin = 0;
+ }
+ } else {
+ _begin = 0;
+ }
+ }
+
+ /**
+ * Extracts integer value from end attr
+ */
+ private void initEnd(FaceletContext ctx) {
+ this.end = getAttribute("end");
+ if (end != null) {
+ try {
+ _end = Integer.parseInt((String) end.getObject(ctx));
+ if (_end < 0) {
+ _end = 0; // If end is negative set up zero
+ }
+ } catch (Exception e) {
+ _end = 0;
+ }
+ } else {
+ _end = 0;
+ }
+ }
+
+ /**
+ * Extracts string value from var attr
+ */
+ private void initVar(FaceletContext ctx) {
+ this.var = getAttribute("var");
+ if (var != null) {
+ try {
+ _itemId = (String) var.getObject(ctx);
+ } catch (ClassCastException e) {
+ _itemId = null;
+ }
+
+ }
+ }
+
+ /**
+ * Extracts string value from index attr
+ */
+ private void initIndex(FaceletContext ctx) {
+ this.index = getAttribute("index");
+ if (index != null) {
+ try {
+ _indexId = (String) index.getObject(ctx);
+ } catch (ClassCastException e) {
+ _indexId = null;
+ }
+
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.taglib.ComponentHandler#apply(com.sun.facelets.FaceletContext, javax.faces.component.UIComponent)
+ */
+ //@Override
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, ELException {
+
+ prepare(ctx); // prepare data
+
+ try {
+ while (hasNext()) { // for each
+ exposeVariables(ctx, _index);
+ //super.apply(ctx, parent);
+ handler.apply(ctx, parent);
+ next(ctx);
+ }
+ } catch (Exception e) {
+ // TODO: handle exception
+ } finally {
+ release();
+ unExposeVariables(ctx);
+ }
+
+ }
+
+ protected void applyNextHandler(FaceletContext ctx, UIComponent c)
+ throws IOException, FacesException, ELException {
+ // TODO Auto-generated method stub
+ //super.applyNextHandler(ctx, c);
+
+ }
+
+
+ /**
+ * Sets page request variables
+ *
+ * @throws JspTagException
+ */
+ private void exposeVariables(FaceletContext ctx, int k) {
+
+ VariableMapper vm = ctx.getVariableMapper();
+
+ if (_itemId != null) {
+ if (vm != null) {
+ if (value != null) {
+ ValueExpression srcVE = value.getValueExpression(ctx,
+ Object.class);
+ ValueExpression ve = getVarExpression(ctx, srcVE, k);
+ vm.setVariable(_itemId, ve);
+ }
+ }
+
+ }
+
+ // Set up index variable
+
+ if (_indexId != null) {
+ if (vm != null) {
+ ValueExpression ve = new IteratedIndexExpression(k);
+ vm.setVariable(_indexId, ve);
+ }
+
+ }
+
+ }
+
+ /**
+ * Removes page attributes that we have exposed and, if applicable, restores
+ * them to their prior values (and scopes).
+ */
+ private void unExposeVariables(FaceletContext ctx) {
+ VariableMapper vm = ctx.getVariableMapper();
+ // "nested" variables are now simply removed
+ if (_itemId != null) {
+ if (vm != null)
+ vm.setVariable(_itemId, null);
+ }
+ if (_indexId != null) {
+ if (vm != null)
+ vm.setVariable(_indexId, null);
+ }
+ }
+
+ /**
+ * Return expression for page variables
+ *
+ * @param expr
+ * @return
+ */
+ private ValueExpression getVarExpression(FaceletContext ctx,
+ ValueExpression expr, int k) {
+ Object o = expr.getValue(ctx.getFacesContext().getELContext());
+ if (o.getClass().isArray() || o instanceof List) {
+ return new IndexedValueExpression(expr, k);
+ }
+
+ if (o instanceof Collection || o instanceof Iterator
+ || o instanceof Enumeration || o instanceof Map
+ || o instanceof String) {
+
+ if (iteratedExpression == null) {
+ iteratedExpression = new IteratedExpression(expr, ",");
+ }
+ return new IteratedValueExpression(iteratedExpression, k);
+ }
+
+ throw new ELException("FOREACH_BAD_ITEMS");
+ }
+
+ /**
+ * Release iteration variables
+ */
+ private void release() {
+ this.items = null;
+ this._index = 0;
+ }
+
+}
16 years, 10 months
JBoss Rich Faces SVN: r6690 - management/design/panelBar.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-03-11 10:02:16 -0400 (Tue, 11 Mar 2008)
New Revision: 6690
Added:
management/design/panelBar/panelBar_japan.html
management/design/panelBar/pbar_bg_japan.gif
Log:
Added: management/design/panelBar/panelBar_japan.html
===================================================================
--- management/design/panelBar/panelBar_japan.html (rev 0)
+++ management/design/panelBar/panelBar_japan.html 2008-03-11 14:02:16 UTC (rev 6690)
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+<title>coll_panel</title>
+<style>
+.pbar_size{
+ width : 300px;
+}
+
+.pbar_item{
+ border-top : 1px solid #DFA5A5; /*panelBorderColor*/
+ border-left : 1px solid #DFA5A5; /*panelBorderColor*/
+ border-right : 1px solid #DFA5A5; /*panelBorderColor*/
+ border-bottom : 0px;
+ font-size : 11px; /*generalSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ padding : 0px;
+}
+
+.pbar_content{
+ border-top : 1px solid #DFA5A5; /*panelBorderColor*/
+ font-family : verdana; /*generalFamilyFont*/
+ font-size : 11px; /*generalSizeFont*/
+ padding : 10px;
+ color : #000000; /*generalTextColor*/
+}
+
+.pbar_label{
+ border : 0px solid #DFA5A5; /*panelBorderColor*/
+ background-color : #F9EAEA; /*headerBackgroundColor*/
+ font-size : 11px; /*headerSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ color : #980808; /*headerTextColor*/
+ font-weight : bold;
+ background-image : url(pbar_bg_japan.gif); /*from headerGradientColor to headerBackgroundColor*/
+ background-position : top left;
+ background-repeat : repeat-x;
+ padding : 4px 4px 4px 10px;
+ cursor : pointer;
+ margin : 1px;
+ white-space : nowrap;
+}
+
+.pbar_bottom{
+ border-top : 1px solid #DFA5A5; /*panelBorderColor*/
+}
+.pbar_hide{display : none}
+
+</style>
+
+</head>
+
+<body>
+
+
+<div class="pbar_size">
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 1
+ </div>
+ <div class="pbar_content">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 2
+ </div>
+ <div class="pbar_content pbar_hide">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 3
+ </div>
+ <div class="pbar_content pbar_hide">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_bottom">
+ </div>
+
+</div>
+
+
+
+
+
+
+</body>
+</html>
Added: management/design/panelBar/pbar_bg_japan.gif
===================================================================
(Binary files differ)
Property changes on: management/design/panelBar/pbar_bg_japan.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 10 months
JBoss Rich Faces SVN: r6689 - management/design/panelBar.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-03-11 09:56:35 -0400 (Tue, 11 Mar 2008)
New Revision: 6689
Added:
management/design/panelBar/panelBar_classic.html
management/design/panelBar/pbar_bg_classic.gif
Log:
Added: management/design/panelBar/panelBar_classic.html
===================================================================
--- management/design/panelBar/panelBar_classic.html (rev 0)
+++ management/design/panelBar/panelBar_classic.html 2008-03-11 13:56:35 UTC (rev 6689)
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+<title>coll_panel</title>
+<style>
+.pbar_size{
+ width : 300px;
+}
+
+.pbar_item{
+ border-top : 1px solid #c0c0c0; /*panelBorderColor*/
+ border-left : 1px solid #c0c0c0; /*panelBorderColor*/
+ border-right : 1px solid #c0c0c0; /*panelBorderColor*/
+ border-bottom : 0px;
+ font-size : 11px; /*generalSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ padding : 0px;
+}
+
+.pbar_content{
+ border-top : 1px solid #c0c0c0; /*panelBorderColor*/
+ font-family : verdana; /*generalFamilyFont*/
+ font-size : 11px; /*generalSizeFont*/
+ padding : 10px;
+ color : #000000; /*generalTextColor*/
+}
+
+.pbar_label{
+ border : 0px solid #c0c0c0; /*panelBorderColor*/
+ background-color : #C0D3F1; /*headerBackgroundColor*/
+ font-size : 11px; /*headerSizeFont*/
+ font-family : verdana; /*generalFamilyFont*/
+ color : #000000; /*headerTextColor*/
+ font-weight : bold;
+ background-image : url(pbar_bg_classic.gif); /*from headerGradientColor to headerBackgroundColor*/
+ background-position : top left;
+ background-repeat : repeat-x;
+ padding : 4px 4px 4px 10px;
+ cursor : pointer;
+ margin : 1px;
+ white-space : nowrap;
+}
+
+.pbar_bottom{
+ border-top : 1px solid #c0c0c0; /*panelBorderColor*/
+}
+.pbar_hide{display : none}
+
+</style>
+
+</head>
+
+<body>
+
+
+<div class="pbar_size">
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 1
+ </div>
+ <div class="pbar_content">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 2
+ </div>
+ <div class="pbar_content pbar_hide">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_item">
+ <div class="pbar_label">
+ Header name 3
+ </div>
+ <div class="pbar_content pbar_hide">
+ An automated testing facility is in our roadmap for the near future. This facility will generate test cases for your component as soon as you develop it. The testing framework will not just test the components, but also any other server-side or client-side functionality including JavaScript code. What is more, it will do all of this without deploying the test application into the Servlet container.
+ </div>
+ </div>
+
+ <div class="pbar_bottom">
+ </div>
+
+</div>
+
+
+
+
+
+
+</body>
+</html>
Added: management/design/panelBar/pbar_bg_classic.gif
===================================================================
(Binary files differ)
Property changes on: management/design/panelBar/pbar_bg_classic.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 10 months