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

48
LINES

< > BotCompany Repo | #1034473 // G22AnalyzersPanel

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

Transpiled version (53853L) is out of date.

1  
sclass G22AnalyzersPanel extends G22CRUDAndDetailPanel<G22Analyzer> {
2  
  SimpleCRUD_v2<G22Analyzer> makeCRUD() {
3  
    var crud = new SimpleCRUD_v2<>(g22utils.concepts(), G22Analyzer);
4  
    crud.entityName = -> "Analyzer";
5  
    g22utils.setupScriptCRUD(crud);
6  
    ret crud;
7  
  }
8  
  
9  
  void crudVisualized :: after {
10  
    crud.addButton(jPopDownButton_noText(
11  
      "Copy to other project...", rThread copyToOtherProject
12  
    ));
13  
  }
14  
  
15  
  void copyToOtherProject {
16  
    var analyzer = crud.selected();
17  
    var srcProject = g22utils.getLoadedDB();
18  
    var projects = g22utils.masterStuff().getLoadedDBs();
19  
    var cbProject = jTypedComboBox(listMinus(projects, srcProject));
20  
    packFrame(showFormTitled3("Copy analyzer to other project",
21  
      "Copy analyzer", str(analyzer),
22  
      "From project", str(srcProject),
23  
      "To project", cbProject,
24  
      "", jThreadedButton("Copy", -> copyToOtherProject(analyzer, getSelectedItem_typed(cbProject)))
25  
    ).visualize());
26  
  }
27  
  
28  
  void copyToOtherProject(G22Analyzer src, IG22LoadedDB project) {
29  
    new G22Analyzer clone;
30  
    clone.description(src.description)
31  
      .text(src.text);
32  
    clone.clearedForAutoRun(src.clearedForAutoRun)
33  
      .editingText(src.editingText)
34  
      .importNote("Copied from project " + quote(g22utils.masterStuff().getLoadedDB(src.concepts())) + " on " + localDateWithSeconds());
35  
    registerConcept(project.concepts(), clone);
36  
    infoBox("Made clone: " + clone);
37  
  }
38  
  
39  
  JComponent makeDetailView(G22Analyzer script) {
40  
    var scriptIDE = new G22AnalyzerIDE(g22utils);
41  
    scriptIDE.setScript(script);
42  
    ret scriptIDE.visualize();
43  
  }
44  
  
45  
  SimpleCRUD_v2<G22Analyzer> scriptCRUD() { ret crud(); }
46  
  
47  
  selfType g22utils(G22Utils g22utils) { super.g22utils(g22utils); this; }
48  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034473
Snippet name: G22AnalyzersPanel
Eternal ID of this version: #1034473/37
Text MD5: 73a1dcdbbc57dfe9067f4b7c801df895
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-04-27 18:33:43
Source code size: 1790 bytes / 48 lines
Pitched / IR pitched: No / No
Views / Downloads: 287 / 626
Version history: 36 change(s)
Referenced in: [show references]