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

29
LINES

< > BotCompany Repo | #1015767 // identifierSafetyEditPanel - shows all entries with question marks

JavaX fragment (include)

1  
scope identifierSafetyEditPanel.
2  
3  
static S #listName = "JavaX Identifier Safety";
4  
static JTable table;
5  
6  
static JPanel identifierSafetyEditPanel() {
7  
  final JTable table = sexyTableWithoutDrag();
8  
  makeTable(table);
9  
  final JTextField tf = jtextfield();
10  
  Runnable save = r {
11  
    S value = getTextTrim(tf);
12  
    if (nempty(value))
13  
      if (ml_isChange(addToMechHashMap(listName,
14  
        mapWithSingleValue(selectedTableRowsFirstColumn(table), value))))
15  
          makeTable(table);
16  
  };
17  
  onEnter(tf, save);
18  
  ret centerAndSouthWithMargins(table, jcenteredline(
19  
    jlabel("Safety comment:"), jminwidth(250, tf),
20  
    selectedRowCountTableButton(table, jbutton("Save", save))));
21  
}
22  
23  
static void #makeTable(JTable table) {
24  
  final SS map = mechHashMap(listName);
25  
  O f = func(S id) -> Map { litorderedmap("Identifier" := id, "Safety" := or2(map.get(id), "?")) };
26  
  dataToTable_uneditable(table, map(f, keysWithValueContainingSubstring(map, "?")));
27  
}
28  
29  
end scope

Author comment

Began life as a copy of #1015747

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015767
Snippet name: identifierSafetyEditPanel - shows all entries with question marks
Eternal ID of this version: #1015767/9
Text MD5: a9aac6f2198335835193cf0e7b2c40c5
Author: stefan
Category: javax / code analysis / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-27 16:51:46
Source code size: 983 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 364 / 394
Version history: 8 change(s)
Referenced in: [show references]