예제 #1
0
 protected String getRowClassAttribute(RowHolderBase rowHolder) {
   String rowClass = "";
   if (rowHolder.getRow() instanceof UIDataTableBase) {
     rowClass = ((UIDataTableBase) rowHolder.getRow()).getRowClass();
   }
   return rowClass;
 }
예제 #2
0
 protected String[] getColumnClasses(RowHolderBase rowHolder) {
   String[] columnClasses = new String[0];
   if (rowHolder.getRow() instanceof UIDataTableBase) {
     String classes = ((UIDataTableBase) rowHolder.getRow()).getColumnClasses();
     if (null != classes) {
       columnClasses = classes.split(",");
     }
   }
   return columnClasses;
 }
예제 #3
0
 public void processRows(
     ResponseWriter writer, FacesContext facesContext, UIComponent component, Object[] options)
     throws IOException {
   RowHolderBase rowHolder = createRowHolder(facesContext, component, options);
   encodeRows(facesContext, rowHolder);
   if (!rowHolder.hasWalkedOverRows()) {
     try {
       encodeFakeRow(facesContext, rowHolder);
     } catch (IOException e) {
       throw new FacesException(e);
     }
   } else {
     doCleanup(facesContext, rowHolder);
   }
 }
예제 #4
0
  public DataVisitResult process(FacesContext facesContext, Object rowKey, Object argument) {
    RowHolderBase holder = (RowHolderBase) argument;
    Row row = holder.getRow();
    row.setRowKey(facesContext, rowKey);

    try {
      ResponseWriter writer = facesContext.getResponseWriter();
      holder.resetProcessCell();
      encodeRow(writer, facesContext, holder);
    } catch (IOException e) {
      throw new FacesException(e);
    }

    holder.nextRow();
    return DataVisitResult.CONTINUE;
  }
예제 #5
0
 protected String getRowClass(RowHolderBase rowHolder) {
   String styleClass = "";
   String[] rowClasses = getRowClasses(rowHolder);
   if (rowClasses.length > 0) {
     int styleIndex = rowHolder.getCurrentRow() % rowClasses.length;
     styleClass = rowClasses[styleIndex];
   }
   return concatClasses(getRowClassAttribute(rowHolder), styleClass);
 }
예제 #6
0
 protected void encodeRows(FacesContext facesContext, RowHolderBase rowHolder) {
   rowHolder.getRow().walk(facesContext, this, rowHolder);
 }