protected void addColumnValues(StringBuilder builder, List<UIColumn> columns, List<String> headers) throws IOException { for (int i = 0; i < columns.size(); i++) { addColumnValue(builder, columns.get(i).getChildren(), headers.get(i)); } }
protected void addColumnValues(StringBuilder builder, List<UIColumn> columns) throws IOException { for (Iterator<UIColumn> iterator = columns.iterator(); iterator.hasNext();) { addColumnValue(builder, iterator.next().getChildren()); if (iterator.hasNext()) { builder.append(","); } } }
public List<UIComponent> getRenderedChildrenOf(final UIColumn column) { final List<UIComponent> children = new ArrayList<>(); for (final UIComponent kid : column.getChildren()) { if (kid.isRendered()) { children.add(kid); } } return children; }
protected void exportConditionalRow(org.icefaces.ace.component.row.Row r, Row row) throws IOException { List<UIComponent> children = r.getChildren(); List<UIColumn> rowColumns = new ArrayList<UIColumn>(children.size()); for (UIComponent kid : children) { if (kid instanceof Column) { Column c = (Column) kid; int colspan = c.getColspan(); for (int i = 0; i < colspan; i++) rowColumns.add(c); } } int numberOfColumns = rowColumns.size(); for (int i = 0; i < numberOfColumns; i++) { addColumnValue(row, rowColumns.get(i).getChildren(), i); } }
protected void exportConditionalRow(Row row, Object pdfTable, Object font) throws IOException, IllegalAccessException, InvocationTargetException, InstantiationException { List<UIComponent> children = row.getChildren(); List<UIColumn> rowColumns = new ArrayList<UIColumn>(children.size()); for (UIComponent kid : children) { if (kid instanceof Column) { Column c = (Column) kid; int colspan = c.getColspan(); for (int i = 0; i < colspan; i++) rowColumns.add(c); } } int numberOfColumns = rowColumns.size(); for (int i = 0; i < numberOfColumns; i++) { addColumnValue(pdfTable, rowColumns.get(i).getChildren(), i, font); } }
private static void generateTableContent(FacesContext facesContext, PdfPTable pdfTable, List columns, HtmlDataTable dataTable) { int numberOfColumns = columns.size(); int numberOfRows = dataTable.getRowCount(); int startFrom = 0; int endAt = numberOfRows; /* fill the table with the data. */ for (int i = startFrom; i < endAt; ++i) { dataTable.setRowIndex(i); for (int j = 0; j < numberOfColumns; ++j) { String cellValue = ""; UIColumn currentColumn = (UIColumn) columns.get(j); for (int k = 0; k < currentColumn.getChildren().size(); ++k) { if (currentColumn.getChildren().get(k) instanceof ValueHolder) { cellValue += ((ValueHolder) currentColumn.getChildren() .get(k)).getValue(); } } pdfTable.addCell(cellValue); } } }
private static void generateTableContent(FacesContext facesContext, PdfPTable pdfTable, List columns, HtmlDataTable dataTable) { int numberOfColumns = columns.size(); int numberOfRows = dataTable.getRowCount(); int startFrom = 0; int endAt = numberOfRows; /* fill the table with the data. */ for (int i = startFrom; i < endAt; ++i) { dataTable.setRowIndex(i); for (int j = 0; j < numberOfColumns; ++j) { String cellValue = ""; UIColumn currentColumn = (UIColumn) columns.get(j); for (int k = 0; k < currentColumn.getChildren().size(); ++k) { if (currentColumn.getChildren().get(k) instanceof ValueHolder) { cellValue += ((ValueHolder) currentColumn.getChildren() .get(k)).getValue(); } } pdfTable.addCell(cellValue); } } }
private void addColumnValues(HSSFSheet sheet, List columns, HtmlDataTable dataTable) { for(int i=0 ; i < dataTable.getRowCount(); i++) { dataTable.setRowIndex(i); HSSFRow row = sheet.createRow( i + 1 ); for (int j=0; j < columns.size(); j++) { UIColumn column = (UIColumn) columns.get(j); addColumnValue(row, (UIComponent) column.getChildren().get(0), j); } } }
private static void generateTableContent(FacesContext facesContext, HSSFSheet sheet, List columns, HtmlDataTable dataTable) { int numberOfColumns = columns.size(); int numberOfRows = dataTable.getRowCount(); int startFrom = 0; int currentIndex = 1; int endAt = numberOfRows; /* fill the table with the data. */ for (int i = startFrom; i < endAt; ++i) { dataTable.setRowIndex(i); HSSFRow row = sheet.createRow(currentIndex++); for (int j = 0; j < numberOfColumns; ++j) { UIColumn column = (UIColumn) columns.get(j); String cellValue = ""; for (int k = 0; k < column.getChildren().size(); ++k) { if (column.getChildren().get(k) instanceof ValueHolder) { cellValue += ((ValueHolder) column.getChildren().get(k)) .getValue(); } } addColumnValue(row, cellValue, j); } } }
private static void generateTableContent(FacesContext facesContext, HSSFSheet sheet, List columns, HtmlDataTable dataTable) { int numberOfColumns = columns.size(); int numberOfRows = dataTable.getRowCount(); int startFrom = 0; int currentIndex = 1; int endAt = numberOfRows; /* fill the table with the data. */ for (int i = startFrom; i < endAt; ++i) { dataTable.setRowIndex(i); HSSFRow row = sheet.createRow(currentIndex++); for (int j = 0; j < numberOfColumns; ++j) { UIColumn column = (UIColumn) columns.get(j); String cellValue = ""; for (int k = 0; k < column.getChildren().size(); ++k) { if (column.getChildren().get(k) instanceof ValueHolder) { cellValue += ((ValueHolder) column.getChildren().get(k)) .getValue(); } } addColumnValue(row, cellValue, j); } } }
for (UIComponent columnChild : column.getChildren()) if (columnChild instanceof ExpansionToggler) hasExpansionToggler = true; if (hasExpansionToggler) continue;
private static void updateColumnCells(UIData table, int index, int rowCount) { FacesContext context = FacesContext.getCurrentInstance(); String tableId = table.getClientId(context); char separator = UINamingContainer.getSeparatorChar(context); Collection<String> renderIds = getContext().getRenderIds(); UIColumn column = findColumn(table, index); if (column != null) { for (UIComponent cell : column.getChildren()) { String cellId = cell.getId(); for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) { renderIds.add(format("%s%c%d%c%s", tableId, separator, rowIndex, separator, cellId)); } } } }
private static void updateColumnCells(UIData table, int index, int rowCount) { FacesContext context = FacesContext.getCurrentInstance(); String tableId = table.getClientId(context); char separator = UINamingContainer.getSeparatorChar(context); Collection<String> renderIds = getContext().getRenderIds(); UIColumn column = findColumn(table, index); if (column != null) { for (UIComponent cell : column.getChildren()) { String cellId = cell.getId(); for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) { renderIds.add(format("%s%c%d%c%s", tableId, separator, rowIndex, separator, cellId)); } } } }
List<UIOutput> dataOutputs = ExcelComponent.getChildrenOfType(column.getChildren(), UIOutput.class); processOutputs(column, dataOutputs);
addColumnValue(pdfTable, columns.get(j).getChildren(), j, font);
Row row = sheet.createRow(sheetRowIndex++); for (int j = 0; j < numberOfColumns; j++) { addColumnValue(row, columns.get(j).getChildren(), j);
/** * Processes all output type elements (in column) * * @param outputs The list of outputs to process * @param preTemplates The pre-pushed templates */ private void processOutputs(javax.faces.component.UIColumn column, List<UIOutput> outputs) { for (UIOutput output : outputs) { if (!output.isRendered()) { continue; } UICell cell = new UICell(); column.getChildren().add(cell); cell.setId(output.getId()); cell.setValue(output.getValue()); cell.setStyle(CSSParser.getStyle(output)); cell.setStyleClass(CSSParser.getStyleClass(output)); excelWorkbook.addItem(cell); } }
column.getChildren().add( columnText );
column.getChildren().add( columnText );
public void testProcessActionWithUIData() { UIData dataTable = new UIData(); dataTable.setValue(this.dataModel); UIColumn column = new UIColumn(); UICommand commandButton = new UICommand(); column.getChildren().add(commandButton); dataTable.getChildren().add(column); this.viewToTest.getChildren().add(dataTable); dataTable.setRowIndex(1); ActionEvent event = new ActionEvent(commandButton); this.selectionTrackingListener.processAction(event); assertTrue(this.dataModel.isCurrentRowSelected()); assertSame(this.dataModel.getSelectedRow(), this.dataModel.getRowData()); assertTrue(this.delegateListener.processedEvent); this.dataModel.setRowIndex(2); assertFalse(this.dataModel.isCurrentRowSelected()); assertTrue(this.dataModel.getSelectedRow() != this.dataModel.getRowData()); }