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).

!7

module TaskBar_dev extends DynObjectTable<S> {
  transient SimpleLiveValue<S> lvInvisible = stringLiveValue();
 
  start {
    dontPersist();
    if (dm_getBounds() == null) placeOnRight();
    defaultAction = voidfunc(S id) { dm_showModule(id) };
    itemToMap = itemToMap_calcSingleColumn("Module", f dm_moduleName);
    ownResource(vmBus_onModulesListChange(rstUpdate()));
    rstUpdate().trigger();
  }
  
  void update {
    L invis = dm_invisibleModules();
    lvInvisible.set(empty(invis) ? "" : "+ " + l(invis) + " invisible");
    data = null; // force update
    setData(sortedByCalculatedFieldIC(f dm_moduleName, dm_visibleModuleIDs()));
  }
  
  visualize {
    JComponent c = super.visualize();
    for (final Pair<S, VF1<O>> p : dm_moduleMenuItems())
      tablePopupMenuItem(table,
        p.a, voidfunc(final int row) { thread { callF(p.b, dm_getModule(_get(data, row))); } });
    ret northAndCenter(
       withMargin(3, onLeftClick(jRightAlignedLiveValueLabel(lvInvisible), r dm_showInvisibleModulesList)),
      c);
  }
  
  enhanceFrame {
    addTitlePopupMenuItems(f, "Place on the right", rThread placeOnRight);
  }
  
  void placeOnRight enter { dm_placeOnRight(); }
}

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: 242 / 6373
Version history: 2 change(s)
Referenced in: [show references]