private String writeSelectionBodies(List<Integer> indices, List<String> bodies) { try { final StringBuilderDevice htmlDevice = new StringBuilderDevice(512); final SCellRendererPane rendererPane = component.getCellRendererPane(); for (Integer index : indices) { writeSelectionBody(htmlDevice, component, rendererPane, index); bodies.add(htmlDevice.toString()); htmlDevice.reset(); } } catch (Throwable t) { return t.getClass().getName(); } return null; } }
private String writeSelectionBodies(List<Integer> indices, List<String> bodies) { try { final StringBuilderDevice htmlDevice = new StringBuilderDevice(512); final SCellRendererPane rendererPane = component.getCellRendererPane(); Rectangle currentViewport = component.getViewportSize(); int viewportOffset = 0; if (currentViewport != null) { viewportOffset += currentViewport.y; } for (Integer index : indices) { SComponent rowSelectionRenderer = getRowSelectionRenderer(component, index + viewportOffset); rendererPane.writeComponent(htmlDevice, rowSelectionRenderer, component); bodies.add(htmlDevice.toString()); htmlDevice.reset(); } } catch (Throwable t) { return t.getClass().getName(); } return null; } }
@MacroTag public static void cell(MacroContext context, int row, int col) throws IOException { Device device = context.getDevice(); SComponent component = context.getComponent(); // RenderHelper.getInstance(component).forbidCaching(); STable table = (STable) component; STableCellRenderer renderer = table.getCellRenderer(row, col); if (renderer != null) { SComponent cellComponent = table.prepareRenderer(renderer, row, col); SCellRendererPane rendererPane = table.getCellRendererPane(); rendererPane.writeComponent(device, cellComponent, table); } else { device.print(table.getValueAt(row, col)); } // RenderHelper.getInstance(component).allowCaching(); }
protected void writeBody(Device device, STable table, int startX, int endX, int startY, int endY, int emptyIndex) throws IOException { final SListSelectionModel selectionModel = table.getSelectionModel(); StringBuilder selectedArea = Utils.inlineStyles(table .getDynamicStyle(STable.SELECTOR_SELECTED)); StringBuilder evenArea = Utils.inlineStyles(table .getDynamicStyle(STable.SELECTOR_EVEN_ROWS)); StringBuilder oddArea = Utils.inlineStyles(table .getDynamicStyle(STable.SELECTOR_ODD_ROWS)); final SCellRendererPane rendererPane = table.getCellRendererPane(); STableColumnModel columnModel = table.getColumnModel(); for (int r = startY; r < endY; ++r) { writeTableRow(device, table, columnModel, selectionModel, rendererPane, r, startX, endX, emptyIndex, selectedArea, oddArea, evenArea); } }
table.getCellRendererPane().writeComponent(device, component, table); htmlCode = device.toString(); } catch (Throwable t) {
table.getCellRendererPane().writeComponent(device, component, table); htmlCode = device.toString(); } catch (Throwable t) {
table.getCellRendererPane().writeComponent(device, component, table); htmlCode = device.toString();
table.getCellRendererPane().writeComponent(device, component, table); htmlCode = device.toString();
protected void writeBody(Device device, STable table, int startX, int endX, int startY, int endY, int emptyIndex) throws IOException { final SListSelectionModel selectionModel = table.getSelectionModel(); String selectedAreaStyle = table.getStyle(STable.SELECTOR_SELECTED); String evenAreaStyle = table.getStyle(STable.SELECTOR_EVEN_ROWS); String oddAreaStyle = table.getStyle(STable.SELECTOR_ODD_ROWS); StringBuilder selectedAreaInline = Utils.inlineStyles(table.getDynamicStyle(STable.SELECTOR_SELECTED)); StringBuilder evenAreaInline = Utils.inlineStyles(table.getDynamicStyle(STable.SELECTOR_EVEN_ROWS)); StringBuilder oddAreaInline = Utils.inlineStyles(table.getDynamicStyle(STable.SELECTOR_ODD_ROWS)); final SCellRendererPane rendererPane = table.getCellRendererPane(); STableColumnModel columnModel = table.getColumnModel(); for (int r = startY; r < endY; ++r) { writeTableRow(device, table, columnModel, selectionModel, rendererPane, r, startX, endX, emptyIndex, selectedAreaInline, oddAreaInline, evenAreaInline, selectedAreaStyle, oddAreaStyle, evenAreaStyle); } }
private void writeHeader(Device device, STable table, int startX, int endX) throws IOException { if (!table.isHeaderVisible()) return; final SCellRendererPane rendererPane = table.getCellRendererPane(); STableColumnModel columnModel = table.getColumnModel(); StringBuilder headerArea = Utils.inlineStyles(table .getDynamicStyle(STable.SELECTOR_HEADER)); device.print("<tr class=\"header\""); Utils.optAttribute(device, "style", headerArea); device.print(">"); Utils.printNewline(device, table, 1); writeSelectionHeader(device, table); for (int i = startX; i < endX; ++i) { STableColumn column = columnModel.getColumn(i); if (!column.isHidden()) writeHeaderCell(device, table, rendererPane, i); else ++endX; } device.print("</tr>"); Utils.printNewline(device, table); }
protected void writeHeader(Device device, STable table, int startX, int endX) throws IOException { if (!table.isHeaderVisible()) return; final SCellRendererPane rendererPane = table.getCellRendererPane(); STableColumnModel columnModel = table.getColumnModel(); String headerAreaStyle = table.getStyle(STable.SELECTOR_HEADER); if (headerAreaStyle != null) device.print("<tr class=\"" + headerAreaStyle + '"'); else device.print("<tr class=\"header\""); StringBuilder headerAreaInline = Utils.inlineStyles(table.getDynamicStyle(STable.SELECTOR_HEADER)); Utils.optAttribute(device, "style", headerAreaInline); device.print(">"); Utils.printNewline(device, table, 1); writeSelectionHeader(device, table); for (int i = startX; i < endX; ++i) { STableColumn column = columnModel.getColumn(i); if (!column.isHidden()) writeHeaderCell(device, table, rendererPane, i); else ++endX; } device.print("</tr>"); Utils.printNewline(device, table); }