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

36
LINES

< > BotCompany Repo | #1019172 // Task Bar [vertical only, faster than #1018410]

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

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

!7

module TaskBar_dev extends DynObjectTable<S> {
  transient SimpleLiveValue<S> lvInvisible = stringLiveValue();
 
  start {
    dontPersist();
    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 #1018410

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019172
Snippet name: Task Bar [vertical only, faster than #1018410]
Eternal ID of this version: #1019172/18
Text MD5: f2f85239bde2e0b2afe2055e1d579ed6
Transpilation MD5: d107814057bb7f856d546cdc99a566db
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:10:49
Source code size: 1183 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 353 / 7737
Version history: 17 change(s)
Referenced in: [show references]