@Override public void writeComponent(Device d, SComponent c, SComponent p) throws IOException { if (c != null && p instanceof STable) { STable renderedTable = (STable) p; if (renderedTable.isEditing() && renderedTable.getEditorComponent() == c) { addComponent(c); c.write(d); } else { super.writeComponent(d, c, p); } } else { super.writeComponent(d, c, p); } } };
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 static void writeHeaderCell(final Device device, final STable table, final SCellRendererPane rendererPane, final int col) throws IOException { final SComponent comp = table.prepareHeaderRenderer(table.getHeaderRenderer(col), col); device.print("<th col=\""); device.print(col); device.print("\" class=\"head\""); Utils.printTableCellAlignment(device, comp, SConstants.CENTER, SConstants.CENTER); device.print(">"); rendererPane.writeComponent(device, comp, table); device.print("</th>"); Utils.printNewline(device, comp); }
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();
rendererPane.writeComponent(device, comp, table);
/** * Renders the row sometimes needed to allow row selection. */ protected void writeSelectionBody(final Device device, final STable table, final SCellRendererPane rendererPane, final int row) throws IOException { if (isSelectionColumnVisible(table)) { final SComponent comp = getRowSelectionRenderer(table, row); final String columnStyle = Utils.joinStyles(comp, "num"); device.print("<td valign=\"top\" align=\"right\""); Utils.optAttribute(device, "width", selectionColumnWidth); String value = STable.getToggleSelectionParameter(row, -1) + ";shiftKey='+event.shiftKey+';ctrlKey='+event.ctrlKey+'"; if (table.getSelectionMode() != SListSelectionModel.NO_SELECTION) { printClickability(device, table, value, table.getShowAsFormComponent()); device.print(" class=\"clickable "); device.print(columnStyle); device.print("\""); } else { device.print(" class=\""); device.print(columnStyle); device.print("\""); } device.print(">"); // Renders the content of the row selection row rendererPane.writeComponent(device, comp, table); device.print("</td>"); } }
rendererPane.writeComponent(device, renderer, list); device.print("</li>\n");
rendererPane.writeComponent(device, comp, table);
rendererPane.writeComponent(device, cellComp, component);
device.print(">"); rendererPane.writeComponent(device, component, table);
rendererPane.writeComponent(device, component, table);