Warning: session_start(): open(/var/lib/php/sessions/sess_b82o989oni9lg3p0m7l3vrqmla, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51

Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
buttonActionWithCloseablePre [1033902]

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

10
LINES

< > BotCompany Repo | #1033902 // buttonActionWithCloseablePre

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5538L/30K).

1  
static Runnable buttonActionWithCloseablePre(Runnable r, IF1<JButton, AutoCloseable> pre) {
2  
  ret -> { pcall {
3  
    JButton button = heldInstance(JButton);
4  
    thread {
5  
      var closeable = pre?.get(button);
6  
      pcallF(r);
7  
      close(closeable);
8  
    }
9  
  }};
10  
}

Author comment

Began life as a copy of #1033901

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033902
Snippet name: buttonActionWithCloseablePre
Eternal ID of this version: #1033902/6
Text MD5: 135cb56fda66a4174b9a88bdb87e7bd0
Transpilation MD5: 8fd0e66279c11bf1b61785e14697cea0
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-03 01:27:26
Source code size: 271 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 517 / 649
Version history: 5 change(s)
Referenced in: [show references]