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

29
LINES

< > BotCompany Repo | #1019090 // Directory Tree [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (14577L/102K).

!7

module DirectoryTree > DynSCP {
  File dir;
  
  JComponent visualize2() {
    if (dir == null)
      ret jcenteredbutton("Select directory...", rThread select);
    else {
      setDir(dir);
      ret getComponent();
    }
  }
  
  void select {
    temp enter();
    selectDir(voidfunc(File dir) { setDir(dir) });
  }
  
  void setDir(File dir) {
    temp enter();
    setField(+dir);
    setModuleName(f2s(dir) + " [Directory Tree]");
    
    final JTree tree = jDynamicTree(dir, func(File d) -> L<File> { listDirs(d) });
    swing { tree.setCellRenderer(customToStringTreeCellRenderer(func(File f) -> S { fileName(f) })); }
    setComponent(tree);
  }
}

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: 406 / 513
Version history: 3 change(s)
Referenced in: [show references]