@Override public SComponent getTableCellRendererComponent(STable table, Object value, boolean selected, int row, int col) { setText(null); setIcon(null); if (value == null) { if (editIcon != null && table.isEditable() && table.isCellEditable(row, col)) setIcon(editIcon); } else if (value instanceof SIcon) setIcon((SIcon)value); else if (value instanceof SComponent) return (SComponent)value; else setText(value.toString()); return this; } }
@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()); } }
final boolean editableCell = table.isCellEditable(row, col); final boolean selectableCell = table.getSelectionMode() != SListSelectionModel.NO_SELECTION && !table.isEditable() && table.isSelectable(); if (table.isEditable() && editableCell) parameter = table.getEditParameter(row, col); else if (selectableCell)
final boolean selectableCell = table.getSelectionMode() != SListSelectionModel.NO_SELECTION && !table.isEditable() && table.isSelectable(); if (table.isEditable() && editableCell) parameter = STable.getEditParameter(row, col); else if (selectableCell)