JBoss Rich Faces SVN: r17226 - in root/examples/richfaces-showcase/trunk: src/main/java/org/richfaces/demo/tables/data/carstore and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-05-25 04:45:36 -0400 (Tue, 25 May 2010)
New Revision: 17226
Added:
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/tableStyling.xhtml
Modified:
root/examples/richfaces-showcase/trunk/pom.xml
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/carstore/InventoryVendorList.java
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/component-sample.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/simpleTable.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/extendedDataTable/simpleTable.xhtml
Log:
https://jira.jboss.org/browse/RF-8298
Modified: root/examples/richfaces-showcase/trunk/pom.xml
===================================================================
--- root/examples/richfaces-showcase/trunk/pom.xml 2010-05-25 08:02:50 UTC (rev 17225)
+++ root/examples/richfaces-showcase/trunk/pom.xml 2010-05-25 08:45:36 UTC (rev 17226)
@@ -47,6 +47,11 @@
<artifactId>tables-ui</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui-sandbox</groupId>
+ <artifactId>datascroller-ui</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<build>
Modified: root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/carstore/InventoryVendorList.java
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/carstore/InventoryVendorList.java 2010-05-25 08:02:50 UTC (rev 17225)
+++ root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/carstore/InventoryVendorList.java 2010-05-25 08:45:36 UTC (rev 17226)
@@ -6,11 +6,19 @@
public class InventoryVendorList {
private String vendor;
private List<InventoryVendorItem> vendorItems;
-
+
+ public long getCount() {
+ if (vendorItems != null) {
+ return vendorItems.size();
+ } else {
+ return 0;
+ }
+ }
+
public InventoryVendorList() {
vendorItems = new ArrayList<InventoryVendorItem>();
}
-
+
public String getVendor() {
return vendor;
}
Modified: root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-05-25 08:02:50 UTC (rev 17225)
+++ root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-05-25 08:45:36 UTC (rev 17226)
@@ -182,6 +182,15 @@
<name>Data Table Basic</name>
</sample>
<sample>
+ <id>tableStyling</id>
+ <name>Data Table Styling</name>
+ <description>
+ <!-- TODO: rowClass should appears at this sample after completion -->
+ <!-- TODO: rowClasses should be used instead of jQuerry selectors after will works -->
+ <!-- TODO: onrowmouseover, onrowmouseout - should be used instead of jQuery selector -->
+ </description>
+ </sample>
+ <sample>
<id>tableSorting</id>
<name>Data Table Sorting</name>
</sample>
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/component-sample.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/component-sample.xhtml 2010-05-25 08:02:50 UTC (rev 17225)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/component-sample.xhtml 2010-05-25 08:45:36 UTC (rev 17226)
@@ -10,6 +10,7 @@
<f:metadata>
<f:viewParam name="sample" value="#{demoNavigator.sample}" />
<f:viewParam name="demo" value="#{demoNavigator.demo}" />
+ <f:viewParam name="skin" value="#{skinBean.skin}"/>
</f:metadata>
</ui:define>
<ui:define name="body">
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/simpleTable.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/simpleTable.xhtml 2010-05-25 08:02:50 UTC (rev 17225)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/simpleTable.xhtml 2010-05-25 08:45:36 UTC (rev 17226)
@@ -4,9 +4,16 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
- xmlns:tbl="http://richfaces.org/rich">
+ xmlns:tbl="http://richfaces.org/rich"
+ xmlns:ds="http://richfaces.org/datascroller">
<ui:composition>
+<p>This sample shows simple master-detail table implemented using<b> rich:dataTable</b> and<b> rich:subtable</b> components</p>
+<p>There is one feature which is completely new for 4.x - subtables now could be collapsed/expanded by using
+new component <b>rich:tableToggleControl</b></p>
+<p>subTable's could be collapsed/expanded in different modes defined via subTable expandMode attribute
+- "<i>client</i>", "<i>ajax</i>" and "<i>server</i>"</p>
+<p>Also the developer could get control on states of subTables using its <b>expanded</b> attribute.</p>
<h:form>
<tbl:dataTable value="#{carsBean.inventoryVendorLists}" var="list">
<f:facet name="header">
@@ -36,8 +43,16 @@
</f:facet>
<tbl:column colspan="6">
<h:outputText value="#{list.vendor}" />
+ <tbl:toggleControl for="sbtbl">
+ <f:facet name="expand">
+ <a href="#">(show details)</a>
+ </f:facet>
+ <f:facet name="collapse">
+ <a href="#">(hide details)</a>
+ </f:facet>
+ </tbl:toggleControl>
</tbl:column>
- <tbl:subTable value="#{list.vendorItems}" var="item">
+ <tbl:subTable value="#{list.vendorItems}" var="item" id="sbtbl" expandMode="client">
<tbl:column>
<h:outputText value="#{item.model}" />
</tbl:column>
@@ -56,6 +71,9 @@
<tbl:column>
<h:outputText value="#{item.daysLive}" />
</tbl:column>
+ <f:facet name="footer">
+ <h:outputText value="Total of #{list.vendor} Cars: #{list.count}" />
+ </f:facet>
</tbl:subTable>
</tbl:dataTable>
</h:form>
Added: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/tableStyling.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/tableStyling.xhtml (rev 0)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/tableStyling.xhtml 2010-05-25 08:45:36 UTC (rev 17226)
@@ -0,0 +1,84 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:tbl="http://richfaces.org/rich"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+
+<ui:composition>
+<style>
+.stable tr:nth-child(even){
+ background-color: #FCFFFE;
+}
+.stable tr:nth-child(odd){
+ background-color: #ECF3FE;
+}
+.active-row{
+ background-color: #FFEBDA !important;
+ cursor:pointer;
+}
+</style>
+ <p>This sample shows simple table styling. The table appears in zebra-style and has
+ highlighting of hovered row.</p>
+ <h:form id="form">
+ <tbl:dataTable value="#{carsBean.allInventoryItems}" var="car"
+ id="table" rows="20" rowClasses = "odd-row, even-row" styleClass="stable">
+ <tbl:column accept="#{carsFiteringBean.acceptVendor}">
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="Vendor " />
+ <h:selectOneMenu value="#{carsFilteringBean.vendorFilter}">
+ <f:selectItems value="#{carsBean.vendorOptions}" />
+ <a4j:ajax render="form:table" execute="@this" event="change"/>
+ </h:selectOneMenu>
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{car.vendor}" />
+ </tbl:column>
+ <tbl:column>
+ <f:facet name="header">
+ <h:outputText value="Model" />
+ </f:facet>
+ <h:outputText value="#{car.model}" />
+ </tbl:column>
+ <tbl:column>
+ <f:facet name="header">
+ <h:outputText value="Price" />
+ </f:facet>
+ <h:outputText value="#{car.price}" />
+ </tbl:column>
+ <tbl:column filter="#{carsFilteringBean.mileageFilterImpl}">
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="Mileage < " />
+ <h:inputText value="#{carsFilteringBean.mileageFilter}">
+ <f:convertNumber groupingUsed="true"/>
+ <f:validateLongRange maximum="500000"/>
+ <a4j:ajax event="blur" render="form:table" execute="@this" />
+ </h:inputText>
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{car.mileage}" />
+ </tbl:column>
+ <tbl:column
+ filterExpression="#{fn:containsIgnoreCase(car.vin,carFilteringBean.vinFilter)}">
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="VIN " />
+ <h:inputText value="#{carFilteringBean.vinFilter}">
+ <a4j:ajax event="blur" render="form:table" execute="@this" />
+ </h:inputText>
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{car.vin}" />
+ </tbl:column>
+ </tbl:dataTable>
+ </h:form>
+ <script>
+ $('.stable tr').mouseover(function(){$(this).addClass('active-row')});
+ $('.stable tr').mouseout(function(){$(this).removeClass('active-row')});
+</script>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/extendedDataTable/simpleTable.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/extendedDataTable/simpleTable.xhtml 2010-05-25 08:02:50 UTC (rev 17225)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/extendedDataTable/simpleTable.xhtml 2010-05-25 08:45:36 UTC (rev 17226)
@@ -9,7 +9,7 @@
<ui:composition>
<h:form>
<tbl:extendedDataTable value="#{carsBean.allInventoryItems}" var="car"
- id="table" frozenColumns="2" style="height:300px; width:500px;">
+ id="table" frozenColumns="2" style="height:300px; width:500px;" rowClasses="qwe, qe">
<f:facet name="header">
<h:outputText value="Cars marketplace" />
</f:facet>
14 years, 1 month
JBoss Rich Faces SVN: r17225 - in root/ui-sandbox/tables/trunk: ui/src/main/java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-25 04:02:50 -0400 (Tue, 25 May 2010)
New Revision: 17225
Modified:
root/ui-sandbox/tables/trunk/api/src/main/java/org/richfaces/component/Row.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/RowHolder.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/tables.taglib.xml
Log:
rename colGroup to columnGroup (RF-8678), fix ColumnGroup rendering (RF-8679), fix html encoding
Modified: root/ui-sandbox/tables/trunk/api/src/main/java/org/richfaces/component/Row.java
===================================================================
--- root/ui-sandbox/tables/trunk/api/src/main/java/org/richfaces/component/Row.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/api/src/main/java/org/richfaces/component/Row.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -41,7 +41,9 @@
public Iterator<UIComponent> columns();
public void setRowKey(FacesContext context, Object rowKey);
-
+
+ public String getClientId(FacesContext context);
+
public void walk(FacesContext context, DataVisitor visitor, Object argument);
}
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -24,10 +24,10 @@
import java.io.IOException;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import javax.faces.view.facelets.FaceletException;
import org.ajax4jsf.model.DataVisitResult;
import org.ajax4jsf.model.DataVisitor;
@@ -40,34 +40,43 @@
*/
public abstract class AbstractRowsRenderer extends RendererBase implements DataVisitor {
- public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
+ public DataVisitResult process(FacesContext facesContext, Object rowKey, Object argument) {
RowHolderBase holder = (RowHolderBase) argument;
Row row = holder.getRow();
- row.setRowKey(context, rowKey);
+ row.setRowKey(facesContext, rowKey);
+
try {
- encodeRow(holder);
+ ResponseWriter writer = facesContext.getResponseWriter();
+ encodeRow(writer, facesContext, holder);
} catch (IOException e) {
- throw new FaceletException(e);
+ throw new FacesException(e);
}
holder.nextRow();
return DataVisitResult.CONTINUE;
}
- protected void encodeRows(RowHolderBase rowHolder) throws IOException {
- rowHolder.getRow().walk(rowHolder.getContext(), this, rowHolder);
+ protected void encodeRows(FacesContext facesContext, RowHolderBase rowHolder) {
+ rowHolder.getRow().walk(facesContext, this, rowHolder);
}
- public abstract void encodeRow(RowHolderBase rowHolder) throws IOException;
+ public abstract void encodeRow(ResponseWriter writer, FacesContext facesContext, RowHolderBase rowHolder) throws IOException;
@Override
- protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component)
- throws IOException {
- RowHolderBase rowHolder = createRowHolder(context, component);
- encodeRows(rowHolder);
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext facesContext, UIComponent component) throws IOException {
+ RowHolderBase rowHolder = createRowHolder(facesContext, component);
+ encodeBeforeRows(writer, facesContext, rowHolder);
+ encodeRows(facesContext, rowHolder);
+ encodeAfterRows(writer, facesContext, rowHolder);
}
public abstract RowHolderBase createRowHolder(FacesContext context, UIComponent component);
+ public void encodeBeforeRows(ResponseWriter writer, FacesContext facesContext, RowHolderBase rowHolder) throws IOException {
+ }
+
+ public void encodeAfterRows(ResponseWriter writer, FacesContext facesContext, RowHolderBase rowHolder) throws IOException {
+ }
+
protected boolean isEmpty(String style) {
return !((style != null) && (style.trim().length() != 0));
}
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -33,7 +33,6 @@
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.Row;
-import org.richfaces.component.UIDataTableBase;
public abstract class AbstractTableBaseRenderer extends DataTableRowsRenderer {
@@ -47,47 +46,42 @@
public static final String CELL_ELEMENT_KEY = "cellElement";
- public RowHolder encodeColumn(FacesContext context, UIColumn component, ResponseWriter writer, RowHolder holder) throws IOException {
+ public RowHolder encodeColumn(FacesContext context, ResponseWriter writer, UIColumn component, RowHolder rowHolder) throws IOException {
+
+ String parentId = rowHolder.getBaseClientId();
- String parentId = holder.getDataTableId();
-
if (component instanceof org.richfaces.component.UIColumn) {
Map<String, Object> attributes = component.getAttributes();
- if (Boolean.TRUE.equals(attributes.get("breakBefore")) && holder.getProcessCell() != 0) {
+ if (Boolean.TRUE.equals(attributes.get("breakBefore")) && rowHolder.getProcessCell() != 0) {
encodeRowEnd(writer, context, component);
- holder.nextRow();
- holder.setRowStart(true);
+ rowHolder.remove();
+ rowHolder.nextRow();
+ rowHolder.setRowStart(true);
}
}
- if (holder.isRowStart()) {
- if (holder.getCurrentRow() == 0) {
+ if (rowHolder.isRowStart()) {
+ if (rowHolder.getCurrentRow() == 0) {
encodeFirstRowStart(writer, context, parentId, component);
} else {
encodeRowStart(writer, context, parentId, component);
}
-
- holder.setRowStart(false);
+ rowHolder.add(HTML.TR_ELEMENT);
+ rowHolder.setRowStart(false);
}
encodeColumnStart(writer, context, parentId, component);
renderChildren(context, component);
encodeColumnEnd(writer, context, parentId, component);
- if (holder.isLastColumn()) {
- if (holder.getCurrentRow() == 0) {
- encodeFirstRowEnd(writer, context, component);
- } else {
- encodeRowEnd(writer, context, component);
- }
- }
- holder.nextCell();
+ rowHolder.nextCell();
- return holder;
+ return rowHolder;
}
public void encodeColumnStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
- writer.startElement(getCellElement(context, parentId), component);
+ String element = getCellElement(context, parentId);
+ writer.startElement(element, component);
getUtils().encodeId(context, component);
String cellClass = getCellClass(context, parentId);
encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, cellClass);
@@ -107,50 +101,12 @@
}
}
- @Override
- protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
-
- if(component instanceof UIDataTableBase) {
- UIDataTableBase dataTable = (UIDataTableBase)component;
- int rowCount = dataTable.getRowCount();
- if(rowCount > 0) {
- super.doEncodeChildren(writer, context, component);
- } else {
- int columns = getColumnsCount(dataTable.columns());
-
- writer.startElement(HTML.TR_ELEMENT, dataTable);
- writer.startElement(HTML.TD_ELEM, dataTable);
- writer.writeAttribute("colspan", columns, null);
-
- String styleClass = (String)dataTable.getAttributes().get("noDataStyleClass");
- styleClass = styleClass != null ? "rich-nodata-cell " + styleClass : "rich-nodata-cell";
-
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, styleClass, null);
-
- UIComponent noDataFacet = dataTable.getNoData();
- if(noDataFacet != null && noDataFacet.isRendered() ) {
- noDataFacet.encodeAll(context);
- } else {
- String noDataLabel = dataTable.getNoDataLabel();
- if(noDataLabel != null) {
- writer.writeText(noDataLabel, "noDataLabel");
- }
- }
-
- writer.endElement(HTML.TD_ELEM);
- writer.endElement(HTML.TR_ELEMENT);
- }
- }
-
- }
-
public void encodeColumnEnd(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
writer.endElement(getCellElement(context, parentId));
}
public void encodeFirstRowStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
writer.startElement(HTML.TR_ELEMENT, component);
-// getUtils().encodeId(context, component);
String styleClass = getFirstRowClass(context, parentId);
encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, styleClass);
}
@@ -161,7 +117,6 @@
public void encodeRowStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
writer.startElement(HTML.TR_ELEMENT, component);
-// getUtils().encodeId(context, component);
String styleClass = getRowClass(context, parentId);
encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, styleClass);
}
@@ -169,7 +124,6 @@
public void encodeRowEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
writer.endElement(HTML.TR_ELEMENT);
}
-
protected String getFirstRowClass(FacesContext context, String id) {
return get(context, id + FIRST_ROW_CLASS_KEY);
@@ -291,7 +245,4 @@
}
return count;
}
-
-
-
}
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -125,6 +125,44 @@
encodeTableFacets(writer, context, dataTable);
}
+ @Override
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+
+ if(component instanceof UIDataTableBase) {
+ UIDataTableBase dataTable = (UIDataTableBase)component;
+ int rowCount = dataTable.getRowCount();
+ if(rowCount > 0) {
+ super.doEncodeChildren(writer, context, component);
+ } else {
+ int columns = getColumnsCount(dataTable.columns());
+
+ writer.startElement(HTML.TR_ELEMENT, dataTable);
+ writer.startElement(HTML.TD_ELEM, dataTable);
+ writer.writeAttribute("colspan", columns, null);
+
+ String styleClass = (String)dataTable.getAttributes().get("noDataStyleClass");
+ styleClass = styleClass != null ? "rich-nodata-cell " + styleClass : "rich-nodata-cell";
+
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, styleClass, null);
+
+ UIComponent noDataFacet = dataTable.getNoData();
+ if(noDataFacet != null && noDataFacet.isRendered() ) {
+ noDataFacet.encodeAll(context);
+ } else {
+ String noDataLabel = dataTable.getNoDataLabel();
+ if(noDataLabel != null) {
+ writer.writeText(noDataLabel, "noDataLabel");
+ }
+ }
+
+ writer.endElement(HTML.TD_ELEM);
+ writer.endElement(HTML.TR_ELEMENT);
+ }
+ }
+
+ }
+
+
public void encodeTableStart(ResponseWriter writer, FacesContext context, UIDataTableBase component) throws IOException {
writer.startElement(HTML.TABLE_ELEMENT, component);
writer.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(), null);
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -37,23 +37,19 @@
public class ColumnGroupRenderer extends AbstractTableBaseRenderer {
@Override
- public void encodeRow(RowHolderBase holder) throws IOException {
+ public void encodeRow(ResponseWriter writer, FacesContext facesContext, RowHolderBase holder) throws IOException {
RowHolder rowHolder = (RowHolder) holder;
-
+
UIColumnGroup row = (UIColumnGroup)rowHolder.getRow();
rowHolder.setRowStart(true);
Iterator<UIComponent> components = row.columns();
- FacesContext context = rowHolder.getContext();
- ResponseWriter writer = context.getResponseWriter();
-
+
while(components.hasNext()){
- UIComponent component = components.next();
- rowHolder.lastColumn(!components.hasNext());
- rowHolder = encodeColumn(context, (UIColumn)component, writer, rowHolder);
+ encodeColumn(facesContext, writer, (UIColumn)components.next(),rowHolder);
}
}
-
+
@Override
public RowHolderBase createRowHolder(FacesContext context, UIComponent component) {
UIComponent parent = component.getParent();
@@ -64,7 +60,9 @@
if(parent == null) {
throw new AbortProcessingException("UIColumnGroup should be a child of UIDataTable or UISubTable");
}
-
- return new RowHolder(context, parent.getClientId(context),(UIColumnGroup)component);
+
+ RowHolder rowHolder = new RowHolder(context, (UIColumnGroup)component);
+ rowHolder.setBaseClientId(parent.getClientId());
+ return rowHolder;
}
}
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -73,61 +73,81 @@
}
}
-
@Override
public RowHolder createRowHolder(FacesContext context, UIComponent component) {
return new RowHolder(context, (UIDataTable)component);
}
- public void encodeRow(RowHolderBase holder) throws IOException {
-
- FacesContext context = holder.getContext();
+ @Override
+ public void encodeBeforeRows(ResponseWriter writer, FacesContext facesContext, RowHolderBase holder) throws IOException {
+ RowHolder rowHolder = (RowHolder)holder;
+ Row row = rowHolder.getRow();
+
+ if(!containRowChildren((UIDataTable)row)) {
+ encodeTableBodyStart(writer, facesContext, (UIDataTableBase)row);
+ rowHolder.add(HTML.TBODY_ELEMENT);
+ }
+ }
+
+ @Override
+ public void encodeAfterRows(ResponseWriter writer, FacesContext facesContext, RowHolderBase holder) throws IOException {
+ RowHolder rowHolder = (RowHolder)holder;
+ Row row = rowHolder.getRow();
+ if(!rowHolder.isEmpty()) {
+ encodeTableBodyEnd(writer, facesContext, (UIDataTable)row);
+ }
+ }
+
+ public void encodeRow(ResponseWriter writer, FacesContext context, RowHolderBase holder) throws IOException {
+
+ RowHolder rowHolder = (RowHolder)holder;
+ Row row = rowHolder.getRow();
+
+ if(rowHolder.isEmpty()) {
+ encodeTableBodyStart(writer, context, (UIDataTable)row);
+ rowHolder.add(HTML.TBODY_ELEMENT);
+ }
- RowHolder rowHolder = (RowHolder)holder;
-
rowHolder.setRowStart(true);
- rowHolder.resetProcessCell();
-
- Row row = rowHolder.getRow();
-
- ResponseWriter writer = context.getResponseWriter();
- encodeTableBodyStart(writer, context, (UIDataTable) row);
-
Iterator<UIComponent> components = row.columns();
while (components.hasNext()) {
-
UIComponent child = components.next();
- if (child instanceof Row) {
- encodeTableBodyEnd(writer, context, (UIDataTable) row);
+ if(child instanceof Row) {
+ if(HTML.TR_ELEMENT.equals(rowHolder.getCurrentElement())) {
+ encodeRowEnd(writer, context, child);
+ rowHolder.remove();
+ }
+
+ if(HTML.TBODY_ELEMENT.equals(rowHolder.getCurrentElement())) {
+ encodeTableBodyEnd(writer, context, (UIDataTable)row);
+ rowHolder.remove();
+ }
child.encodeAll(context);
- if (components.hasNext()) {
- encodeTableBodyStart(writer, context, (UIDataTable) row);
+ } else if (child instanceof UIColumn) {
+ rowHolder = encodeColumn(context, writer, (UIColumn) child, rowHolder);
+ if(!components.hasNext()) {
+ encodeRowEnd(writer, context, (UIColumn)child);
+ rowHolder.remove();
}
- } else if (child instanceof UIColumn) {
- rowHolder.lastColumn(!components.hasNext());
- rowHolder = encodeColumn(context, (UIColumn)child, writer, rowHolder);
- }
+ }
}
-
- encodeTableBodyEnd(writer, context, (UIDataTableBase) row);
}
-
- /*
- * public void encodeHiddenInput(FacesContext context, ResponseWriter writer, UIDataTableBase dataTable) throws
- * IOException {
- *
- * String hiddenId = dataTable.getClientId(context) + ":" + "hidden";
- *
- * writer.startElement(HTML.INPUT_ELEM, dataTable); writer.writeAttribute(HTML.ID_ATTRIBUTE, hiddenId, null);
- * writer.writeAttribute(HTML.TYPE_ATTR,"hidden", null); writer.endElement(HTML.INPUT_ELEM);
- *
- * }
- */
-
+
+
+ protected boolean containRowChildren(UIDataTable dataTable) {
+ Iterator<UIComponent> iterator = dataTable.columns();
+ while (iterator.hasNext()) {
+ UIComponent child = iterator.next();
+ if(child instanceof Row) {
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
-
if (!shouldProceed(component)) {
return;
}
@@ -419,5 +439,4 @@
protected void setupTableStartElement(FacesContext context, UIComponent component) {
put(context, component.getClientId(context), CELL_ELEMENT_KEY, HTML.TH_ELEM);
}
-
}
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -408,7 +408,7 @@
writer.startElement(HTML.TBODY_ELEMENT, table);
writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":tb"
+ partName.toString().charAt(0), null);
- encodeRows(state);
+ encodeRows(context, state);
writer.endElement(HTML.TBODY_ELEMENT);
writer.endElement(HTML.TABLE_ELEMENT);
@@ -512,7 +512,7 @@
try {
writer.updateAttributes(ids.remove(0), attributes);
writer.startUpdate(id);
- encodeRow(state);
+ encodeRow(writer, context, state);
writer.endUpdate();
} catch (IOException e) {
throw new FacesException(e);
@@ -688,16 +688,14 @@
}
@Override
- public void encodeRow(RowHolderBase rowHolder) throws IOException {
- FacesContext context = rowHolder.getContext();
- ResponseWriter writer = context.getResponseWriter();
+ public void encodeRow(ResponseWriter writer, FacesContext facesContext, RowHolderBase rowHolder) throws IOException {
RendererState state = (RendererState) rowHolder;
UIDataTableBase table = state.getRow();
writer.startElement(HTML.TR_ELEMENT, table);
Iterator<UIComponent> columns = null;
Part part = state.getPart();
writer.writeAttribute(HTML.ID_ATTRIBUTE,
- table.getClientId(context) + ":" + part.getName().toString().charAt(0), null);
+ table.getClientId(facesContext) + ":" + part.getName().toString().charAt(0), null);
columns = part.getColumns().iterator();
while (columns.hasNext()) {
UIComponent column = (UIComponent) columns.next();
@@ -708,7 +706,7 @@
+ column.getId(), null);
writer.startElement(HTML.DIV_ELEM, column);
writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-cell-content", null);
- renderChildren(context, column);
+ renderChildren(facesContext, column);
writer.endElement(HTML.DIV_ELEM);
writer.endElement(HTML.DIV_ELEM);
writer.endElement(HTML.TD_ELEM);
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/RowHolder.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/RowHolder.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/RowHolder.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -22,7 +22,8 @@
package org.richfaces.renderkit;
-import javax.faces.component.UIComponent;
+import java.util.LinkedList;
+
import javax.faces.context.FacesContext;
import org.richfaces.component.Row;
@@ -32,47 +33,55 @@
private Row row;
private int processCell;
+
+ private String baseClientId;
+
+ private boolean isRowStart;
+
+ private LinkedList<String> elements;
- private String dataTableId;
-
- private boolean isLastColumn;
-
- private boolean isRowStart;
-
-
+
public RowHolder(FacesContext context, Row row) {
- this(context, row, 0, true, ((UIComponent)row).getClientId(context));
+ this(context, row, 0, true);
}
-
- public RowHolder(FacesContext context, String dataTableId, Row row) {
- this(context, row, 0, true, dataTableId);
- }
-
- public RowHolder(FacesContext context, Row row, int processCell, boolean isRowStart, String dataTableId) {
+ public RowHolder(FacesContext context, Row row, int processCell, boolean isRowStart) {
super(context);
this.row = row;
this.processCell = processCell;
- this.isRowStart = isRowStart;
- this.dataTableId = dataTableId;
+ this.baseClientId = row.getClientId(context);
+ this.elements = new LinkedList<String>();
}
+
+ public String remove() {
+ return elements.pop();
+ }
+ public void add(String htmlTag) {
+ elements.push(htmlTag);
+ }
- public Row getRow() {
- return this.row;
+ public String getCurrentElement() {
+ return elements.getFirst();
}
+
+ public boolean isEmpty() {
+ return elements.isEmpty();
+ }
- public String getDataTableId() {
- return dataTableId;
+ public String getBaseClientId() {
+ return baseClientId;
}
- public void setDataTableId(String dataTableId) {
- this.dataTableId = dataTableId;
+ public void setBaseClientId(String baseClientId) {
+ this.baseClientId = baseClientId;
}
+
+ public Row getRow() {
+ return this.row;
+ }
-
-
public int getProcessCell() {
return processCell;
}
@@ -81,18 +90,10 @@
this.processCell = 0;
}
- public void nextCell(){
- processCell++;
+ public int nextCell(){
+ return processCell++;
}
-
- public boolean isLastColumn() {
- return isLastColumn;
- }
-
- public void lastColumn(boolean lastColumn) {
- this.isLastColumn = lastColumn;
- }
-
+
public boolean isRowStart() {
return isRowStart;
}
@@ -100,5 +101,4 @@
public void setRowStart(boolean isRowStart) {
this.isRowStart = isRowStart;
}
-
}
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-05-25 08:02:50 UTC (rev 17225)
@@ -100,18 +100,19 @@
}
@Override
- public void encodeRow(RowHolderBase holder) throws IOException {
+ public void encodeRow(ResponseWriter writer, FacesContext context, RowHolderBase holder) throws IOException {
RowHolder rowHolder = (RowHolder)holder;
Row row = rowHolder.getRow();
+
+ rowHolder.setRowStart(true);
Iterator<UIComponent> components = row.columns();
- FacesContext context = rowHolder.getContext();
- ResponseWriter writer = context.getResponseWriter();
-
while(components.hasNext()) {
- UIColumn column = (UIColumn)components.next();
- rowHolder.lastColumn(!components.hasNext());
- encodeColumn(context, column, writer, rowHolder);
+ encodeColumn(context, writer, (UIColumn)components.next(), rowHolder);
}
+
+ if(!rowHolder.isEmpty()) {
+ encodeRowEnd(writer, context, (UISubTable)row);
+ }
}
@Override
Modified: root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/tables.taglib.xml
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/tables.taglib.xml 2010-05-24 22:53:25 UTC (rev 17224)
+++ root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/tables.taglib.xml 2010-05-25 08:02:50 UTC (rev 17225)
@@ -25,7 +25,7 @@
</tag>
<tag>
- <tag-name>colGroup</tag-name>
+ <tag-name>columnGroup</tag-name>
<component>
<component-type>org.richfaces.ColumnGroup</component-type>
<renderer-type>org.richfaces.ColumnGroupRenderer</renderer-type>
14 years, 1 month
JBoss Rich Faces SVN: r17224 - in root/commons/trunk: api and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-24 18:53:25 -0400 (Mon, 24 May 2010)
New Revision: 17224
Modified:
root/commons/trunk/api/pom.xml
root/commons/trunk/bom/pom.xml
root/commons/trunk/parent/pom.xml
root/commons/trunk/pom.xml
Log:
Updates to prep for release plugin
Modified: root/commons/trunk/api/pom.xml
===================================================================
--- root/commons/trunk/api/pom.xml 2010-05-24 22:53:06 UTC (rev 17223)
+++ root/commons/trunk/api/pom.xml 2010-05-24 22:53:25 UTC (rev 17224)
@@ -18,16 +18,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.richfaces.commons</groupId>
<artifactId>richfaces-commons-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
-
- <modelVersion>4.0.0</modelVersion>
+
<groupId>org.richfaces.commons</groupId>
<artifactId>richfaces-commons-api</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
<name>RichFaces Commons API</name>
<dependencies>
@@ -70,4 +71,10 @@
</plugin>
</plugins>
</build>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/trunk/api</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/trunk/api</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/commons/trunk/api</url>
+ </scm>
</project>
\ No newline at end of file
Modified: root/commons/trunk/bom/pom.xml
===================================================================
--- root/commons/trunk/bom/pom.xml 2010-05-24 22:53:06 UTC (rev 17223)
+++ root/commons/trunk/bom/pom.xml 2010-05-24 22:53:25 UTC (rev 17224)
@@ -65,7 +65,7 @@
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/trunk/bom</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/trunk/bom</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces</url>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/commons/trunk/bom</url>
</scm>
</project>
Modified: root/commons/trunk/parent/pom.xml
===================================================================
--- root/commons/trunk/parent/pom.xml 2010-05-24 22:53:06 UTC (rev 17223)
+++ root/commons/trunk/parent/pom.xml 2010-05-24 22:53:25 UTC (rev 17224)
@@ -78,4 +78,10 @@
</plugins>
</pluginManagement>
</build>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/trunk/parent</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/trunk/parent</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/commons/trunk/parent</url>
+ </scm>
</project>
\ No newline at end of file
Modified: root/commons/trunk/pom.xml
===================================================================
--- root/commons/trunk/pom.xml 2010-05-24 22:53:06 UTC (rev 17223)
+++ root/commons/trunk/pom.xml 2010-05-24 22:53:25 UTC (rev 17224)
@@ -42,5 +42,11 @@
<module>parent</module>
<module>api</module>
</modules>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/trunk</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/commons/trunk</url>
+ </scm>
</project>
14 years, 1 month
JBoss Rich Faces SVN: r17223 - in root/cdk/trunk/plugins: generator/src/main/java/org/richfaces/cdk/apt/processors and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-24 18:53:06 -0400 (Mon, 24 May 2010)
New Revision: 17223
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/EventSourceInterfaceGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/ListenerTagHandlerGenerator.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/sourceInterface.ftl
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ClassGeneratorModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerGeneratorVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
Log:
CODING IN PROGRESS - issue RF-7789: Process JSF events.
https://jira.jboss.org/browse/RF-7789
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java 2010-05-24 22:46:49 UTC (rev 17222)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -59,13 +59,11 @@
public Class<? extends FacesListener> listener();
/**
- * <p class="changed_added_4_0">
- * Name of the class that implements listener interface and wraps binding to the actual instance or process method.
- * </p>
- *
- * @return name of generated listener interface..
+ * <p class="changed_added_4_0">Name for the listener interface method that process annotated event type.</p>
+ * @return
*/
- public String listenerWrapper() default "";
+ public String listenerMethod() default "";
+
/**
* <p class="changed_added_4_0">
* Name of the interface class that fires annotated events and accepts its listeners.
@@ -82,6 +80,6 @@
*
* @return
*/
- public Tag[] tag() default { @Tag };
+ public Tag[] tag() default {};
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java 2010-05-24 22:46:49 UTC (rev 17222)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/EventProcessor.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -68,8 +68,8 @@
} catch (MirroredTypeException mirror) {
model.setListenerInterface(ClassName.parseName(mirror.getTypeMirror().toString()));
}
+ model.setListenerMethodName(event.listenerMethod());
model.setSourceInterface(ClassName.parseName(event.source()));
- model.setListenerWrapper(ClassName.parseName(event.listenerWrapper()));
for (Tag tag : event.tag()) {
if(!TagType.None.equals(tag.type())){
model.getTags().add(processTag(tag));
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ClassGeneratorModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ClassGeneratorModule.java 2010-05-24 22:46:49 UTC (rev 17222)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ClassGeneratorModule.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -45,6 +45,7 @@
setBinder.addBinding().to(ConverterClassGenerator.class);
setBinder.addBinding().to(ValidatorClassGenerator.class);
setBinder.addBinding().to(BehaviorClassGenerator.class);
+ setBinder.addBinding().to(EventSourceInterfaceGenerator.class);
}
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/EventSourceInterfaceGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/EventSourceInterfaceGenerator.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/EventSourceInterfaceGenerator.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.java;
+
+import java.io.File;
+import java.util.Collection;
+
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.CdkWriter;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.generate.freemarker.FreeMarkerRenderer;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.EventModel;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+
+/**
+ * @author asmirnov
+ * @since Jan 20, 2010
+ */
+public class EventSourceInterfaceGenerator extends FreeMarkerRenderer<EventModel> implements CdkWriter {
+
+ @Inject
+ public EventSourceInterfaceGenerator(Configuration configuration, ComponentLibrary library,
+ @Output(Outputs.JAVA_CLASSES) FileManager output) {
+ super(configuration, library, output);
+ }
+
+ @Override
+ public void render() throws CdkException {
+ Collection<EventModel> models = library.getEvents();
+ for (EventModel model : models) {
+ if (model.isGenerateSource()) {
+ this.generate(model);
+ }
+ }
+ }
+
+ @Override
+ protected String getOutputFile(EventModel c) throws CdkException {
+ return c.getSourceInterface().getName().replace('.', File.separatorChar) + ".java";
+ }
+
+ @Override
+ protected String getTemplateName() {
+ return "sourceInterface.ftl";
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/EventSourceInterfaceGenerator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/ListenerTagHandlerGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/ListenerTagHandlerGenerator.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/ListenerTagHandlerGenerator.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.java.taghandler;
+
+import java.io.File;
+import java.util.Collection;
+
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.CdkWriter;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.cdk.generate.freemarker.FreeMarkerRenderer;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.EventModel;
+import org.richfaces.cdk.model.TagModel;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+
+/**
+ * @author akolonitsky
+ * @since Jan 20, 2010
+ */
+public class ListenerTagHandlerGenerator extends FreeMarkerRenderer<TagModel> implements CdkWriter {
+
+ @Inject
+ public ListenerTagHandlerGenerator(Configuration configuration, ComponentLibrary library,
+ @Output(Outputs.JAVA_CLASSES) FileManager output) {
+ super(configuration, library, output);
+ }
+
+ @Override
+ public void render() throws CdkException {
+ Collection<EventModel> models = library.getEvents();
+ for (EventModel model : models) {
+ for (TagModel tag : model.getTags()) {
+ if ((TagType.All.equals(tag.getType()) || TagType.Facelets.equals(tag.getType())) && tag.isGenerate()) {
+ process(model,tag);
+ }
+ }
+ }
+ }
+
+ protected void process(EventModel model, TagModel tag) {
+
+ }
+
+ @Override
+ protected String getOutputFile(TagModel c) throws CdkException {
+ return c.getTargetClass().getName().replace('.', File.separatorChar) + ".java";
+ }
+
+ @Override
+ protected String getTemplateName() {
+ return "listenerTagHandler.ftl";
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/ListenerTagHandlerGenerator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerGeneratorVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerGeneratorVisitor.java 2010-05-24 22:46:49 UTC (rev 17222)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/taghandler/TagHandlerGeneratorVisitor.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -22,6 +22,7 @@
package org.richfaces.cdk.generate.java.taghandler;
+import org.richfaces.cdk.annotations.TagType;
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.ConverterModel;
@@ -68,10 +69,11 @@
generateTagHandler(model);
return null;
}
+
private void generateTagHandler(ModelElementBase model) {
for (TagModel tag : model.getTags()) {
- if (tag.isGenerate()) {
+ if ((TagType.All.equals(tag.getType()) || TagType.Facelets.equals(tag.getType())) && tag.isGenerate()) {
tagGenerator.process(model,tag);
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java 2010-05-24 22:46:49 UTC (rev 17222)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -44,8 +44,10 @@
public class EventModel implements ModelElement<EventModel> {
private String description;
private ClassName listenerInterface;
- private ClassName listenerWrapper;
+ private String listenerMethodName;
+ private boolean generateListener;
private ClassName sourceInterface;
+ private boolean generateSource;
private final ModelCollection<TagModel> tags = ModelSet.<TagModel>create();
/**
@@ -58,6 +60,7 @@
* <p class="changed_added_4_0"></p>
* @return the description
*/
+ @Merge
public String getDescription() {
return description;
}
@@ -90,6 +93,7 @@
* <p class="changed_added_4_0"></p>
* @return the listenerInterface
*/
+ @Merge
public ClassName getListenerInterface() {
return listenerInterface;
}
@@ -104,8 +108,43 @@
/**
* <p class="changed_added_4_0"></p>
+ * @return the listenerMethodName
+ */
+ @Merge
+ public String getListenerMethodName() {
+ return this.listenerMethodName;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param listenerMethodName the listenerMethodName to set
+ */
+ public void setListenerMethodName(String listenerMethodName) {
+ this.listenerMethodName = listenerMethodName;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the generateListener
+ */
+ @Merge
+ public boolean isGenerateListener() {
+ return this.generateListener;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param generateListener the generateListener to set
+ */
+ public void setGenerateListener(boolean generateListener) {
+ this.generateListener = generateListener;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
* @return the sourceInterface
*/
+ @Merge
public ClassName getSourceInterface() {
return sourceInterface;
}
@@ -120,19 +159,19 @@
/**
* <p class="changed_added_4_0"></p>
- * @return the listenerWrapper
+ * @return the generateSource
*/
@Merge
- public ClassName getListenerWrapper() {
- return this.listenerWrapper;
+ public boolean isGenerateSource() {
+ return this.generateSource;
}
/**
* <p class="changed_added_4_0"></p>
- * @param listenerWrapper the listenerWrapper to set
+ * @param generateSource the generateSource to set
*/
- public void setListenerWrapper(ClassName listenerWrapper) {
- this.listenerWrapper = listenerWrapper;
+ public void setGenerateSource(boolean generateSource) {
+ this.generateSource = generateSource;
}
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-05-24 22:46:49 UTC (rev 17222)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/validator/ValidatorImpl.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -42,6 +42,7 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.DescriptionGroup;
+import org.richfaces.cdk.model.EventModel;
import org.richfaces.cdk.model.FacesComponent;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.FacetModel;
@@ -71,6 +72,7 @@
public static final ClassName DEFAULT_VALIDATOR_HANDLER = new ClassName(ValidatorHandler.class);
public static final ClassName DEFAULT_CONVERTER_HANDLER = new ClassName(ConverterHandler.class);
public static final ClassName DEFAULT_BEHAVIOR_HANDLER = new ClassName(BehaviorHandler.class);
+
/**
* <p class="changed_added_4_0">
* </p>
@@ -107,31 +109,59 @@
@Override
public void verify(ComponentLibrary library) throws CdkException {
verifyComponents(library);
+ verifyEvents(library);
verifyBehaviors(library);
verifyRenderers(library);
verifyTaglib(library);
}
+ protected void verifyEvents(ComponentLibrary library) {
+ for (EventModel event : library.getEvents()) {
+ ClassName listenerInterface = event.getListenerInterface();
+ if (null == listenerInterface) {
+ // TODO - infer listener interface name.
+ }
+ event.setGenerateListener(null == sourceUtils.asTypeElement(listenerInterface));
+ String methodName = event.getListenerMethodName();
+ if (null == methodName) {
+ // TODO infer listener method name.
+ }
+ ClassName sourceInterface = event.getSourceInterface();
+ if (null == sourceInterface) {
+ // TODO - infer source interface.
+ }
+ event.setGenerateSource(null == sourceUtils.asTypeElement(sourceInterface));
+ // Propagate event to corresponding components.
+ for (ComponentModel component : library.getComponents()) {
+ for (EventModel componentEvent : component.getEvents()) {
+ if (event.getType().equals(componentEvent.getType())) {
+ componentEvent.merge(event);
+ }
+ }
+ }
+ }
+ }
+
protected void verifyTaglib(ComponentLibrary library) {
Taglib taglib = library.getTaglib();
- if(null == taglib){
+ if (null == taglib) {
// Oops, create taglib model
taglib = new Taglib();
library.setTaglib(taglib);
}
// Verify URI
String uri = taglib.getUri();
- if(null == uri){
+ if (null == uri) {
// infer default value.
uri = namingConventions.inferTaglibUri(library);
taglib.setUri(uri);
-// log.error("No uri defined for taglib");
+ // log.error("No uri defined for taglib");
}
String shortName = taglib.getShortName();
- if(null == shortName){
+ if (null == shortName) {
shortName = namingConventions.inferTaglibName(uri);
taglib.setShortName(shortName);
-// log.error("No short defined for taglib");
+ // log.error("No short defined for taglib");
}
}
@@ -158,14 +188,13 @@
return namingConventions.inferBehaviorClass(id);
}
});
- for(TagModel tag : behavior.getTags()){
+ for (TagModel tag : behavior.getTags()) {
verifyTag(tag, behavior.getId(), DEFAULT_BEHAVIOR_HANDLER);
}
}
}
-
protected void verifyRenderers(ComponentLibrary library) {
for (RenderKitModel renderKit : library.getRenderKits()) {
// Check render kit name and class.
@@ -245,7 +274,7 @@
// compact(component.getAttributes());
// Check renderers.
// Check Tag
- for(TagModel tag : component.getTags()){
+ for (TagModel tag : component.getTags()) {
verifyTag(tag, component.getId(), DEFAULT_COMPONENT_HANDLER);
}
verifyDescription(component);
@@ -256,16 +285,16 @@
}
protected void verifyTag(TagModel tag, FacesId id, ClassName handler) {
- if(Strings.isEmpty(tag.getName())){
+ if (Strings.isEmpty(tag.getName())) {
String defaultTagName = namingConventions.inferTagName(id);
tag.setName(defaultTagName);
}
- if(tag.isGenerate()){
- if(null == tag.getBaseClass()){
+ if (tag.isGenerate()) {
+ if (null == tag.getBaseClass()) {
// TODO - choose default handler class by tag type.
- tag.setBaseClass(handler);
+ tag.setBaseClass(handler);
}
- if(null == tag.getTargetClass()){
+ if (null == tag.getTargetClass()) {
namingConventions.inferTagHandlerClass(id, tag.getType().toString());// TODO - get markup somethere.
}
}
Added: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/sourceInterface.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/sourceInterface.ftl (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/sourceInterface.ftl 2010-05-24 22:53:06 UTC (rev 17223)
@@ -0,0 +1,43 @@
+<#include "_copyright.ftl">
+
+package ${sourceInterface.package};
+
+import javax.annotation.Generated;
+import ${listenerInterface};
+
+/**
+ * ${description?if_exists}
+ **/
+@Generated({"RichFaces CDK", "4.0.0-SNAPSHOT"})
+public interface ${sourceInterface.simpleName} {
+
+ /**
+ * <p>Add a new {@link ${listenerInterface.simpleName}} to the set of listeners interested
+ * in being notified when {@link ${type}}s occur.</p>
+ *
+ * @param listener The {@link ${listenerInterface.simpleName}} to be added
+ *
+ * @throws NullPointerException if <code>listener</code>
+ * is <code>null</code>
+ */
+ public void add${listenerInterface.simpleName}(${listenerInterface.simpleName} listener);
+
+ /**
+ * <p>Remove an existing {@link ${listenerInterface.simpleName}} (if any) from the set of
+ * listeners interested in being notified when {@link ${type}}s
+ * occur.</p>
+ *
+ * @param listener The {@link ${listenerInterface.simpleName}} to be removed
+ *
+ * @throws NullPointerException if <code>listener</code>
+ * is <code>null</code>
+ */
+ public void remove${listenerInterface.simpleName}(${listenerInterface.simpleName} listener);
+
+ /**
+ * <p>Return the array of registered {@link ${listenerInterface.simpleName}}s for this instance. If there are no registered listeners,
+ * a zero-length array is returned.</p>
+ */
+ public ${listenerInterface.simpleName}[] get${listenerInterface.simpleName}s();
+
+}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-05-24 22:46:49 UTC (rev 17222)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-05-24 22:53:06 UTC (rev 17223)
@@ -55,7 +55,7 @@
components={
@SubComponent(type = "org.richfaces.cdk.test.TestHtmlAbbr",
description=@Description(displayName="Test HTML5 abbreviation",largeIcon="large.gif",smallIcon="spall.png"),
- tag=@Tag(name="abbr"),
+ tag=@Tag(name="abbr",generate=true,handler="org.richfaces.cdk.test.facelets.AbbrTagHandler"),
generate="org.richfaces.cdk.test.component.html.HtmlTestAbbr",
interfaces=Html5Attributes.class,
renderer=@JsfRenderer(type="org.richfaces.cdk.test.HtmlAbbrRenderer")),
14 years, 1 month
JBoss Rich Faces SVN: r17222 - root/build/parent/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-24 18:46:49 -0400 (Mon, 24 May 2010)
New Revision: 17222
Modified:
root/build/parent/trunk/pom.xml
Log:
Made JSF RI 2.0.2 the default JSF version
Modified: root/build/parent/trunk/pom.xml
===================================================================
--- root/build/parent/trunk/pom.xml 2010-05-24 21:26:47 UTC (rev 17221)
+++ root/build/parent/trunk/pom.xml 2010-05-24 22:46:49 UTC (rev 17222)
@@ -353,7 +353,8 @@
<id>jsf-ri</id>
<activation>
<property>
- <name>!jsf_profile</name>
+ <name>jsf_profile</name>
+ <value>ri_snapshot</value>
</property>
</activation>
<properties>
@@ -371,8 +372,7 @@
<id>ri_202</id>
<activation>
<property>
- <name>jsf_profile</name>
- <value>ri_202</value>
+ <name>!jsf_profile</name>
</property>
</activation>
<properties>
14 years, 1 month
JBoss Rich Faces SVN: r17221 - root/ui/core/trunk/api/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-24 17:26:47 -0400 (Mon, 24 May 2010)
New Revision: 17221
Modified:
root/ui/core/trunk/api/src/test/java/org/richfaces/component/QueueRendererTest.java
Log:
Support for "org.richfaces.queue.enabled" parameter
Modified: root/ui/core/trunk/api/src/test/java/org/richfaces/component/QueueRendererTest.java
===================================================================
--- root/ui/core/trunk/api/src/test/java/org/richfaces/component/QueueRendererTest.java 2010-05-24 19:41:51 UTC (rev 17220)
+++ root/ui/core/trunk/api/src/test/java/org/richfaces/component/QueueRendererTest.java 2010-05-24 21:26:47 UTC (rev 17221)
@@ -27,11 +27,20 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
import org.jboss.test.faces.ApplicationServer;
import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.Statement;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
@@ -43,6 +52,10 @@
*/
public class QueueRendererTest{
+ @Target(value = {ElementType.METHOD})
+ @Retention(RetentionPolicy.RUNTIME)
+ private @interface DisableQueue {}
+
private static final String EXPECTED_QUEUE_SCRIPT = "RichFaces.queue.setQueueOptions({" +
"'first': {'requestDelay': 400, 'timeout': 100, 'ignoreDupResponses': true}," +
"'form': {'requestDelay': 400}," +
@@ -56,7 +69,23 @@
protected HtmlUnitEnvironment facesEnvironment;
+ private boolean queueEnabled = true;
+ @Rule
+ public final MethodRule rule = new MethodRule() {
+
+ public Statement apply(Statement base, FrameworkMethod method, Object target) {
+ QueueRendererTest test = (QueueRendererTest) target;
+
+ DisableQueue annotation = method.getMethod().getAnnotation(DisableQueue.class);
+ if (annotation != null) {
+ test.queueEnabled = false;
+ }
+
+ return base;
+ }
+ };
+
@Before
public void setUp() throws Exception {
facesEnvironment = new HtmlUnitEnvironment();
@@ -64,9 +93,12 @@
ApplicationServer facesServer = facesEnvironment.getServer();
facesServer.addResource("/queue.xhtml", "org/richfaces/component/queue.xhtml");
facesServer.addResource("/nonQueue.xhtml", "org/richfaces/component/nonQueue.xhtml");
-
+
+ facesEnvironment.getServer().addInitParameter("org.richfaces.queue.enabled", Boolean.toString(queueEnabled));
facesEnvironment.start();
}
+
+
@After
public void tearDown() throws Exception {
@@ -96,13 +128,20 @@
}*/
}
+
+ @Test
+ @DisableQueue
+ public void testQueuingDisabled() throws Exception {
+ page = facesEnvironment.getPage("/queue.jsf");
+ String queueScript = extractQueueScript(page);
+ assertNull(queueScript);
+ }
@Test
public void testPageWithoutQueue() throws Exception {
page = facesEnvironment.getPage("/nonQueue.jsf");
String queueScript = extractQueueScript(page);
assertNull("Queue script must be null", queueScript);
-
}
private String dehydrate(String s) {
14 years, 1 month
JBoss Rich Faces SVN: r17220 - in root: build/resources/trunk/checkstyle and 20 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-24 15:41:51 -0400 (Mon, 24 May 2010)
New Revision: 17220
Modified:
root/build/bom/trunk/pom.xml
root/build/resources/trunk/checkstyle/pom.xml
root/cdk/trunk/bom/pom.xml
root/commons/trunk/bom/pom.xml
root/commons/trunk/parent/pom.xml
root/commons/trunk/pom.xml
root/core/trunk/bom/pom.xml
root/core/trunk/parent/pom.xml
root/core/trunk/pom.xml
root/ui-sandbox/componentcontrol/trunk/bom/pom.xml
root/ui-sandbox/componentcontrol/trunk/parent/pom.xml
root/ui-sandbox/datascroller/trunk/bom/pom.xml
root/ui-sandbox/datascroller/trunk/parent/pom.xml
root/ui-sandbox/pom.xml
root/ui-sandbox/tables/trunk/bom/pom.xml
root/ui-sandbox/tables/trunk/parent/pom.xml
root/ui/core/trunk/bom/pom.xml
root/ui/core/trunk/parent/pom.xml
root/ui/core/trunk/pom.xml
root/ui/misc/trunk/bom/pom.xml
root/ui/misc/trunk/parent/pom.xml
root/ui/misc/trunk/pom.xml
Log:
Updated to use latest richfaces-parent - 3
Modified: root/build/bom/trunk/pom.xml
===================================================================
--- root/build/bom/trunk/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/build/bom/trunk/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -28,7 +28,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<description>
Modified: root/build/resources/trunk/checkstyle/pom.xml
===================================================================
--- root/build/resources/trunk/checkstyle/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/build/resources/trunk/checkstyle/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>1</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces</groupId>
Modified: root/cdk/trunk/bom/pom.xml
===================================================================
--- root/cdk/trunk/bom/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/cdk/trunk/bom/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: root/commons/trunk/bom/pom.xml
===================================================================
--- root/commons/trunk/bom/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/commons/trunk/bom/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -30,7 +30,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<description>
Modified: root/commons/trunk/parent/pom.xml
===================================================================
--- root/commons/trunk/parent/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/commons/trunk/parent/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -28,7 +28,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<description>
Modified: root/commons/trunk/pom.xml
===================================================================
--- root/commons/trunk/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/commons/trunk/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.commons</groupId>
Modified: root/core/trunk/bom/pom.xml
===================================================================
--- root/core/trunk/bom/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/core/trunk/bom/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<description>
Modified: root/core/trunk/parent/pom.xml
===================================================================
--- root/core/trunk/parent/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/core/trunk/parent/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -30,7 +30,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<description>
Modified: root/core/trunk/pom.xml
===================================================================
--- root/core/trunk/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/core/trunk/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.core</groupId>
Modified: root/ui/core/trunk/bom/pom.xml
===================================================================
--- root/ui/core/trunk/bom/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui/core/trunk/bom/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui</groupId>
Modified: root/ui/core/trunk/parent/pom.xml
===================================================================
--- root/ui/core/trunk/parent/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui/core/trunk/parent/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui</groupId>
Modified: root/ui/core/trunk/pom.xml
===================================================================
--- root/ui/core/trunk/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui/core/trunk/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui</groupId>
Modified: root/ui/misc/trunk/bom/pom.xml
===================================================================
--- root/ui/misc/trunk/bom/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui/misc/trunk/bom/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui</groupId>
Modified: root/ui/misc/trunk/parent/pom.xml
===================================================================
--- root/ui/misc/trunk/parent/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui/misc/trunk/parent/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui</groupId>
Modified: root/ui/misc/trunk/pom.xml
===================================================================
--- root/ui/misc/trunk/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui/misc/trunk/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui</groupId>
Modified: root/ui-sandbox/componentcontrol/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/bom/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui-sandbox/componentcontrol/trunk/bom/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/componentcontrol/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/parent/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui-sandbox/componentcontrol/trunk/parent/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/datascroller/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/bom/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui-sandbox/datascroller/trunk/bom/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/datascroller/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/parent/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui-sandbox/datascroller/trunk/parent/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/pom.xml
===================================================================
--- root/ui-sandbox/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui-sandbox/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/tables/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/bom/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui-sandbox/tables/trunk/bom/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
Modified: root/ui-sandbox/tables/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/parent/pom.xml 2010-05-24 19:33:42 UTC (rev 17219)
+++ root/ui-sandbox/tables/trunk/parent/pom.xml 2010-05-24 19:41:51 UTC (rev 17220)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>3</version>
</parent>
<groupId>org.richfaces.ui-sandbox</groupId>
14 years, 1 month
JBoss Rich Faces SVN: r17219 - in root: core/trunk/impl/src/main/java/org/richfaces/context and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-24 15:33:42 -0400 (Mon, 24 May 2010)
New Revision: 17219
Removed:
root/core/trunk/impl/src/main/java/org/richfaces/context/RequestStateManager.java
root/core/trunk/impl/src/main/java/org/richfaces/context/RequestStateManagerPhaseCleaner.java
Modified:
root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
root/core/trunk/impl/src/main/java/org/richfaces/context/SkinningResourcesPhaseListener.java
root/core/trunk/impl/src/main/resources/META-INF/faces-config.xml
root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java
root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java
root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java
Log:
Support for "org.richfaces.queue.enabled" parameter redesigned
Modified: root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2010-05-24 19:12:15 UTC (rev 17218)
+++ root/core/trunk/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2010-05-24 19:33:42 UTC (rev 17219)
@@ -32,18 +32,15 @@
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.faces.FacesException;
-import javax.faces.application.Application;
import javax.faces.application.ViewHandler;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
-import javax.faces.component.UIOutput;
import javax.faces.component.UIParameter;
import javax.faces.component.UIViewRoot;
import javax.faces.component.ValueHolder;
@@ -60,7 +57,6 @@
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.util.HtmlDimensions;
import org.richfaces.context.ComponentIdResolver;
-import org.richfaces.context.RequestStateManager;
/**
* Util class for common render operations - render passthru html attributes,
@@ -1139,80 +1135,6 @@
}
}
- private UIComponent findInstalledResource(FacesContext context, String libraryName, String resourceName,
- String target) {
-
- List<UIComponent> resourceComponents = context.getViewRoot().getComponentResources(context, target);
- for (UIComponent component : resourceComponents) {
- Map<String, Object> attributes = component.getAttributes();
-
- if (resourceName.equals(attributes.get("name"))) {
- Object library = attributes.get("library");
-
- if ((libraryName == null && library == null) || libraryName.equals(library)) {
- return component;
- }
- }
- }
-
- return null;
- }
-
- public UIComponent findInstalledResource(FacesContext context, String libraryName, String resourceName) {
- UIComponent component;
-
- component = findInstalledResource(context, libraryName, resourceName, "head");
-
- if (component == null) {
- component = findInstalledResource(context, libraryName, resourceName, "body");
- }
-
- if (component == null) {
- component = findInstalledResource(context, libraryName, resourceName, "form");
- }
-
- return component;
- }
-
- public void addResource(FacesContext context, String libraryName, String resourceName) {
- addResource(context, libraryName, resourceName, null);
- }
-
- public void addResource(FacesContext context, String libraryName, String resourceName, String targetParam) {
- String resourceKey;
-
- if (libraryName != null && libraryName.length() != 0) {
- resourceKey = libraryName + '/' + resourceName;
- } else {
- resourceKey = resourceName;
- }
-
- Set<String> processedResources = RequestStateManager.getProcessedResources(context);
- if (processedResources.contains(resourceKey)) {
- return ;
- }
-
- UIComponent resourceComponent = findInstalledResource(context, libraryName, resourceName);
- if (resourceComponent == null) {
- Application application = context.getApplication();
- resourceComponent = application.createComponent(UIOutput.COMPONENT_TYPE);
-
- String rendererType = application.getResourceHandler().getRendererTypeForResourceName(resourceName);
- resourceComponent.setRendererType(rendererType);
-
- if (libraryName != null && libraryName.length() != 0) {
- resourceComponent.getAttributes().put("library", libraryName);
- }
-
- resourceComponent.getAttributes().put("name", resourceName);
-
- String target = (targetParam != null ? targetParam : "head");
- context.getViewRoot().addComponentResource(context, resourceComponent, target);
- }
-
- processedResources.add(resourceKey);
- }
-
/**
* Common HTML elements and attributes names.
*
Deleted: root/core/trunk/impl/src/main/java/org/richfaces/context/RequestStateManager.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/context/RequestStateManager.java 2010-05-24 19:12:15 UTC (rev 17218)
+++ root/core/trunk/impl/src/main/java/org/richfaces/context/RequestStateManager.java 2010-05-24 19:33:42 UTC (rev 17219)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.context;
-
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-
-/**
- * @author Nick Belaevski
- *
- */
-public final class RequestStateManager {
-
- private static final String ATTRIBUTE_NAME_PREFIX = RequestStateManager.class.getName() + ":";
-
- private enum Sets {
- PROCESSED_RESOURCES("processedResources");
-
- private final String attributeName;
-
- private Sets(String propertyName) {
- this.attributeName = ATTRIBUTE_NAME_PREFIX + propertyName;
- }
-
- void clear(FacesContext context) {
- context.getAttributes().remove(attributeName);
- }
-
- public Set<String> getValue(FacesContext context) {
- Map<Object, Object> attributes = context.getAttributes();
-
- Set<String> set = (Set<String>) attributes.get(attributeName);
- if (set == null) {
- set = new HashSet<String>();
- attributes.put(attributeName, set);
- }
-
- return set;
- }
- };
-
- private RequestStateManager() {
- //only factory methods are allowed to be used
- }
-
- static void clear(FacesContext context) {
- if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) {
- RequestStateManager.Sets.PROCESSED_RESOURCES.clear(context);
- }
- }
-
- public static Set<String> getProcessedResources(FacesContext context) {
- return Sets.PROCESSED_RESOURCES.getValue(context);
- }
-}
Deleted: root/core/trunk/impl/src/main/java/org/richfaces/context/RequestStateManagerPhaseCleaner.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/context/RequestStateManagerPhaseCleaner.java 2010-05-24 19:12:15 UTC (rev 17218)
+++ root/core/trunk/impl/src/main/java/org/richfaces/context/RequestStateManagerPhaseCleaner.java 2010-05-24 19:33:42 UTC (rev 17219)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.context;
-
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class RequestStateManagerPhaseCleaner implements PhaseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = -7736491845168435241L;
-
- public void afterPhase(PhaseEvent event) {
- }
-
- public void beforePhase(PhaseEvent event) {
- RequestStateManager.clear(event.getFacesContext());
- }
-
- public PhaseId getPhaseId() {
- return PhaseId.ANY_PHASE;
- }
-}
Modified: root/core/trunk/impl/src/main/java/org/richfaces/context/SkinningResourcesPhaseListener.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/context/SkinningResourcesPhaseListener.java 2010-05-24 19:12:15 UTC (rev 17218)
+++ root/core/trunk/impl/src/main/java/org/richfaces/context/SkinningResourcesPhaseListener.java 2010-05-24 19:33:42 UTC (rev 17219)
@@ -115,9 +115,9 @@
private UIComponent createComponentResource(FacesContext context) {
Application application = context.getApplication();
- UIComponent resourceComponent = application.createComponent(UIOutput.COMPONENT_TYPE);
- resourceComponent.setRendererType(
- application.getResourceHandler().getRendererTypeForResourceName(BOTH_SKINNING));
+ String rendererType = application.getResourceHandler().getRendererTypeForResourceName(BOTH_SKINNING);
+ UIComponent resourceComponent = application.createComponent(context, UIOutput.COMPONENT_TYPE, rendererType);
+
return resourceComponent;
}
Modified: root/core/trunk/impl/src/main/resources/META-INF/faces-config.xml
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/faces-config.xml 2010-05-24 19:12:15 UTC (rev 17218)
+++ root/core/trunk/impl/src/main/resources/META-INF/faces-config.xml 2010-05-24 19:33:42 UTC (rev 17219)
@@ -80,8 +80,4 @@
-->
<!-- /render-kit -->
- <lifecycle>
- <phase-listener>org.richfaces.context.RequestStateManagerPhaseCleaner</phase-listener>
- </lifecycle>
-
</faces-config>
Modified: root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java 2010-05-24 19:12:15 UTC (rev 17218)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java 2010-05-24 19:33:42 UTC (rev 17219)
@@ -23,6 +23,7 @@
import java.util.List;
+import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
import javax.faces.component.UIViewRoot;
@@ -31,6 +32,8 @@
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
+import org.ajax4jsf.context.ContextInitParameters;
+
/**
* @author Nick Belaevski
*
@@ -50,19 +53,26 @@
UIViewRoot viewRoot = context.getViewRoot();
List<UIComponent> resources = viewRoot.getComponentResources(context, HEAD);
+ boolean queueEnabled = ContextInitParameters.isQueueEnabled(context);
+
boolean resourceExists = false;
for (UIComponent resourceComponent : resources) {
if (QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE.equals(resourceComponent.getRendererType()) &&
UIOutput.COMPONENT_FAMILY.equals(resourceComponent.getFamily())) {
+ if (!queueEnabled) {
+ viewRoot.removeComponentResource(context, resourceComponent);
+ }
+
resourceExists = true;
break;
}
}
- if (!resourceExists) {
- UIComponent queueResourceComponent = context.getApplication().createComponent(UIOutput.COMPONENT_TYPE);
- queueResourceComponent.setRendererType(QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE);
+ if (!resourceExists && queueEnabled) {
+ Application application = context.getApplication();
+ UIComponent queueResourceComponent = application.createComponent(context,
+ UIOutput.COMPONENT_TYPE, QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE);
viewRoot.addComponentResource(context, queueResourceComponent);
}
Modified: root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java 2010-05-24 19:12:15 UTC (rev 17218)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueRendererBase.java 2010-05-24 19:33:42 UTC (rev 17219)
@@ -21,6 +21,8 @@
*/
package org.richfaces.renderkit.html;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
@@ -33,7 +35,6 @@
import javax.faces.render.Renderer;
import org.ajax4jsf.context.ContextInitParameters;
-import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.QueueRegistry;
import org.richfaces.log.RichfacesLogger;
import org.slf4j.Logger;
@@ -41,42 +42,34 @@
/**
* @author Nick Belaevski Base class for rendering Queue
*/
+@ResourceDependencies(value = {
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js")})
@ListenersFor({
@ListenerFor(systemEventClass = PostAddToViewEvent.class),
@ListenerFor(systemEventClass = PreRemoveFromViewEvent.class)
})
public abstract class QueueRendererBase extends Renderer implements ComponentSystemEventListener {
- //TODO nick - handle ContextInitParameters.isGlobalQueueEnabled(FacesContext)
-
protected static final String QUEUE_ID_ATTRIBBUTE = "queueId";
protected static final String NAME_ATTRIBBUTE = "name";
protected static final Logger LOGGER = RichfacesLogger.COMPONENTS.getLogger();
- private final RendererUtils utils = RendererUtils.getInstance();
-
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
- UIComponent comp = event.getComponent();
FacesContext context = FacesContext.getCurrentInstance();
+
+ if (!ContextInitParameters.isQueueEnabled(context)) {
+ return;
+ }
+
+ UIComponent comp = event.getComponent();
String queueName = getQueueName(context, comp);
QueueRegistry queueRegistry = QueueRegistry.getInstance(context);
if (event instanceof PostAddToViewEvent) {
queueRegistry.addQueue(queueName, comp);
-
- //@ResourceDependency(library = "javax.faces", name = "jsf.js"),
- //@ResourceDependency(name = "jquery.js"),
- //@ResourceDependency(name = "richfaces.js"),
- //@ResourceDependency(name = "richfaces-queue.js")
- utils.addResource(context, "javax.faces", "jsf.js");
- utils.addResource(context, null, "jquery.js");
- utils.addResource(context, null, "richfaces.js");
-
- if (ContextInitParameters.isQueueEnabled(context)) {
- utils.addResource(context, null, "richfaces-queue.js");
- //TODO nick - make queue resource transient?
- }
} else if (event instanceof PreRemoveFromViewEvent) {
queueRegistry.removeQueue(queueName);
}
Modified: root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java 2010-05-24 19:12:15 UTC (rev 17218)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java 2010-05-24 19:33:42 UTC (rev 17219)
@@ -26,13 +26,14 @@
import java.util.Map;
import java.util.Map.Entry;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.Renderer;
-import org.ajax4jsf.context.ContextInitParameters;
import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
@@ -44,6 +45,11 @@
*
*/
@JsfRenderer(type = "org.richfaces.QueueResourceComponentRenderer", family = UIOutput.COMPONENT_FAMILY)
+@ResourceDependencies(value = {
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-queue.js")})
public class QueueResourceComponentRenderer extends Renderer {
private static final String FUNCTION_NAME = "RichFaces.queue.setQueueOptions";
@@ -70,7 +76,7 @@
super.encodeEnd(context, component);
QueueRegistry registry = QueueRegistry.getInstance(context);
- if (ContextInitParameters.isQueueEnabled(context) && registry != null && registry.hasQueuesToEncode()) {
+ if (registry != null && registry.hasQueuesToEncode()) {
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.SCRIPT_ELEM, component);
14 years, 1 month
JBoss Rich Faces SVN: r17217 - root/build/parent/tags.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-24 15:12:09 -0400 (Mon, 24 May 2010)
New Revision: 17217
Added:
root/build/parent/tags/richfaces-parent-3/
Log:
[maven-scm] copy for tag richfaces-parent-3
Copied: root/build/parent/tags/richfaces-parent-3 (from rev 17216, root/build/parent/trunk)
14 years, 1 month