@Override public void processLowLevelEvent(String action, String... values) { processKeyEvents(values); if (action.endsWith("_keystroke")) return; if (isEditing() && action.contains("_e_") && cellEditorComponent != null) { cellEditorComponent.processLowLevelEvent(action, values); } else { if (this.lastReceivedLowLevelEvents == null) { this.lastReceivedLowLevelEvents = values; } else if (values != null && values.length > 0) { // more than one parameter targets the table. collecting parameter values String[] joinedParameters = new String[this.lastReceivedLowLevelEvents.length + values.length]; System.arraycopy(this.lastReceivedLowLevelEvents, 0, joinedParameters, 0, this.lastReceivedLowLevelEvents.length); System.arraycopy(values, 0, joinedParameters, this.lastReceivedLowLevelEvents.length, values.length); this.lastReceivedLowLevelEvents = joinedParameters; } } SForm.addArmedComponent(this); }
@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); } } };
@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 SCellRendererPane rendererPane, final int row, final int col) throws IOException { final boolean isEditingCell = table.isEditing() && row == table.getEditingRow() && col == table.getEditingColumn(); final boolean editableCell = table.isCellEditable(row, col);
throws IOException final boolean isEditingCell = table.isEditing() && row == table.getEditingRow() && col == table.getEditingColumn(); final boolean editableCell = table.isCellEditable(row, col); final boolean selectableCell = table.getSelectionMode() != SListSelectionModel.NO_SELECTION && !table.isEditable() && table.isSelectable();