Newer
Older
package views
import (
"github.com/gdamore/tcell"
"github.com/rivo/tview"
)
type CommandListView struct {
rootNode *tview.TreeNode
commandsTree *tview.TreeView
}
func NewCommandListView(rootTitle string) *CommandListView {
v := &CommandListView{
rootNode: tview.NewTreeNode(rootTitle),
commandsTree: tview.NewTreeView(),
}
v.commandsTree.
SetRoot(v.rootNode).
SetTitle("Commands").
SetBorder(true).
SetBorderColor(tcell.ColorSteelBlue)
return v
}
func (c *CommandListView) GetContent() tview.Primitive {
return c.commandsTree
}
func (v *CommandListView) GetCommands(path string) {
//TODO: change to use commandlist
}
func (v *CommandListView) SelectedFunc() {
//TODO: call GRPC calls for the selected item
}