JBoss Rich Faces SVN: r10428 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-09-12 07:23:31 -0400 (Fri, 12 Sep 2008)
New Revision: 10428
Modified:
trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.desc.xml
Log:
pictures for GraphValidator
Modified: trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.desc.xml 2008-09-12 11:21:03 UTC (rev 10427)
+++ trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.desc.xml 2008-09-12 11:23:31 UTC (rev 10428)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<section>
+<section id="ajaxValidator" role="new">
<sectioninfo>
<keywordset>
<keyword>rich:ajaxValidator</keyword>
16 years, 3 months
JBoss Rich Faces SVN: r10427 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-09-12 07:21:03 -0400 (Fri, 12 Sep 2008)
New Revision: 10427
Modified:
trunk/docs/userguide/en/src/main/docbook/included/beanValidator.desc.xml
Log:
pictures for GraphValidator
Modified: trunk/docs/userguide/en/src/main/docbook/included/beanValidator.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/beanValidator.desc.xml 2008-09-12 11:19:29 UTC (rev 10426)
+++ trunk/docs/userguide/en/src/main/docbook/included/beanValidator.desc.xml 2008-09-12 11:21:03 UTC (rev 10427)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<section>
+<section id="beanValidator" role="new">
<sectioninfo>
<keywordset>
<keyword>rich:beanValidator</keyword>
16 years, 3 months
JBoss Rich Faces SVN: r10426 - trunk/test-applications/jsp/src/main/webapp/DataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-09-12 07:19:29 -0400 (Fri, 12 Sep 2008)
New Revision: 10426
Modified:
trunk/test-applications/jsp/src/main/webapp/DataScroller/DataScroller.jsp
trunk/test-applications/jsp/src/main/webapp/DataScroller/DataScrollerProperty.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/DataScroller/DataScroller.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DataScroller/DataScroller.jsp 2008-09-12 11:19:18 UTC (rev 10425)
+++ trunk/test-applications/jsp/src/main/webapp/DataScroller/DataScroller.jsp 2008-09-12 11:19:29 UTC (rev 10426)
@@ -8,14 +8,14 @@
<rich:dataTable id="dataTableId" value="#{dataScroller.dataTable}"
var="dT" cellpadding="5px" rows="5" border="1" reRender="dsID,dataTableId" sortMode="#{dataScroller.sortMode}">
<f:facet name="header">
- <rich:datascroller for="dataTableId" ajaxSingle="#{dataScroller.ajaxSingle}"
+ <rich:datascroller for="dataTableId" ajaxSingle="#{dataScroller.ajaxSingle}" reRender="dataTableId"
boundaryControls="#{dataScroller.boundaryControls}"
binding="#{dataScroller.htmlDatascroller}" data="datascrData" fastStep="#{dataScroller.fastStep}" id="dsID"
page="#{dataScroller.page}" pagesVar="pages" pageIndexVar="index"
value="#{dataScroller.value}" status="a4jStatusID" stepControls="#{dataScroller.stepControls}"
eventsQueue="eventsQueue" inactiveStyle="#{style.inactiveStyle}" inactiveStyleClass="#{style.inactiveStyleClass}" selectedStyle="#{style.selectedStyle}" selectedStyleClass="#{style.selectedStyleClass}" style="#{style.style}" styleClass="#{style.styleClass}" tableStyle="#{style.tableStyle}" tableStyleClass="#{style.tableStyleClass}"
fastControls="#{dataScroller.fastControls}" action="#{dataScroller.act}" actionListener="#{dataScroller.actListener}"
- align="#{dataScroller.align}" rendered="#{dataScroller.render}"
+ align="center" rendered="#{dataScroller.render}"
limitToList="#{dataScroller.limitToList}"
renderIfSinglePage="#{dataScroller.renderIfSinglePage}"
maxPages="#{dataScroller.maxPages}"
Modified: trunk/test-applications/jsp/src/main/webapp/DataScroller/DataScrollerProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DataScroller/DataScrollerProperty.jsp 2008-09-12 11:19:18 UTC (rev 10425)
+++ trunk/test-applications/jsp/src/main/webapp/DataScroller/DataScrollerProperty.jsp 2008-09-12 11:19:29 UTC (rev 10426)
@@ -80,16 +80,5 @@
<h:selectBooleanCheckbox value="#{dataScroller.selfSorted}">
<a4j:support event="onchange" reRender="dataTableId,dsID"></a4j:support>
</h:selectBooleanCheckbox>
- </h:panelGrid>
- <br />
- <br />
- <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
- <h:panelGrid columns="2">
- <rich:column>
- <a4j:commandLink value="getPage" reRender="findID"></a4j:commandLink>
- </rich:column>
- <rich:column id="findID">
- <h:outputText value="#{rich:findComponent('dsID').page}" />
- </rich:column>
- </h:panelGrid>
+ </h:panelGrid>
</f:subview>
\ No newline at end of file
16 years, 3 months
JBoss Rich Faces SVN: r10425 - trunk/test-applications/jsp/src/main/webapp/DataGrid.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-09-12 07:19:18 -0400 (Fri, 12 Sep 2008)
New Revision: 10425
Modified:
trunk/test-applications/jsp/src/main/webapp/DataGrid/DataGrid.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/DataGrid/DataGrid.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DataGrid/DataGrid.jsp 2008-09-12 11:19:04 UTC (rev 10424)
+++ trunk/test-applications/jsp/src/main/webapp/DataGrid/DataGrid.jsp 2008-09-12 11:19:18 UTC (rev 10425)
@@ -9,15 +9,7 @@
elements="#{dataGrid.elements}" first="#{dataGrid.first}" binding="#{dataGrid.htmlDataGrid}"
dir="#{dataGrid.dir}" border="#{dataGrid.border}"
cellpadding="#{dataGrid.cellpadding}" cellspacing="#{dataGrid.cellspacing}"
- rendered="#{dataGrid.rendered}" width="#{dataGrid.width}"
- captionClass="#{style.captionClass}"
- captionStyle="#{style.captionStyle}"
- columnClasses="#{style.columnClasses}"
- footerClass="#{style.footerClass}"
- headerClass="#{style.headerClass}"
- rowClasses="#{style.rowClasses}"
- style="#{style.style}"
- styleClass="#{style.styleClass}"
+ rendered="#{dataGrid.rendered}" width="#{dataGrid.width}"
onclick="#{event.onclick}"
ondblclick="#{event.ondblclick}"
onkeydown="#{event.onkeydown}"
16 years, 3 months
JBoss Rich Faces SVN: r10424 - trunk/test-applications/jsp/src/main/webapp/DataFilterSlider.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-09-12 07:19:04 -0400 (Fri, 12 Sep 2008)
New Revision: 10424
Modified:
trunk/test-applications/jsp/src/main/webapp/DataFilterSlider/DataFilterSlider.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/DataFilterSlider/DataFilterSlider.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DataFilterSlider/DataFilterSlider.jsp 2008-09-12 11:17:53 UTC (rev 10423)
+++ trunk/test-applications/jsp/src/main/webapp/DataFilterSlider/DataFilterSlider.jsp 2008-09-12 11:19:04 UTC (rev 10424)
@@ -19,10 +19,14 @@
oncomplete="#{event.oncomplete}" ondblclick="#{event.ondblclick}"
onerror="#{event.onerror}" onkeydown="#{event.onkeydown}"
onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}"
- onmousedown="#{event.onmousedown}" onmousemove="#{event.onmousemove}"
+ onmousedown="#{event.onmousedown}" onmousemove="alert('onmousemove');"
onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}"
onmouseup="#{event.onmouseup}"
- onchange="#{event.onchange}" onslide="#{event.onslide}" submitOnSlide="true" >
+ onchange="#{event.onchange}" onslide="#{event.onslide}" submitOnSlide="true"
+ oninputkeydown="#{event.oninputkeydown}"
+ oninputkeypress="#{event.oninputkeypress}"
+ oninputkeyup="#{event.oninputkeyup}"
+ onSlideSubmit="#{event.onSlideSubmit}">
</rich:dataFilterSlider>
<h:panelGrid id="list-body">
16 years, 3 months
JBoss Rich Faces SVN: r10423 - trunk/test-applications/jsp/src/main/webapp/ContextMenu.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-09-12 07:17:53 -0400 (Fri, 12 Sep 2008)
New Revision: 10423
Modified:
trunk/test-applications/jsp/src/main/webapp/ContextMenu/ContextMenu.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/ContextMenu/ContextMenu.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ContextMenu/ContextMenu.jsp 2008-09-12 11:16:58 UTC (rev 10422)
+++ trunk/test-applications/jsp/src/main/webapp/ContextMenu/ContextMenu.jsp 2008-09-12 11:17:53 UTC (rev 10423)
@@ -5,7 +5,7 @@
<f:subview id="contextMenuSubviewID">
<h:panelGrid columns="2">
- <rich:panel style="width: 130px; height: 50px; background-color: #98FB98;">
+ <rich:panel style="width: 130px; height: 50px; background-color: #98FB98;" id="firstPanelId">
<h:outputText value="panel with contextMenu(DEFAULT)" /> <f:verbatim><br /></f:verbatim>
<h:outputText value="testing events" />
<rich:contextMenu id="contextMenuDefaultID" binding="#{contextMenu.htmlContextMenu}" submitMode="ajax" disableDefaultMenu="#{contextMenu.disableDefaultMenu}" style="#{style.style}" styleClass="#{style.styleClass}" disabledItemClass="#{style.disabledItemClass}" disabledItemStyle="#{style.disabledItemStyle}" itemClass="#{style.itemClass}" itemStyle="#{style.itemStyle}" selectItemStyle="#{style.selectItemStyle}" selectItemClass="#{style.selectItemClass}"
@@ -119,7 +119,7 @@
<f:selectItem itemLabel="select2" itemValue="select2" />
<rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
- showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}" attachTo="pgcmTestID">
<rich:menuItem icon="/pics/header.png" value="select" reRender="cmInfoID">
<f:param name="cmdParam" value="select" />
</rich:menuItem>
@@ -177,7 +177,7 @@
<h:outputText value="text1" />
</rich:tab>
<rich:tab id="t2cmTestID" label="tab2">
- <rich:contextMenu submitMode="ajax" disableDefaultMenu="#{contextMenu.disableDefaultMenu}">
+ <rich:contextMenu submitMode="ajax" disableDefaultMenu="#{contextMenu.disableDefaultMenu}" attachTo="t2cmTestID">
<rich:menuItem icon="/pics/header.png" value="tab2" reRender="cmInfoID">
<f:param name="cmdParam" value="tab2" />
</rich:menuItem>
@@ -255,7 +255,7 @@
<h:graphicImage id="gicmID" value="/pics/asus.jpg" height="125px" width="150px">
<rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
- showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}" attachTo="gicmID">
<rich:menuItem icon="/pics/header.png" value="graphicImage" reRender="cmInfoID">
<f:param name="cmdParam" value="graphicImage" />
</rich:menuItem>
@@ -296,7 +296,7 @@
<h:inputText id="itcmTestID" value="inputText">
<rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
- showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}" attachTo="itcmTestID">
<rich:menuItem icon="/pics/header.png" value="inputText" reRender="cmInfoID">
<f:param name="cmdParam" value="inputText" />
</rich:menuItem>
@@ -339,7 +339,7 @@
<h:outputText value="" />
<rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
- showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}" attachTo="pgTestID">
<rich:menuItem icon="/pics/header.png" value="panelGrid" reRender="cmInfoID">
<f:param name="cmdParam" value="panelGrid" />
</rich:menuItem>
16 years, 3 months
JBoss Rich Faces SVN: r10422 - trunk/test-applications/jsp/src/main/webapp/Columns.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-09-12 07:16:58 -0400 (Fri, 12 Sep 2008)
New Revision: 10422
Modified:
trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp
trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp 2008-09-12 11:16:32 UTC (rev 10421)
+++ trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp 2008-09-12 11:16:58 UTC (rev 10422)
@@ -10,6 +10,8 @@
</h:selectBooleanCheckbox>
<h:outputText value="rich:dataTable:" rendered="#{columns.dataTableRendered}"></h:outputText>
<h:outputText value="h:dataTable:" rendered="#{!columns.dataTableRendered}"></h:outputText>
+ <br/>
+ <h:outputText value="#{columns.text}"/>
<rich:dataTable id="richColumnsID" value="#{columns.data1}" var="d1" rendered="#{columns.dataTableRendered}">
<h:column>
@@ -32,11 +34,12 @@
</f:facet>
</rich:column>
+
<rich:columns value="#{columns.data2}" var="d2" footerClass="#{style.footerClass}" headerClass="#{style.headerClass}" breakBefore="#{columns.breakBefore}" colspan="#{columns.colspan}"
- columns="#{columns.columns}" index="index" rowspan="#{columns.rowspan}"
- begin="#{columns.begin}" end="#{columns.end}" width="#{columns.width}" style="#{style.style}" styleClass="#{style.styleClass}"
- comparator="#{columns}" sortBy="#{d2.str0}" selfSorted="true" sortOrder="#{columns.orderings[index]}" dir="LTR" filterBy="#{d1.str0}"
- filterValue="#{columns.filterValue[index]}" filterMethod="#{columns.filterMethod}" filterEvent="#{columns.filterEvent}">
+ columns="#{columns.columns}" index="index" rowspan="#{columns.rowspan}" begin="#{columns.begin}" end="#{columns.end}" width="#{columns.width}" style="#{style.style}" styleClass="#{style.styleClass}"
+ sortOrder="#{columns.orderings[index]}" sortBy="#{d1.str0}"
+ filterBy="#{d1.str0}"
+ filterValue="#{columns.filterValue[index]}" filterMethod="#{columns.filterMethod}">
<f:facet name="header">
<h:outputText value="header #{d2.int0}"></h:outputText>
</f:facet>
Modified: trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp 2008-09-12 11:16:32 UTC (rev 10421)
+++ trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp 2008-09-12 11:16:58 UTC (rev 10422)
@@ -50,11 +50,6 @@
<h:inputText value="#{columns.width}" onchange="submit();">
</h:inputText>
- <h:outputText value="filterEvent" />
- <h:selectOneMenu value="#{columns.filterEvent}" onchange="submit();">
- <f:selectItems value="#{columns.filterEvents}"/>
- </h:selectOneMenu>
-
<h:outputText value="breakBefore:"></h:outputText>
<h:selectBooleanCheckbox value="#{columns.breakBefore}" onchange="submit();">
</h:selectBooleanCheckbox>
16 years, 3 months
JBoss Rich Faces SVN: r10421 - trunk/test-applications/jsp/src/main/java/columns.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-09-12 07:16:32 -0400 (Fri, 12 Sep 2008)
New Revision: 10421
Modified:
trunk/test-applications/jsp/src/main/java/columns/Columns.java
Log:
Modified: trunk/test-applications/jsp/src/main/java/columns/Columns.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/columns/Columns.java 2008-09-12 11:04:28 UTC (rev 10420)
+++ trunk/test-applications/jsp/src/main/java/columns/Columns.java 2008-09-12 11:16:32 UTC (rev 10421)
@@ -2,22 +2,12 @@
import java.util.ArrayList;
import java.util.Comparator;
-import java.util.Map;
-import javax.faces.model.SelectItem;
+import javax.faces.context.FacesContext;
-import org.richfaces.component.UIColumn;
-import org.richfaces.component.UIComboBox;
-import org.richfaces.component.UIComponentControl;
-import org.richfaces.component.UIContextMenu;
-import org.richfaces.component.UIDataDefinitionList;
-import org.richfaces.component.UIDataFltrSlider;
-import org.richfaces.component.UIDataList;
-import org.richfaces.component.UIDatascroller;
import org.richfaces.model.Ordering;
+import org.richfaces.renderkit.html.images.GradientType;
-import orderingList.OrderingList;
-
import util.data.Data;
public class Columns implements Comparator{
@@ -42,14 +32,14 @@
private String[] filterValue;
private String filterInput;
private String filterEvent;
- private ArrayList<SelectItem> filterEvents;
+ private String text;
- public ArrayList<SelectItem> getFilterEvents() {
- return filterEvents;
+ public String getText() {
+ return text;
}
- public void setFilterEvents(ArrayList<SelectItem> filterEvents) {
- this.filterEvents = filterEvents;
+ public void setText(String text) {
+ this.text = text;
}
public String getFilterEvent() {
@@ -102,11 +92,8 @@
this.data1 = new ArrayList<Data>();
this.data2 = new ArrayList<Data>();
this.filterValue = new String[length2];
- this.filterEvent = "onchange";
- this.filterEvents = new ArrayList<SelectItem>();
- filterEvents.add(new SelectItem("onchange", "onchange"));
- filterEvents.add(new SelectItem("onkeyup", "onkeyup"));
- filterEvents.add(new SelectItem("ondbclick", "ondbclick"));
+ this.filterEvent = "onchange";
+ this.text = " locale: " + FacesContext.getCurrentInstance().getViewRoot().getLocale();
for (int i = 0; i < length1; i++) {
data1.add(new Data(i, "data 1 [" + i + "]", "Button " + i, "Link " + i, "select" + (i % 5)));
data2.add(new Data(i, "data 2 [" + i + "]", "Button " + i, "Link " + i, statusIcon[i % 5]));
16 years, 3 months
JBoss Rich Faces SVN: r10420 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-09-12 07:04:28 -0400 (Fri, 12 Sep 2008)
New Revision: 10420
Added:
trunk/docs/userguide/en/src/main/resources/images/graphValidator11.png
trunk/docs/userguide/en/src/main/resources/images/graphValidator12.png
Log:
pictures for GraphValidator
Added: trunk/docs/userguide/en/src/main/resources/images/graphValidator11.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/graphValidator11.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/graphValidator12.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/graphValidator12.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 3 months
JBoss Rich Faces SVN: r10419 - 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-09-12 06:04:32 -0400 (Fri, 12 Sep 2008)
New Revision: 10419
Added:
trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
Removed:
trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java
Modified:
trunk/ui/columns/src/main/config/component/columns.xml
Log:
RF-4348
Modified: trunk/ui/columns/src/main/config/component/columns.xml
===================================================================
--- trunk/ui/columns/src/main/config/component/columns.xml 2008-09-12 09:55:45 UTC (rev 10418)
+++ trunk/ui/columns/src/main/config/component/columns.xml 2008-09-12 10:04:32 UTC (rev 10419)
@@ -20,7 +20,7 @@
<test/>
</tag>
<taghandler generate="false">
- <classname>org.richfaces.taglib.ComponentHandler</classname>
+ <classname>org.richfaces.taglib.ColumnsHandler</classname>
</taghandler>
&ui_data_attributes;
&attributes;
Copied: trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java (from rev 10397, trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java)
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java (rev 0)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2008-09-12 10:04:32 UTC (rev 10419)
@@ -0,0 +1,411 @@
+/*
+ * 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 ColumnsHandler 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 ColumnsHandler(ComponentConfig config) {
+ super(config);
+ handler = new ColumnTagHandler(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 {
+ Object o = begin.getObject(ctx);
+ if (o instanceof Number) {
+ _begin = ((Number)o).intValue();
+ }else if (o instanceof String) {
+ _begin = Integer.parseInt((String) o);
+ }
+ _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 {
+ Object o = end.getObject(ctx);
+ if (o instanceof Number) {
+ _end = ((Number)o).intValue();
+ }else if ( o instanceof String) {
+ _end = Integer.parseInt((String) o);
+ }
+ 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;
+ }
+
+}
Deleted: trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java 2008-09-12 09:55:45 UTC (rev 10418)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ComponentHandler.java 2008-09-12 10:04:32 UTC (rev 10419)
@@ -1,411 +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.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 ColumnTagHandler(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 {
- Object o = begin.getObject(ctx);
- if (o instanceof Number) {
- _begin = ((Number)o).intValue();
- }else if (o instanceof String) {
- _begin = Integer.parseInt((String) o);
- }
- _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 {
- Object o = end.getObject(ctx);
- if (o instanceof Number) {
- _end = ((Number)o).intValue();
- }else if ( o instanceof String) {
- _end = Integer.parseInt((String) o);
- }
- 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, 3 months