(app *App)
| 67 | } |
| 68 | |
| 69 | func (sb *StorageBrowser) SetApp(app *App) { |
| 70 | sb.app = app |
| 71 | |
| 72 | treeNav := createNavigationInputCapture(app, nil, sb.contentTable) |
| 73 | var pendingG bool |
| 74 | sb.tree.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { |
| 75 | if handleVimTopBottomRune(event, &pendingG, func() { |
| 76 | sb.jumpTreeTop() |
| 77 | }, func() { |
| 78 | sb.jumpTreeBottom() |
| 79 | }) { |
| 80 | return nil |
| 81 | } |
| 82 | |
| 83 | return treeNav(event) |
| 84 | }) |
| 85 | |
| 86 | detailsNav := createNavigationInputCapture(app, sb.tree, sb.contentTable) |
| 87 | pendingG = false |
| 88 | sb.details.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { |
| 89 | if sb.handlePaneCycleKey(event, sb.contentTable, sb.contentTable) { |
| 90 | return nil |
| 91 | } |
| 92 | if handleVimTopBottomRune(event, &pendingG, func() { |
| 93 | jumpTableTop(sb.details) |
| 94 | }, func() { |
| 95 | jumpTableBottom(sb.details) |
| 96 | }) { |
| 97 | return nil |
| 98 | } |
| 99 | return detailsNav(event) |
| 100 | }) |
| 101 | |
| 102 | contentNav := createNavigationInputCapture(app, sb.tree, nil) |
| 103 | pendingG = false |
| 104 | sb.contentTable.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { |
| 105 | if sb.handlePaneCycleKey(event, sb.details, sb.details) { |
| 106 | return nil |
| 107 | } |
| 108 | if sb.handleContentFilterKey(event) { |
| 109 | return nil |
| 110 | } |
| 111 | if handleVimTopBottomRune(event, &pendingG, func() { |
| 112 | jumpTableTop(sb.contentTable) |
| 113 | }, func() { |
| 114 | jumpTableBottom(sb.contentTable) |
| 115 | }) { |
| 116 | return nil |
| 117 | } |
| 118 | return contentNav(event) |
| 119 | }) |
| 120 | sb.contentTable.SetSelectionChangedFunc(func(row, column int) { |
| 121 | sb.handleContentSelection(row) |
| 122 | }) |
| 123 | } |
| 124 | |
| 125 | func (sb *StorageBrowser) SetNodes(nodes []*api.Node) { |
| 126 | sb.nodes = cloneAndSortStorageNodes(nodes) |
nothing calls this directly
no test coverage detected