Author: maksimkaszynski
Date: 2008-03-07 07:16:28 -0500 (Fri, 07 Mar 2008)
New Revision: 6614
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/component/Row.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumnGroup.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataDefinitionList.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataGrid.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataList.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UISubTable.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java
Log:
fixed syntax for J5
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/Row.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/Row.java 2008-03-07 10:10:37
UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/Row.java 2008-03-07 12:16:28
UTC (rev 6614)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
/**
* Marker interface for table columns, rendered as entire row.
* @author shura
@@ -34,6 +36,6 @@
* Get iterator for all columns contained in this row.
* @return
*/
- public Iterator columns();
+ public Iterator<UIComponent> columns();
}
\ No newline at end of file
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumnGroup.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumnGroup.java 2008-03-07
10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumnGroup.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -23,6 +23,7 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
import javax.faces.component.UIPanel;
import org.apache.commons.collections.iterators.FilterIterator;
@@ -37,7 +38,8 @@
public static final String COMPONENT_FAMILY = "org.richfaces.Colgroup";
- public Iterator columns(){
+ @SuppressWarnings("unchecked")
+ public Iterator<UIComponent> columns(){
return new FilterIterator(getChildren().iterator(),UIDataTable.isColumn);
}
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataDefinitionList.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataDefinitionList.java 2008-03-07
10:10:37 UTC (rev 6613)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataDefinitionList.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.Transformer;
import org.apache.commons.collections.iterators.FilterIterator;
@@ -66,7 +68,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIRepeat#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
return filteredFacets(fixedPredicate);
}
@@ -75,7 +77,8 @@
* @param predicate - filter for select facets names.
* @return
*/
- private Iterator filteredFacets(Predicate predicate) {
+ @SuppressWarnings("unchecked")
+ private Iterator<UIComponent> filteredFacets(Predicate predicate) {
FilterIterator fixed= new FilterIterator(getFacets().keySet().iterator(),predicate);
return new TransformIterator(fixed,new FacetTransformer());
@@ -84,7 +87,8 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIRepeat#dataChildren()
*/
- protected Iterator dataChildren() {
+ @SuppressWarnings("unchecked")
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return new IteratorChain(getChildren().iterator(),filteredFacets(termsPredicate));
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataGrid.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataGrid.java 2008-03-07
10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataGrid.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
import org.ajax4jsf.component.SequenceDataAdaptor;
/**
@@ -57,7 +59,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#dataChildren()
*/
- protected Iterator dataChildren() {
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return getChildren().iterator();
}
@@ -65,7 +67,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
// TODO Auto-generated method stub
return getFacets().values().iterator();
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataList.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataList.java 2008-03-07
10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataList.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
import org.ajax4jsf.component.SequenceDataAdaptor;
/**
@@ -38,7 +40,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#dataChildren()
*/
- protected Iterator dataChildren() {
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return getChildren().iterator();
}
@@ -46,7 +48,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
// TODO Auto-generated method stub
return getFacets().values().iterator();
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-03-07
10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -208,12 +208,13 @@
return new ModifiableModel(dataModel, getVar(), getFilterFields(), getSortFields());
}
+ @SuppressWarnings("unchecked")
public Collection<Object> getSortPriority(){
ValueExpression ve = getValueExpression("sortPriority");
if (ve != null) {
Collection<Object> value = null;
try {
- value = (Collection) ve.getValue(getFacesContext().getELContext());
+ value = (Collection<Object>) ve.getValue(getFacesContext().getELContext());
} catch (ELException e) {
throw new FacesException(e);
}
@@ -249,9 +250,10 @@
}
@Override
+ @SuppressWarnings("unchecked")
public void restoreState(FacesContext context, Object state) {
Object[] states = (Object[]) state;
super.restoreState(context, states[0]);
- sortPriority = (Collection)states[1];
+ sortPriority = (Collection<Object>)states[1];
}
}
\ No newline at end of file
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UISubTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UISubTable.java 2008-03-07
10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UISubTable.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -23,7 +23,9 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
/**
* JSF component class
*
@@ -52,7 +54,7 @@
/* (non-Javadoc)
* @see org.richfaces.component.UIDataTable#columns()
*/
- public Iterator columns() {
+ public Iterator<UIComponent> columns() {
return super.columns();
}
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2008-03-07
10:10:37 UTC (rev 6613)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -30,7 +30,6 @@
import org.ajax4jsf.component.UIDataAdaptor;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIDataGrid;
-import org.richfaces.component.UIDataTable;
/**
* @author shura
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2008-03-07
10:10:37 UTC (rev 6613)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -35,7 +35,6 @@
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.Row;
-import org.richfaces.component.UIDataTable;
/**
* @author shura
@@ -55,23 +54,23 @@
};
- public static final Object ROW_CLASS_KEY = AbstractRowsRenderer.class
+ public static final String ROW_CLASS_KEY = AbstractRowsRenderer.class
.getName()
+ ".rowClass";
- public static final Object SKIN_ROW_CLASS_KEY = AbstractRowsRenderer.class
+ public static final String SKIN_ROW_CLASS_KEY = AbstractRowsRenderer.class
.getName()
+ ".skinRowClass";
- public static final Object CELL_CLASS_KEY = AbstractRowsRenderer.class
+ public static final String CELL_CLASS_KEY = AbstractRowsRenderer.class
.getName()
+ ".cellClass";
- public static final Object SKIN_CELL_CLASS_KEY = AbstractRowsRenderer.class
+ public static final String SKIN_CELL_CLASS_KEY = AbstractRowsRenderer.class
.getName()
+ ".skinCellClass";
- public static final Object SKIN_FIRST_ROW_CLASS_KEY =
AbstractRowsRenderer.class.getName()+".firstRowSkinClass";
+ public static final String SKIN_FIRST_ROW_CLASS_KEY =
AbstractRowsRenderer.class.getName()+".firstRowSkinClass";
/*
* (non-Javadoc)
@@ -256,7 +255,7 @@
protected void encodeCellChildren(FacesContext context, UIComponent cell,
String skinFirstRowClass, String skinRowClass, String rowClass,
String skinCellClass, String cellClass) throws IOException {
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
// Save top level class parameters ( if any ), and put new for this
// component
Object savedRowClass = requestMap.get(ROW_CLASS_KEY);
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-07
10:10:37 UTC (rev 6613)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -96,7 +96,7 @@
int columns) throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIComponent header = table.getHeader();
- Iterator headers = columnFacets(table,"header");
+ Iterator<UIComponent> headers = columnFacets(table,"header");
Iterator<UIComponent> colums = table.columns();
int colCount = calculateRowColumns(table.columns());
@@ -134,7 +134,7 @@
}
protected void encodeHeaderFacets(FacesContext context,
- ResponseWriter writer, Iterator headers, String skinCellClass,
+ ResponseWriter writer, Iterator<UIComponent> headers, String skinCellClass,
String headerClass, String facetName, String element, int colCount)
throws IOException {
int t_colCount = 0;
@@ -188,8 +188,8 @@
int columns) throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIComponent footer = table.getFooter();
- Iterator footers = columnFacets(table,"footer");
- Iterator tableColumns = table.columns();//columnFacets(table,"footer");
+ Iterator<UIComponent> footers = columnFacets(table,"footer");
+ Iterator<UIComponent> tableColumns =
table.columns();//columnFacets(table,"footer");
int colCount = calculateRowColumns(table.columns());
if (footer != null || footers.hasNext()) {
writer.startElement("tfoot", table);
@@ -224,7 +224,7 @@
throws IOException {
UIDataTable table = (UIDataTable) holder.getTable();
ResponseWriter writer = context.getResponseWriter();
- Iterator iter = table.columns();
+ Iterator<UIComponent> iter = table.columns();
boolean first = true;
int currentColumn = 0;
UIComponent column = null;
@@ -325,7 +325,8 @@
*
* Changed by Alexej Kushunin
*/
- protected Iterator columnFacets(UIDataTable table,final String name){
+ @SuppressWarnings("unchecked")
+ protected Iterator<UIComponent> columnFacets(UIDataTable table,final String
name){
return new FilterIterator(table.columns(), new Predicate() {
public boolean evaluate(Object input) {
@@ -355,7 +356,7 @@
count = span.intValue();
} else {
// calculate max html columns count for all columns/rows children.
- Iterator col = table.columns();
+ Iterator<UIComponent> col = table.columns();
count = calculateRowColumns(col);
}
return count;
@@ -369,7 +370,7 @@
* Iterator other all columns in table.
* @return
*/
- protected int calculateRowColumns(Iterator col) {
+ protected int calculateRowColumns(Iterator<UIComponent> col) {
int count = 0;
int currentLength = 0;
while (col.hasNext()) {
@@ -537,8 +538,14 @@
UIComponent table = column.getParent();
String id = table.getClientId(context);
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table, context);
- Map eventOptions = AjaxRendererUtils.buildEventOptions(context, table);
- Map parameters = (Map) eventOptions.get("parameters");
+ Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(context,
table);
+
+
+ @SuppressWarnings("unchecked")
+ Map<String, Object> parameters =
+ (Map<String, Object>) eventOptions.get("parameters");
+
+
parameters.put(id, SORT_FILTER_PARAMETER);
if (sortable) {
parameters.put(SORT_FILTER_PARAMETER, column.getClientId(context));
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java 2008-03-07
10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -30,7 +30,6 @@
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.renderkit.RendererBase;
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
/**
* @author shur
@@ -42,7 +41,7 @@
public String styleClass(FacesContext context , UIComponent component){
StringBuffer styleClass = new StringBuffer();
// Construct predefined classes
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
Object parentPredefined = requestMap.get(AbstractRowsRenderer.SKIN_CELL_CLASS_KEY);
if (null != parentPredefined) {
styleClass.append(parentPredefined).append(" ");
@@ -126,7 +125,7 @@
}
}
- protected Class getComponentClass() {
+ protected Class<? extends UIComponent> getComponentClass() {
return UIColumn.class;
}
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2008-03-07
10:10:37 UTC (rev 6613)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -22,17 +22,11 @@
package org.richfaces.renderkit;
import java.io.IOException;
-import java.util.Map;
-import javax.faces.FacesException;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-
public interface HeaderEncodeStrategy {
public abstract void encodeBegin(FacesContext context, ResponseWriter writer,
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java 2008-03-07
10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -44,7 +44,7 @@
this.table = table;
this.rowCounter = 0;
this.gridRowCounter = 0;
- Map attributes = table.getAttributes();
+ Map<String, Object> attributes = table.getAttributes();
String classes = (String) attributes.get("rowClasses");
if(null != classes){
rowClasses=classes.split(",");
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java 2008-03-07
10:10:37 UTC (rev 6613)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -41,7 +41,7 @@
*/
public class ColgroupRenderer extends AbstractRowsRenderer {
- private static final String[] STYLE_ATTRS = { "style", "class" };
+ //private static final String[] STYLE_ATTRS = { "style", "class" };
public static final String[] EVENT_ATTRS ;
static {
@@ -71,12 +71,12 @@
if (null != columnClasses) {
classes = columnClasses.split(",");
}
- Iterator iter = colgroup.columns();
+ Iterator<UIComponent> iter = colgroup.columns();
boolean first = true;
int currentColumn = 0;
int currentRow = 0;
UIComponent column = null;
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
while (iter.hasNext()) {
column = (UIComponent) iter.next();
if (column instanceof Column) {
@@ -151,7 +151,7 @@
} else {
styleClass = (String) colspan.getAttributes().get("styleClass");
}
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
Object skinRowClass = currentRow == 0 ? requestMap
.get(AbstractRowsRenderer.SKIN_FIRST_ROW_CLASS_KEY)
: requestMap.get(AbstractRowsRenderer.SKIN_ROW_CLASS_KEY);
@@ -191,7 +191,7 @@
*
* @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
*/
- protected Class getComponentClass() {
+ protected Class<? extends UIComponent> getComponentClass() {
// TODO Auto-generated method stub
return UIColumnGroup.class;
}
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java 2008-03-07
10:10:37 UTC (rev 6613)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -61,7 +61,7 @@
private void encodeHeaderRow(ResponseWriter writer, FacesContext context, UIComponent
component,String facetName) throws IOException {
UIDataTable dataTable = (UIDataTable) component;
Iterator<UIComponent> columns =
dataTable.columns();//columnFacets(dataTable,facetName);
- Iterator headers = columnFacets(dataTable,facetName);
+ Iterator<UIComponent> headers = columnFacets(dataTable,facetName);
int colCount = calculateRowColumns(dataTable.columns());
String headerClass = (String) component.getAttributes().get(
facetName+"Class");
@@ -109,7 +109,7 @@
*
* @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
*/
- protected Class getComponentClass() {
+ protected Class<? extends UIComponent> getComponentClass() {
// TODO Auto-generated method stub
return UISubTable.class;
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java 2008-03-07
10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java 2008-03-07
12:16:28 UTC (rev 6614)
@@ -21,8 +21,8 @@
package org.richfaces.util;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
-import javax.faces.el.ValueBinding;
import org.richfaces.component.Column;
@@ -46,7 +46,7 @@
UIComponent component = (UIComponent) column;
- ValueBinding binding = component.getValueBinding("sortExpression");
+ ValueExpression binding = component.getValueExpression("sortExpression");
if (binding != null) {
return binding.getExpressionString();