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

30
LINES

< > BotCompany Repo | #1019795 // Equivalents [Dyn Module]

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

Libraryless. Click here for Pure Java version (17765L/130K).

1  
!7
2  
3  
concept Equivalent {
4  
  S a, b;
5  
}
6  
7  
module Equivalents > DynCRUD<Equivalent> {
8  
  *() { super(Equivalent); }
9  
  
10  
  afterVisualize {
11  
    replaceComponent(crud.tableSearcher.tfInput, func(JComponent c) -> JComponent {
12  
      centerAndEastWithMargin(c, jbutton("Define...", rThread {
13  
        define(searchTerm())
14  
      }))
15  
    });
16  
    onEnter(crud.tableSearcher.tfInput, rThread { define(searchTerm()) });
17  
  }
18  
  
19  
  void define(fS term) enter {
20  
    final JTextField tfWord = jtextfield(or2(term, dm_topInput())), tfDefinition = jtextfield();
21  
    showFormTitled("Add Equivalent",
22  
      "Word/phrase:", tfWord,
23  
      "Equivalent word/phrase:", tfDefinition,
24  
      rThread {
25  
        S a = gtt(tfWord), b = gtt(tfDefinition);
26  
        uniq_sync(Equivalent, +a, +b);
27  
      });
28  
    focus(nempty(term) ? tfDefinition : tfWord);
29  
  }
30  
}

Author comment

Began life as a copy of #1019714

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019795
Snippet name: Equivalents [Dyn Module]
Eternal ID of this version: #1019795/3
Text MD5: 26ea1ac1fd90da4d2964cd76b0830d24
Transpilation MD5: 6b3b4aa2a03cf99227100dfb7008ff89
Author: stefan
Category: javax / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-26 21:49:58
Source code size: 849 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 315 / 683
Version history: 2 change(s)
Referenced in: [show references]