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)
      .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/36
Text MD5: b37a83d8bdec16572e3741ff490573cd
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-12 19:50:52
Source code size: 1786 bytes / 48 lines
Pitched / IR pitched: No / No
Views / Downloads: 108 / 379
Version history: 35 change(s)
Referenced in: [show references]