Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1030797 // customToStringListCellRenderer

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2725L/16K).

1  
static <A> ListCellRenderer<A> lambdaMapLike customToStringListCellRenderer(IF1<A, S> toString) {
2  
  ret (ListCellRenderer) new DefaultListCellRenderer {
3  
    @Override
4  
    public Component getListCellRendererComponent(JList list, O value, int index, bool isSelected, bool cellHasFocus) {
5  
      ret super.getListCellRendererComponent(list, toString.get((A) value), index, isSelected, cellHasFocus);
6  
    }
7  
  };
8  
}

Author comment

Began life as a copy of #1019092

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030797
Snippet name: customToStringListCellRenderer
Eternal ID of this version: #1030797/7
Text MD5: b7027b1a18a1af4b7a4fcf788e8fc7e7
Transpilation MD5: 6058ece4d1b7f366901757ca3ad4cb15
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-03-26 15:34:37
Source code size: 416 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 144 / 235
Version history: 6 change(s)
Referenced in: [show references]