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

37
LINES

< > BotCompany Repo | #1019712 // Vertical Task Bar As List [faster than #1018410, older version]

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

Libraryless. Click here for Pure Java version (15799L/110K).

1  
!7
2  
3  
module TaskBar_dev extends DynObjectTable<S> {
4  
  transient SimpleLiveValue<S> lvInvisible = stringLiveValue();
5  
 
6  
  start {
7  
    dontPersist();
8  
    if (dm_getBounds() == null) placeOnRight();
9  
    defaultAction = voidfunc(S id) { dm_showModule(id) };
10  
    itemToMap = itemToMap_calcSingleColumn("Module", f dm_moduleName);
11  
    ownResource(vmBus_onModulesListChange(rstUpdate()));
12  
    rstUpdate().trigger();
13  
  }
14  
  
15  
  void update {
16  
    L invis = dm_invisibleModules();
17  
    lvInvisible.set(empty(invis) ? "" : "+ " + l(invis) + " invisible");
18  
    data = null; // force update
19  
    setData(sortedByCalculatedFieldIC(f dm_moduleName, dm_visibleModuleIDs()));
20  
  }
21  
  
22  
  visualize {
23  
    JComponent c = super.visualize();
24  
    for (final Pair<S, VF1<O>> p : dm_moduleMenuItems())
25  
      tablePopupMenuItem(table,
26  
        p.a, voidfunc(final int row) { thread { callF(p.b, dm_getModule(_get(data, row))); } });
27  
    ret northAndCenter(
28  
       withMargin(3, onLeftClick(jRightAlignedLiveValueLabel(lvInvisible), r dm_showInvisibleModulesList)),
29  
      c);
30  
  }
31  
  
32  
  enhanceFrame {
33  
    addTitlePopupMenuItems(f, "Place on the right", rThread placeOnRight);
34  
  }
35  
  
36  
  void placeOnRight enter { dm_placeOnRight(); }
37  
}

Author comment

Began life as a copy of #1019172

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, hpgrupgrauku, irmadwmeruwu, ishqpsrjomds, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019712
Snippet name: Vertical Task Bar As List [faster than #1018410, older version]
Eternal ID of this version: #1019712/3
Text MD5: 42be3a0c179670a5ff442bded91776bc
Transpilation MD5: 7e03b72282ec968f9999dbf6786b2388
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-11-28 14:08:03
Source code size: 1232 bytes / 37 lines
Pitched / IR pitched: No / No
Views / Downloads: 322 / 6482
Version history: 2 change(s)
Referenced in: [show references]