private void addIndex(int index) { int visibleIndex = index; if (getViewportSize() != null) { visibleIndex = index - getViewportSize().y; if (visibleIndex < 0 || visibleIndex >= getViewportSize().height) return; } if (isRowSelected(index)) { selectedIndices.add(visibleIndex); } else { deselectedIndices.add(visibleIndex); } } };
private static SComponent getRowSelectionRenderer(final STable table, final int row) { final STableCellRenderer rowSelectionRenderer = table.getRowSelectionRenderer(); final SComponent comp = rowSelectionRenderer.getTableCellRendererComponent(table, STable.getToggleSelectionParameter(row, -1) + ";shiftKey='+event.shiftKey+';ctrlKey='+event.ctrlKey+'", table.isRowSelected(row), row, -1); return comp; }
if(table.isRowSelected(row)) return false;
public SComponent prepareRenderer(STableCellRenderer r, int row, int col) { final SComponent tableCellRendererComponent = r.getTableCellRendererComponent(this, getValueAt(row, col), isRowSelected(row), row, col); nameRendererComponent(tableCellRendererComponent, row, col); return tableCellRendererComponent; }
/** * Prepares the specified editor using the value at the specified cell. * * @param editor the TableCellEditor to set up * @param row the row of the cell to edit, where 0 is the first * @param col the column of the cell to edit, where 0 is the first */ protected SComponent prepareEditor(STableCellEditor editor, int row, int col) { SComponent component = editor.getTableCellEditorComponent(this, getValueAt(row, col), isRowSelected(row), // true? row, col); nameEditorComponent(component, row, col); cellEditorComponent = (component instanceof LowLevelEventListener) ? (LowLevelEventListener)component : null; return component; }
final SComponent comp = rowSelectionRenderer .getTableCellRendererComponent(table, table .getToggleSelectionParameter(row, -1), table.isRowSelected(row), row, -1); final String columnStyle = Utils.joinStyles(comp, "num");