public Handler getHandler() { int indexOffset = 0; if (component.isHeaderVisible()) { ++indexOffset; } UpdateHandler handler = new UpdateHandler("selectionTable"); handler.addParameter(component.getName()); handler.addParameter(new Integer(indexOffset)); handler.addParameter(Utils.listToJsArray(deselectedIndices)); handler.addParameter(Utils.listToJsArray(selectedIndices)); if (isSelectionColumnVisible(component)) { String exception = null; List<String> deselectedBodies = new ArrayList<String>(); List<String> selectedBodies = new ArrayList<String>(); exception = writeSelectionBodies(deselectedIndices, deselectedBodies); exception = writeSelectionBodies(selectedIndices, selectedBodies); handler.addParameter(Utils.listToJsArray(deselectedBodies)); handler.addParameter(Utils.listToJsArray(selectedBodies)); if (exception != null) { handler.addParameter(exception); } } return handler; }
private void writeColumnWidths(Device device, STable table, int startX, int endX) throws IOException { STableColumnModel columnModel = table.getColumnModel(); // IE-6 crashes if there is a colgroup element but the table body is empty. // That's why, we're writing the colgroup element only if the header is visible OR the model contains at least // one row if (columnModel != null && atLeastOneColumnWidthIsNotNull(columnModel) && (table.isHeaderVisible() || table.getModel().getRowCount() > 0)) { device.print("<colgroup>"); if (isSelectionColumnVisible(table)) writeCol(device, selectionColumnWidth); for (int i = startX; i < endX; ++i) { STableColumn column = columnModel.getColumn(i); if (!column.isHidden()) writeCol(device, column.getWidth()); else ++endX; } device.print("</colgroup>"); Utils.printNewline(device, table); } }
@Override public Handler getHandler() { int indexOffset = 0; if (component.isHeaderVisible()) { ++indexOffset; } UpdateHandler handler = new UpdateHandler("selectionTable"); handler.addParameter(component.getName()); handler.addParameter(indexOffset); handler.addParameter(Utils.listToJsArray(deselectedIndices)); handler.addParameter(Utils.listToJsArray(selectedIndices)); if (isSelectionColumnVisible(component)) { List<String> deselectedBodies = new ArrayList<>(); String exception = writeSelectionBodies(deselectedIndices, deselectedBodies); List<String> selectedBodies = new ArrayList<>(); exception = writeSelectionBodies(selectedIndices, selectedBodies); handler.addParameter(Utils.listToJsArray(deselectedBodies)); handler.addParameter(Utils.listToJsArray(selectedBodies)); if (exception != null) { handler.addParameter(exception); } } return handler; }
row = table.isHeaderVisible() ? this.row + 1 : this.row; column = columnInView(table, column); column = isSelectionColumnVisible(table) ? column + 1 : column;
row = table.isHeaderVisible() ? this.row + 1 : this.row; column = columnInView(table, column); column = isSelectionColumnVisible(table) ? column + 1 : column;
row = table.isHeaderVisible() ? this.row + 1 : this.row; column = columnInView(table, column); column = isSelectionColumnVisible(table) ? column + 1 : column;
row = table.isHeaderVisible() ? this.row + 1 : this.row; column = columnInView(table, column); column = isSelectionColumnVisible(table) ? column + 1 : column;
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); }