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).

!7

cmodule OfferToCreateDirs > DynPrintLogAndEnabled {
  transient AutoCloseable suggestion;
  transient S lastPath;

  start {
    doEvery(1.0, r check);
  }

  void check enter {
    if (!enabled) ret;
    JComboBox cb = getFocusOwningComboBox();
    S text = gtt(cb);
    if (!eq(lastPath, text) && isAbsolutePath(text) && !fileExists(text)) {
      lastPath = text;
      dispose suggestion;
      suggestion = dm_showSuggestion(print("Create directory? " + text),
        r { mkdirs(text); infoBox("Created directory: " + text); });
    }
  }
}

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