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

19
LINES

< > BotCompany Repo | #1017745 // Find all sections named "Log" or "System Log" and clear them all (doesn't really work)

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (14606L/101K).

!7

sclass FindSections > DynPrintLog {
  void start {
    L<JPanel> l = allSwingComponentsOfType(JPanel.class);
    for (JPanel p : l)
      if (eq(className(p), "main$JSection")) {
        S title = (S) call(p, 'getTitle);
        print("Section found: " + title);
        if (eqicOneOf(title, "log", "system log")) {
          JTextArea ta = childOfType(p, JTextArea);
          if (ta == myPrintLogComponent()) continue;
          printIndent(takeFirstLines(2, getText(ta)));
          clearTextArea(ta);
          print("CLEARED");
        }
      }
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017745
Snippet name: Find all sections named "Log" or "System Log" and clear them all (doesn't really work)
Eternal ID of this version: #1017745/8
Text MD5: 8c6f460e1a47164fe1132f99997fc3dc
Transpilation MD5: 5f9343ba71b95efa7e4e61986f3e630b
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-07 21:43:23
Source code size: 578 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 308 / 419
Version history: 7 change(s)
Referenced in: [show references]