Author: abelevich
Date: 2010-05-07 06:04:38 -0400 (Fri, 07 May 2010)
New Revision: 16917
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableColumnsIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableDataIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/RowHolder.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
Log:
apply checkstyles
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableColumnsIterator.java
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableColumnsIterator.java 2010-05-07
09:56:57 UTC (rev 16916)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableColumnsIterator.java 2010-05-07
10:04:38 UTC (rev 16917)
@@ -24,7 +24,6 @@
import javax.faces.component.UIComponent;
-import org.richfaces.component.Column;
/**
* Iterator for all children table columns.
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableDataIterator.java
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableDataIterator.java 2010-05-07
09:56:57 UTC (rev 16916)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableDataIterator.java 2010-05-07
10:04:38 UTC (rev 16917)
@@ -24,7 +24,6 @@
import javax.faces.component.UIComponent;
-import org.richfaces.component.Column;
class DataTableDataIterator extends DataTableIteratorBase<UIComponent> {
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java 2010-05-07
09:56:57 UTC (rev 16916)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java 2010-05-07
10:04:38 UTC (rev 16917)
@@ -62,7 +62,7 @@
}
public String[] getHiddenInputId() {
- return (new String[]{getClientId()+ ":sort"});
+ return new String[]{getClientId() + ":sort"};
}
}
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-05-07
09:56:57 UTC (rev 16916)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-05-07
10:04:38 UTC (rev 16917)
@@ -71,7 +71,7 @@
}
public UIComponent getNoData() {
- return getFacet("noData");
+ return getFacet("noData");
}
public String getNoDataLabel() {
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-05-07
09:56:57 UTC (rev 16916)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-05-07
10:04:38 UTC (rev 16917)
@@ -32,9 +32,10 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import javax.swing.SortOrder;
import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.renderkit.AjaxEventOptions;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.Row;
import org.richfaces.component.UIDataTable;
@@ -42,7 +43,7 @@
@ResourceDependencies( { @ResourceDependency(library = "javax.faces", name =
"jsf-uncompressed.js"),
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name =
"richfaces.js"),
- @ResourceDependency(name= "richfaces-event.js"), @ResourceDependency(name =
"datatable-test.js"),
+ @ResourceDependency(name= "richfaces-event.js"), @ResourceDependency(name =
"datatable.js"),
@ResourceDependency(name = "table.css") })
public class DataTableRenderer extends AbstractTableRenderer {
@@ -182,9 +183,9 @@
new RichHeaderEncodeStrategy() : new SimpleHeaderEncodeStrategy());
}
- protected class RichHeaderEncodeStrategy implements HeaderEncodeStrategy {
+ protected class RichHeaderEncodeStrategy implements HeaderEncodeStrategy {
- public void encodeBegin(FacesContext context, ResponseWriter writer, UIComponent
component, String facetName) throws IOException {
+ public void encodeBegin(FacesContext context, ResponseWriter writer, UIComponent
component, String facetName) throws IOException {
org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn)
component;
@@ -209,12 +210,12 @@
}
public void encodeEnd(FacesContext context, ResponseWriter writer, UIComponent
component, String facetName) throws IOException {
-
+ /*
org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn)
component;
if(isSortable(column)) {
- boolean enableAsc=false, enableDesc = false, enableUnsort = false;
+ boolean enableAsc, enableDesc, enableUnsort;
SortOrder sortOrder = column.getSortOrder();
@@ -229,20 +230,20 @@
// encodeSortControls(context, writer, column, enableAsc, enableDesc,
enableUnsort);
//encode sorting hidden input
- /**
+
writer.startElement(HTML.INPUT_ELEM, column);
writer.writeAttribute(HTML.ID_ATTRIBUTE, column.getClientId(context) +
":sorting", null);
writer.writeAttribute(HTML.NAME_ATTRIBUTE, column.getClientId(context) +
":sorting", null);
writer.writeAttribute(HTML.TYPE_ATTR, "hidden",null);
writer.writeAttribute(HTML.VALUE_ATTRIBUTE, sortOrder, null);
writer.endElement(HTML.INPUT_ELEM);
- */
+
}
- writer.endElement(HTML.SPAN_ELEM);
- }
+ writer.endElement(HTML.SPAN_ELEM); */
+ }
- public void encodeSortControls(FacesContext context, ResponseWriter writer,
org.richfaces.component.UIColumn column, boolean enableAsc, boolean enableDesc, boolean
enableUnsort) throws IOException {
+ public void encodeSortControls(FacesContext context, ResponseWriter writer,
org.richfaces.component.UIColumn column, boolean enableAsc, boolean enableDesc, boolean
enableUnsort) throws IOException {
/*
String sortIconAsc = column.getSortIconAsc();
String sortIconDesc = column.getSortIconDesc();
@@ -321,19 +322,15 @@
}
@Override
- public void encodeClientScript(ResponseWriter writer, FacesContext context,
UIDataTableBase dataTable) throws IOException {
+ public void encodeClientScript(ResponseWriter writer, FacesContext facesContext,
UIDataTableBase dataTable) throws IOException {
writer.startElement(HTML.SCRIPT_ELEM, dataTable);
writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
JSFunction function = new JSFunction("new RichFaces.ui.DataTable");
- function.addParameter(dataTable.getClientId(context));
-
+ function.addParameter(dataTable.getClientId(facesContext));
HashMap<String, Object> options = new HashMap<String, Object>();
- options.put("sortMode", dataTable.getSortMode());
- options.put("sortField", dataTable.getClientId() + ":sort");
-
-
+
HashMap<String, Object> columnsOption = new HashMap<String,
Object>();
/*
Iterator<UIComponent> columns = dataTable.columns();
@@ -360,10 +357,14 @@
options.put("columns", columnsOption);
*/
+
+ AjaxEventOptions ajaxEventOptions =
AjaxRendererUtils.buildEventOptions(facesContext, dataTable);
+ options.put("ajaxEventOptions", ajaxEventOptions.getParameters());
function.addParameter(options);
writer.writeText(function.toScript(), null);
writer.endElement(HTML.SCRIPT_ELEM);
+ writer.endElement(HTML.SPAN_ELEM);
}
public String getTableSkinClass() {
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2010-05-07
09:56:57 UTC (rev 16916)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2010-05-07
10:04:38 UTC (rev 16917)
@@ -30,10 +30,10 @@
public interface HeaderEncodeStrategy {
- public abstract void encodeBegin(FacesContext context, ResponseWriter writer,
+ public abstract void encodeBegin(FacesContext context, ResponseWriter writer,
UIComponent column, String facetName) throws IOException;
- public abstract void encodeEnd(FacesContext context, ResponseWriter writer,
+ public abstract void encodeEnd(FacesContext context, ResponseWriter writer,
UIComponent column, String facetName) throws IOException;
}
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/RowHolder.java
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/RowHolder.java 2010-05-07
09:56:57 UTC (rev 16916)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/RowHolder.java 2010-05-07
10:04:38 UTC (rev 16917)
@@ -7,30 +7,40 @@
public class RowHolder extends RowHolderBase {
- private Row row;
+ private Row row;
- private int processCell;
+ private int processCell;
- private String dataTableId;
+ private String dataTableId;
- private boolean isLastColumn;
+ private boolean isLastColumn;
- private boolean isRowStart;
+ private boolean isRowStart;
-
- public Row getRow() {
- return this.row;
+
+ public RowHolder(FacesContext context, Row row) {
+ this(context, row, 0, true, ((UIComponent)row).getClientId(context));
}
-
- public RowHolder(FacesContext context,String dataTableId, Row row) {
+
+ public RowHolder(FacesContext context, String dataTableId, Row row) {
this(context, row, 0, true, dataTableId);
}
- public RowHolder(FacesContext context, Row row) {
- this(context, row, 0, true, ((UIComponent)row).getClientId(context));
+ public RowHolder(FacesContext context, Row row, int processCell, boolean isRowStart,
String dataTableId) {
+ super(context);
+ this.row = row;
+ this.processCell = processCell;
+ this.isRowStart = isRowStart;
+ this.dataTableId = dataTableId;
}
+
+ public Row getRow() {
+ return this.row;
+ }
+
+
public String getDataTableId() {
return dataTableId;
}
@@ -39,13 +49,7 @@
this.dataTableId = dataTableId;
}
- public RowHolder(FacesContext context, Row row, int processCell, boolean isRowStart,
String dataTableId) {
- super(context);
- this.row = row;
- this.processCell = processCell;
- this.isRowStart = isRowStart;
- this.dataTableId = dataTableId;
- }
+
public int getProcessCell() {
return processCell;
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-05-07
09:56:57 UTC (rev 16916)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-05-07
10:04:38 UTC (rev 16917)
@@ -211,7 +211,8 @@
@Override
public String getColumnFooterFirstSkinClass() {
- return "rich-subtable-subfooter-first"; }
+ return "rich-subtable-subfooter-first";
+ }
@Override
public String getColumnHeaderFirstSkinClass() {