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

51
LINES

< > BotCompany Repo | #1034946 // G22ScriptsPanel backup

JavaX fragment (include)

1  
sclass G22ScriptsPanel {
2  
  replace Script with G22LeftArrowScript.
3  
  replace IDE with G22LAScriptIDE.
4  
  
5  
  transient settable G22Utils g22utils;
6  
7  
  *(G22Utils *g22utils) {}
8  
 
9  
  transient SimpleCRUD_v2<Script> scriptCRUD;
10  
  transient SingleComponentPanel scpIDE;
11  
  transient IDE scriptIDE;
12  
  
13  
  cachedVisualize {
14  
    scriptCRUD = new SimpleCRUD_v2<>(g22utils.concepts(), Script);
15  
    scriptCRUD.noSubclasses(true);
16  
    scriptCRUD.entityName = -> "Script";
17  
    g22utils.setupScriptCRUD(scriptCRUD, true);
18  
    
19  
    scpIDE = singleComponentPanel();
20  
21  
    var scriptCRUDVis = scriptCRUD.visualize();
22  
23  
    scriptCRUD.onSelectionChanged(-> {
24  
      scriptIDE = new IDE(g22utils);
25  
      var script = scriptCRUD.selected();
26  
      scriptIDE.setScript(script);
27  
      scpIDE.set(jCenteredRaisedSection(str(script),
28  
        scriptIDE));
29  
    });
30  
31  
    ret jvsplit(
32  
      jCenteredSection("Scripts", scriptCRUDVis),
33  
      scpIDE);
34  
  }
35  
  
36  
  void updateCount {
37  
    scriptCRUD.update();
38  
  }
39  
  
40  
  void edit(Script script) {
41  
    scriptCRUD.setSelected(script);
42  
  }
43  
    
44  
  void setSelected(Script script) {
45  
    scriptCRUD.setSelected(script);
46  
  }
47  
  
48  
  void selectAfterUpdate(Script script) {
49  
    scriptCRUD.selectAfterUpdate(script);
50  
  }
51  
}

Author comment

Began life as a copy of #1034599

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1034946
Snippet name: G22ScriptsPanel backup
Eternal ID of this version: #1034946/1
Text MD5: 9bf8f8d2f9d9e001dcbab481cbf9a7c1
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-17 18:05:08
Source code size: 1265 bytes / 51 lines
Pitched / IR pitched: No / No
Views / Downloads: 117 / 135
Referenced in: [show references]