Libraryless. Click here for Pure Java version (14577L/102K).
1 | !7 |
2 | |
3 | module DirectoryTree > DynSCP { |
4 | File dir; |
5 | |
6 | JComponent visualize2() { |
7 | if (dir == null) |
8 | ret jcenteredbutton("Select directory...", rThread select); |
9 | else { |
10 | setDir(dir); |
11 | ret getComponent(); |
12 | } |
13 | } |
14 | |
15 | void select { |
16 | temp enter(); |
17 | selectDir(voidfunc(File dir) { setDir(dir) }); |
18 | } |
19 | |
20 | void setDir(File dir) { |
21 | temp enter(); |
22 | setField(+dir); |
23 | setModuleName(f2s(dir) + " [Directory Tree]"); |
24 | |
25 | final JTree tree = jDynamicTree(dir, func(File d) -> L<File> { listDirs(d) }); |
26 | swing { tree.setCellRenderer(customToStringTreeCellRenderer(func(File f) -> S { fileName(f) })); } |
27 | setComponent(tree); |
28 | } |
29 | } |
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019090 |
Snippet name: | Directory Tree [Dyn Module] |
Eternal ID of this version: | #1019090/4 |
Text MD5: | 3dc49adf2e62bc72bba5b71094a43122 |
Transpilation MD5: | a250fd586713b67285cf62898a6fdb7f |
Author: | stefan |
Category: | javax / stefan's os |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-23 13:37:29 |
Source code size: | 690 bytes / 29 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 408 / 516 |
Version history: | 3 change(s) |
Referenced in: | [show references] |