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

30
LINES

< > BotCompany Repo | #1014586 // Show suggested list edits & allow to confirm

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (8919L/64K).

!7

static JTable table;

p-noconsole {
  autoRestart();
  makeTable();
  addToWindowWithMargin(table, jcenteredline(
    selectedRowCountTableButton(table, jbutton("Accept", r {
      Map<S, SS> entries = ciMap();
      for (L<S> l : selectedTableRowsData(table)) {
        S listName = first(l);
        SS map = entries.get(listName);
        if (map == null) entries.put(listName, map = ciMap());
        map.put(second(l), third(l));
      }
      
      bool change = false;
      for (S listName : keys(entries))
        change |= ml_isChange(addToMechMap(listName, entries.get(listName)));
      infoBox(change ? "Changes." : "No changes");
      // TODO: remove from suggestion list
    }))));
}

svoid makeTable {
  LL<S> l = map unstructList(mL("Suggested list appends"));
  table = showTable(table, map(l, func(L<S> l) -> Map {
    listToMapWithKeys(l, "Destination List", "Key", "Value") }));
}

Author comment

Began life as a copy of #1014343

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1014586
Snippet name: Show suggested list edits & allow to confirm
Eternal ID of this version: #1014586/5
Text MD5: 78c67de4c16aeae75933d5a5fac90f53
Transpilation MD5: 4e6d52cd0e4c1d5431e64976412ae1ef
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-24 13:55:43
Source code size: 936 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 267 / 1028
Version history: 4 change(s)
Referenced in: [show references]