1 | sclass TextChangingTableCellRenderer extends DefaultTableCellRenderer { |
2 | O f; // func(S) -> S |
3 | |
4 | *(O *f) {} |
5 | |
6 | public Component getTableCellRendererComponent(JTable table, O value, boolean isSelected, boolean hasFocus, int row, int column) { |
7 | Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); |
8 | S s = strOrEmpty(value); |
9 | setText(f == null ? s : str(callF(f, s))); |
10 | ret c; |
11 | } |
12 | } |
Began life as a copy of #1020349
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020351 |
Snippet name: | TextChangingTableCellRenderer |
Eternal ID of this version: | #1020351/3 |
Text MD5: | aaecca4bfd28df4f134056f3bcd5cd1a |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-15 02:35:30 |
Source code size: | 454 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 348 / 845 |
Version history: | 2 change(s) |
Referenced in: | [show references] |