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

22
LINES

< > BotCompany Repo | #1027349 // Offer to create directory from focused combo box

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

Uses 911K of libraries. Click here for Pure Java version (10155L/53K).

1  
!7
2  
3  
cmodule OfferToCreateDirs > DynPrintLogAndEnabled {
4  
  transient AutoCloseable suggestion;
5  
  transient S lastPath;
6  
7  
  start {
8  
    doEvery(1.0, r check);
9  
  }
10  
11  
  void check enter {
12  
    if (!enabled) ret;
13  
    JComboBox cb = getFocusOwningComboBox();
14  
    S text = gtt(cb);
15  
    if (!eq(lastPath, text) && isAbsolutePath(text) && !fileExists(text)) {
16  
      lastPath = text;
17  
      dispose suggestion;
18  
      suggestion = dm_showSuggestion(print("Create directory? " + text),
19  
        r { mkdirs(text); infoBox("Created directory: " + text); });
20  
    }
21  
  }
22  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027349
Snippet name: Offer to create directory from focused combo box
Eternal ID of this version: #1027349/4
Text MD5: 888d28b28280036fb7e8cb8c4e8c6724
Transpilation MD5: 8e34b40ba142f13971b1ec6abc6bb9d0
Author: stefan
Category:
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-11 11:56:41
Source code size: 551 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 100 / 939
Version history: 3 change(s)
Referenced in: [show references]