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

12
LINES

< > BotCompany Repo | #1022973 // onClipboardFile_monitorRegularly

JavaX fragment (include)

1  
static AutoCloseable onClipboardFile_monitorRegularly(double seconds, final VF1<File> f) {
2  
  new Var<File> last;
3  
  
4  
  ret combineAutoCloseables(onClipboardFile(voidfunc(File file) {
5  
    last.set(file);
6  
    callF(f, file);
7  
  }), timerAsAutoCloseable(doEvery(seconds, r {
8  
      File file = fileFromClipboard();
9  
      if (file != null && setVar_trueIfChanged(last, file))
10  
        callF(f, file);
11  
    })));
12  
}

Author comment

Began life as a copy of #1022922

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1022973
Snippet name: onClipboardFile_monitorRegularly
Eternal ID of this version: #1022973/1
Text MD5: 316fcd237b9c8e788e2ac530a1e7dda1
Author: stefan
Category: javax / clipboard
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-17 06:31:30
Source code size: 415 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 268 / 307
Referenced in: [show references]