listTable

package
v0.0.0-...-6c48755 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRowFunc         = func(row commander.Row) bool { return false }
	DefaultRowKeyEventFunc = func(row commander.Row, event *tcell.EventKey) bool { return false }
	DefaultInit            = func() {}
)

Functions

func KeySwitch

func KeySwitch(event interface{}, keyFunc func(ev *tcell.EventKey) bool) bool

func NewStaticRowProvider

func NewStaticRowProvider(columns []string, rows []commander.Row) commander.RowProvider

Types

type InitFunc

type InitFunc func()

type ListTable

type ListTable struct {
	views.WidgetWatchers
	*focus.Focusable
	// contains filtered or unexported fields
}

func NewListTable

func NewListTable(prov commander.RowProvider, format TableFormat, screen commander.ScreenHandler) *ListTable

func NewStaticListTable

func NewStaticListTable(columns []string, rows []commander.Row, format TableFormat, screen commander.ScreenHandler) *ListTable

func (*ListTable) BindOnChange

func (lt *ListTable) BindOnChange(rowFunc RowFunc)

func (*ListTable) BindOnInitFinish

func (lt *ListTable) BindOnInitFinish(initFunc InitFunc)

func (*ListTable) BindOnInitStart

func (lt *ListTable) BindOnInitStart(initFunc InitFunc)

func (*ListTable) BindOnKeyPress

func (lt *ListTable) BindOnKeyPress(rowKeyEventFunc RowKeyEventFunc)

func (*ListTable) Draw

func (lt *ListTable) Draw()

func (*ListTable) End

func (lt *ListTable) End()

func (*ListTable) HandleEvent

func (lt *ListTable) HandleEvent(ev tcell.Event) bool

func (*ListTable) Home

func (lt *ListTable) Home()

func (*ListTable) Left

func (lt *ListTable) Left()

func (*ListTable) MaxSize

func (lt *ListTable) MaxSize() (w int, h int)

func (*ListTable) Next

func (lt *ListTable) Next()

func (*ListTable) NextPage

func (lt *ListTable) NextPage()

func (*ListTable) OnHide

func (lt *ListTable) OnHide()

func (*ListTable) OnShow

func (lt *ListTable) OnShow()

func (*ListTable) Prev

func (lt *ListTable) Prev()

func (*ListTable) PrevPage

func (lt *ListTable) PrevPage()

func (*ListTable) Render

func (lt *ListTable) Render()

func (*ListTable) Resize

func (lt *ListTable) Resize()

func (*ListTable) Right

func (lt *ListTable) Right()

func (*ListTable) RowById

func (lt *ListTable) RowById(id string) commander.Row

func (*ListTable) SelectId

func (lt *ListTable) SelectId(id string)

func (*ListTable) SelectIndex

func (lt *ListTable) SelectIndex(index int)

func (*ListTable) SelectedRow

func (lt *ListTable) SelectedRow() commander.Row

func (*ListTable) SelectedRowId

func (lt *ListTable) SelectedRowId() string

func (*ListTable) SelectedRowIndex

func (lt *ListTable) SelectedRowIndex() int

func (*ListTable) SetLeft

func (lt *ListTable) SetLeft(index int)

func (*ListTable) SetView

func (lt *ListTable) SetView(view views.View)

func (*ListTable) Size

func (lt *ListTable) Size() (int, int)

This is the minimum required size of ListTable

type ResourceListTable

type ResourceListTable struct {
	*ListTable
	// contains filtered or unexported fields
}

func NewResourceListTable

func NewResourceListTable(container commander.ResourceContainer, resource *commander.Resource, format TableFormat) *ResourceListTable

func (*ResourceListTable) OnHide

func (r *ResourceListTable) OnHide()

func (*ResourceListTable) OnKeyPress

func (r *ResourceListTable) OnKeyPress(row commander.Row, event *tcell.EventKey) bool

func (*ResourceListTable) OnShow

func (r *ResourceListTable) OnShow()

func (ResourceListTable) RowMetadata

func (*ResourceListTable) SetExtraRows

func (r *ResourceListTable) SetExtraRows(rows map[int]commander.Row)

type RowFunc

type RowFunc func(row commander.Row) bool

type RowKeyEventFunc

type RowKeyEventFunc func(row commander.Row, event *tcell.EventKey) bool

type TableFormat

type TableFormat uint16
const (
	WithHeaders TableFormat = 1 << iota
	Wide
	Short
	NameOnly
	NoHorizontalScroll
	NoVerticalScroll
	NoActions
	NoWatch
	WithFilter
	AlwaysFilter
)

func (TableFormat) Has

func (tf TableFormat) Has(flag TableFormat) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL