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.

sclass G22AnalyzersPanel extends G22CRUDAndDetailPanel<G22Analyzer> {
  SimpleCRUD_v2<G22Analyzer> makeCRUD() {
    var crud = new SimpleCRUD_v2<>(g22utils.concepts(), G22Analyzer);
    crud.entityName = -> "Analyzer";
    g22utils.setupScriptCRUD(crud);
    ret crud;
  }
  
  void crudVisualized :: after {
    crud.addButton(jPopDownButton_noText(
      "Copy to other project...", rThread copyToOtherProject
    ));
  }
  
  void copyToOtherProject {
    var analyzer = crud.selected();
    var srcProject = g22utils.getLoadedDB();
    var projects = g22utils.masterStuff().getLoadedDBs();
    var cbProject = jTypedComboBox(listMinus(projects, srcProject));
    packFrame(showFormTitled3("Copy analyzer to other project",
      "Copy analyzer", str(analyzer),
      "From project", str(srcProject),
      "To project", cbProject,
      "", jThreadedButton("Copy", -> copyToOtherProject(analyzer, getSelectedItem_typed(cbProject)))
    ).visualize());
  }
  
  void copyToOtherProject(G22Analyzer src, IG22LoadedDB project) {
    new G22Analyzer clone;
    clone.description(src.description)
      .text(src.text);
    clone.clearedForAutoRun(src.clearedForAutoRun)
      .editingText(src.editingText)
      .importNote("Copied from project " + quote(g22utils.masterStuff().getLoadedDB(src.concepts())) + " on " + localDateWithSeconds());
    registerConcept(project.concepts(), clone);
    infoBox("Made clone: " + clone);
  }
  
  JComponent makeDetailView(G22Analyzer script) {
    var scriptIDE = new G22AnalyzerIDE(g22utils);
    scriptIDE.setScript(script);
    ret scriptIDE.visualize();
  }
  
  SimpleCRUD_v2<G22Analyzer> scriptCRUD() { ret crud(); }
  
  selfType g22utils(G22Utils g22utils) { super.g22utils(g22utils); this; }
}

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: 291 / 634
Version history: 36 change(s)
Referenced in: [show references]