.getShowAsFormComponent()); device.print(" class=\"clickable head\"");
@MacroTag public static void cellEvent(MacroContext context, int row, int col) throws IOException { Device device = context.getDevice(); SComponent _c = context.getComponent(); STable table = (STable) _c; final boolean isEditingCell = table.isEditing() && row == table.getEditingRow() && col == table.getEditingColumn(); final boolean editableCell = table.isCellEditable(row, col); final boolean clickableCell = table instanceof XTable && ((XTable)table).isClickListenerSet(table.convertColumnIndexToModel(col)); final boolean selectableCell = table.getSelectionMode() != SListSelectionModel.NO_SELECTION && !table.isEditable() && table.isSelectable(); final boolean isClickable = _c instanceof SClickable; String parameter = null; if ((table.isEditable() && editableCell) || clickableCell) parameter = STable.getEditParameter(row, col); else if (selectableCell) parameter = STable.getToggleSelectionParameter(row, col) + ";shiftKey='+event.shiftKey+';ctrlKey='+event.ctrlKey+'"; if (parameter != null && (selectableCell || editableCell || clickableCell) && !isClickable) { Utils.printClickability(device, table, parameter, true, table.getShowAsFormComponent()); } }
/** * 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>"); } }
printClickability(device, table, value, table.getShowAsFormComponent()); device.print(" class=\"clickable "); device.print(columnStyle);
.getShowAsFormComponent()); device.print(isEditingCell ? " editing=\"true\"" : " editing=\"false\""); device.print(isEditingCell ? " class=\"cell\""
printClickability(device, table, parameter, table.getShowAsFormComponent()); device.print(isEditingCell ? " editing=\"true\"" : " editing=\"false\""); device.print(isEditingCell ? " class=\"" + style + '"' : " class=\"" + style + " clickable\"");