Documentation ¶
Index ¶
- func CreateColumnsList(unchanged, added, removed []string) *tview.TextView
- type CellsPool
- type DataTable
- func (t *DataTable) GetShape() (rowCount, columnCount int)
- func (t *DataTable) SetColumnStatuses(cells []*TableCell) *DataTable
- func (t *DataTable) SetGetCellsFunc(getCells func(row, column int) []*TableCell) *DataTable
- func (t *DataTable) SetPrimaryKeyIndices(pk []uint32) *DataTable
- func (t *DataTable) SetShape(rowCount, columnCount int) *DataTable
- type DiffTable
- type MergeApp
- type MergeRow
- type MergeRowPool
- type MergeTable
- func (t *MergeTable) GetCellText(row, column, subrow int) string
- func (t *MergeTable) GetSelection() (row, subRow, column int)
- func (t *MergeTable) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (t *MergeTable) RefreshRow(row int) *MergeTable
- func (t *MergeTable) Select(row, column int)
- func (t *MergeTable) SetAbortHandler(f func()) *MergeTable
- func (t *MergeTable) SetCell(row, column int, val string, unresolved bool)
- func (t *MergeTable) SetDeleteColumnHandler(f func(column int)) *MergeTable
- func (t *MergeTable) SetDeleteRowHandler(f func(row int)) *MergeTable
- func (t *MergeTable) SetFinishHandler(f func()) *MergeTable
- func (t *MergeTable) SetRedoHandler(f func()) *MergeTable
- func (t *MergeTable) SetResolveHandler(f func(row int)) *MergeTable
- func (t *MergeTable) SetSelectNextConflict(f func()) *MergeTable
- func (t *MergeTable) SetSetCellHandler(f func(row, column, layer int)) *MergeTable
- func (t *MergeTable) SetShowInputHandler(f func(row, column int)) *MergeTable
- func (t *MergeTable) SetUndoHandler(f func()) *MergeTable
- func (t *MergeTable) SetUnresolveHandler(f func(row int)) *MergeTable
- type PaginatedTextView
- func (v *PaginatedTextView) PullText() error
- func (v *PaginatedTextView) SetChangedFunc(handler func()) *PaginatedTextView
- func (v *PaginatedTextView) SetDynamicColors(dynamic bool) *PaginatedTextView
- func (v *PaginatedTextView) SetPullText(f func() ([]byte, error)) *PaginatedTextView
- func (v *PaginatedTextView) Write(p []byte) (n int, err error)
- type PreviewTable
- type ProgressBar
- type SelectableTable
- func (t *SelectableTable) Draw(screen tcell.Screen)
- func (t *SelectableTable) GetSelection() (row int, column int, subColumn int)
- func (t *SelectableTable) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (t *SelectableTable) MouseHandler() ...
- func (t *SelectableTable) Select(row, column, subCol int) *SelectableTable
- func (t *SelectableTable) SetGetCellsFunc(getCells func(row, column int) []*TableCell) *SelectableTable
- func (t *SelectableTable) SetMinSelection(row, column int) *SelectableTable
- func (t *SelectableTable) SetSelectedFunc(handler func(row, column, subColumn int)) *SelectableTable
- func (t *SelectableTable) SetSelectionChangedFunc(handler func()) *SelectableTable
- func (t *SelectableTable) WrapInputHandler(f func(event *tcell.EventKey, setFocus func(p tview.Primitive)) bool) func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- type TabPages
- func (p *TabPages) AddTab(label string, item tview.Primitive) *TabPages
- func (p *TabPages) Draw(screen tcell.Screen)
- func (p *TabPages) LastTab() tview.Primitive
- func (p *TabPages) ProcessInput(event *tcell.EventKey) *tcell.EventKey
- func (p *TabPages) SetLabel(item tview.Primitive, label string) error
- type TableCell
- func (c *TableCell) BackgroundColor() tcell.Color
- func (c *TableCell) Color() tcell.Color
- func (c *TableCell) DisableTransparency(disable bool) *TableCell
- func (c *TableCell) FlipStyle() *TableCell
- func (c *TableCell) GetPosition() (x, y, width int)
- func (c *TableCell) Reset()
- func (c *TableCell) SetAlign(align int) *TableCell
- func (c *TableCell) SetAttributes(attr tcell.AttrMask) *TableCell
- func (c *TableCell) SetBackgroundColor(color tcell.Color) *TableCell
- func (c *TableCell) SetClickedFunc(clicked func() bool) *TableCell
- func (c *TableCell) SetExpansion(expansion int) *TableCell
- func (c *TableCell) SetFlipped(s bool) *TableCell
- func (c *TableCell) SetMaxWidth(maxWidth int) *TableCell
- func (c *TableCell) SetPosition(x, y, width int) *TableCell
- func (c *TableCell) SetStyle(style tcell.Style) *TableCell
- func (c *TableCell) SetText(text string) *TableCell
- func (c *TableCell) SetTextColor(color tcell.Color) *TableCell
- func (c *TableCell) SetTransparency(transparent bool) *TableCell
- type UsageBar
- type VirtualTable
- func (t *VirtualTable) Draw(screen tcell.Screen)
- func (t *VirtualTable) GetOffset() (row, column int)
- func (t *VirtualTable) GetShape() (rowCount, columnCount int)
- func (t *VirtualTable) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (t *VirtualTable) KeepColumnInView(column int) *VirtualTable
- func (t *VirtualTable) MouseHandler() ...
- func (t *VirtualTable) ScrollToBeginning() *VirtualTable
- func (t *VirtualTable) ScrollToEnd() *VirtualTable
- func (t *VirtualTable) SetBorders(show bool) *VirtualTable
- func (t *VirtualTable) SetBordersColor(color tcell.Color) *VirtualTable
- func (t *VirtualTable) SetDoneFunc(handler func(key tcell.Key)) *VirtualTable
- func (t *VirtualTable) SetFixed(rows, columns int) *VirtualTable
- func (t *VirtualTable) SetGetCellsFunc(getCell func(row, column int) []*TableCell) *VirtualTable
- func (t *VirtualTable) SetOffset(row, column int) *VirtualTable
- func (t *VirtualTable) SetOnVisibleCellsChangeFunc(handler func(rows, columns []int)) *VirtualTable
- func (t *VirtualTable) SetSeparator(separator rune) *VirtualTable
- func (t *VirtualTable) SetShape(rowCount, columnCount int) *VirtualTable
- func (t *VirtualTable) SetSubSeparator(separator rune) *VirtualTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateColumnsList ¶
Types ¶
type CellsPool ¶ added in v0.8.0
type CellsPool struct {
// contains filtered or unexported fields
}
func NewCellsPool ¶ added in v0.8.0
func NewCellsPool(t *VirtualTable) *CellsPool
type DataTable ¶
type DataTable struct { *SelectableTable // contains filtered or unexported fields }
DataTable add following behaviors on top of SelectableTable: - Add row number column to the left corner - Hoist primary key columns to the left right next to row number column - Make row number and primary key columns fixed in place - Make column names (first row) fixed in place - Apply default styling to the fixed columns and rows
func NewDataTable ¶
func NewDataTable() *DataTable
func (*DataTable) SetColumnStatuses ¶
func (*DataTable) SetGetCellsFunc ¶
SetGetCellsFunc set function to get table cell at a position
func (*DataTable) SetPrimaryKeyIndices ¶
SetPrimaryKeyIndices records primary key columns and hoist them to the beginning
type DiffTable ¶
type DiffTable struct { *DataTable // contains filtered or unexported fields }
func NewDiffTable ¶
func NewDiffTable(reader *diff.RowChangeReader) *DiffTable
func (*DiffTable) UpdateRowCount ¶
func (t *DiffTable) UpdateRowCount()
type MergeApp ¶
type MergeApp struct { RemovedCols map[int]struct{} Table *MergeTable Flex *tview.Flex Finished bool // contains filtered or unexported fields }
func NewMergeApp ¶
func NewMergeApp(buf *diff.BlockBuffer, merger *merge.Merger, app *tview.Application, commitNames []string, commitSums [][]byte, baseSum []byte) *MergeApp
func (*MergeApp) BeforeDraw ¶
func (a *MergeApp) BeforeDraw(screen tcell.Screen)
type MergeRow ¶
type MergeRow struct { Cells [][]*TableCell // contains filtered or unexported fields }
func NewMergeRow ¶
type MergeRowPool ¶
type MergeRowPool struct {
// contains filtered or unexported fields
}
func NewMergeRowPool ¶
func NewMergeRowPool(blkBuf *diff.BlockBuffer, cd *diff.ColDiff, names []string, merges []*merge.Merge) *MergeRowPool
func (*MergeRowPool) GetCell ¶
func (p *MergeRowPool) GetCell(row, col, subrow int) *TableCell
func (*MergeRowPool) IsTextAtCellDifferentFromBase ¶
func (p *MergeRowPool) IsTextAtCellDifferentFromBase(row, col, layer int) bool
func (*MergeRowPool) RefreshRow ¶
func (p *MergeRowPool) RefreshRow(row int)
type MergeTable ¶
type MergeTable struct { *SelectableTable // contains filtered or unexported fields }
func NewMergeTable ¶
func (*MergeTable) GetCellText ¶
func (t *MergeTable) GetCellText(row, column, subrow int) string
func (*MergeTable) GetSelection ¶
func (t *MergeTable) GetSelection() (row, subRow, column int)
func (*MergeTable) InputHandler ¶
func (t *MergeTable) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
func (*MergeTable) RefreshRow ¶
func (t *MergeTable) RefreshRow(row int) *MergeTable
func (*MergeTable) Select ¶
func (t *MergeTable) Select(row, column int)
func (*MergeTable) SetAbortHandler ¶
func (t *MergeTable) SetAbortHandler(f func()) *MergeTable
func (*MergeTable) SetCell ¶
func (t *MergeTable) SetCell(row, column int, val string, unresolved bool)
func (*MergeTable) SetDeleteColumnHandler ¶
func (t *MergeTable) SetDeleteColumnHandler(f func(column int)) *MergeTable
func (*MergeTable) SetDeleteRowHandler ¶
func (t *MergeTable) SetDeleteRowHandler(f func(row int)) *MergeTable
func (*MergeTable) SetFinishHandler ¶
func (t *MergeTable) SetFinishHandler(f func()) *MergeTable
func (*MergeTable) SetRedoHandler ¶
func (t *MergeTable) SetRedoHandler(f func()) *MergeTable
func (*MergeTable) SetResolveHandler ¶
func (t *MergeTable) SetResolveHandler(f func(row int)) *MergeTable
func (*MergeTable) SetSelectNextConflict ¶
func (t *MergeTable) SetSelectNextConflict(f func()) *MergeTable
func (*MergeTable) SetSetCellHandler ¶
func (t *MergeTable) SetSetCellHandler(f func(row, column, layer int)) *MergeTable
func (*MergeTable) SetShowInputHandler ¶
func (t *MergeTable) SetShowInputHandler(f func(row, column int)) *MergeTable
func (*MergeTable) SetUndoHandler ¶
func (t *MergeTable) SetUndoHandler(f func()) *MergeTable
func (*MergeTable) SetUnresolveHandler ¶
func (t *MergeTable) SetUnresolveHandler(f func(row int)) *MergeTable
type PaginatedTextView ¶
func NewPaginatedTextView ¶
func NewPaginatedTextView() *PaginatedTextView
func (*PaginatedTextView) PullText ¶
func (v *PaginatedTextView) PullText() error
func (*PaginatedTextView) SetChangedFunc ¶
func (v *PaginatedTextView) SetChangedFunc(handler func()) *PaginatedTextView
func (*PaginatedTextView) SetDynamicColors ¶
func (v *PaginatedTextView) SetDynamicColors(dynamic bool) *PaginatedTextView
func (*PaginatedTextView) SetPullText ¶
func (v *PaginatedTextView) SetPullText(f func() ([]byte, error)) *PaginatedTextView
type PreviewTable ¶
type PreviewTable struct { *DataTable // contains filtered or unexported fields }
func NewPreviewTable ¶
func (*PreviewTable) SetRowCount ¶
func (t *PreviewTable) SetRowCount(num int) *PreviewTable
type ProgressBar ¶
func NewProgressBar ¶
func NewProgressBar(desc string) *ProgressBar
func (*ProgressBar) Draw ¶
func (b *ProgressBar) Draw(screen tcell.Screen)
func (*ProgressBar) SetCurrent ¶
func (b *ProgressBar) SetCurrent(num int64) *ProgressBar
func (*ProgressBar) SetTotal ¶
func (b *ProgressBar) SetTotal(num int64) *ProgressBar
type SelectableTable ¶
type SelectableTable struct { *VirtualTable // contains filtered or unexported fields }
SelectableTable add following behaviors on top of VirtualTable: - Allow selecting cell and row (by selecting row number cell) - Define default selected style
func NewSelectableTable ¶
func NewSelectableTable() *SelectableTable
func (*SelectableTable) Draw ¶
func (t *SelectableTable) Draw(screen tcell.Screen)
func (*SelectableTable) GetSelection ¶
func (t *SelectableTable) GetSelection() (row int, column int, subColumn int)
func (*SelectableTable) InputHandler ¶
func (t *SelectableTable) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
func (*SelectableTable) MouseHandler ¶
func (t *SelectableTable) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler returns the mouse handler for this primitive.
func (*SelectableTable) Select ¶
func (t *SelectableTable) Select(row, column, subCol int) *SelectableTable
Select sets the selected cell. Depending on the selection settings specified via SetSelectable(), this may be an entire row or column, or even ignored completely. The "selection changed" event is fired if such a callback is available (even if the selection ends up being the same as before and even if cells are not selectable).
func (*SelectableTable) SetGetCellsFunc ¶
func (t *SelectableTable) SetGetCellsFunc(getCells func(row, column int) []*TableCell) *SelectableTable
SetGetCellsFunc set function to get table cell at a position
func (*SelectableTable) SetMinSelection ¶
func (t *SelectableTable) SetMinSelection(row, column int) *SelectableTable
SetMinSelection tells table to prevent selection from going below certain index
func (*SelectableTable) SetSelectedFunc ¶
func (t *SelectableTable) SetSelectedFunc(handler func(row, column, subColumn int)) *SelectableTable
SetSelectedFunc sets a handler which is called whenever the user presses the Enter key on a selected cell/row/column. The handler receives the position of the selection and its cell contents. If entire rows are selected, the column index is undefined. Likewise for entire columns.
func (*SelectableTable) SetSelectionChangedFunc ¶
func (t *SelectableTable) SetSelectionChangedFunc(handler func()) *SelectableTable
func (*SelectableTable) WrapInputHandler ¶
type TabPages ¶
func NewTabPages ¶
func NewTabPages(app *tview.Application) *TabPages
func (*TabPages) ProcessInput ¶
func (p *TabPages) ProcessInput(event *tcell.EventKey) *tcell.EventKey
type TableCell ¶
type TableCell struct { // The text to be displayed in the table cell. Text string // The alignment of the cell text. One of AlignLeft (default), AlignCenter, // or AlignRight. Align int // The maximum width of the cell in screen space. This is used to give a // column a maximum width. Any cell text whose screen width exceeds this width // is cut off. Set to 0 if there is no maximum width. MaxWidth int // If the total table width is less than the available width, this value is // used to add extra width to a column. See SetExpansion() for details. Expansion int // If set to true, the BackgroundColor is not used and the cell will have // the background color of the table. Transparent bool // The style attributes of the cell. Attributes tcell.AttrMask // An optional handler for mouse clicks. Clicked func() bool // contains filtered or unexported fields }
TableCell represents one cell inside a Table.
func NewTableCell ¶
func (*TableCell) BackgroundColor ¶
func (c *TableCell) BackgroundColor() tcell.Color
func (*TableCell) DisableTransparency ¶
func (*TableCell) GetPosition ¶
GetPosition returns the position of the table cell on screen. If the cell is not on screen, the return values are
func (*TableCell) SetAlign ¶
SetAlign sets the cell's text alignment, one of AlignLeft, AlignCenter, or AlignRight.
func (*TableCell) SetAttributes ¶
SetAttributes sets the cell's text attributes. You can combine different attributes using bitmask operations:
cell.SetAttributes(tcell.AttrUnderline | tcell.AttrBold)
func (*TableCell) SetBackgroundColor ¶
SetBackgroundColor sets the cell's background color. This will also cause the cell's Transparent flag to be set to "false".
func (*TableCell) SetClickedFunc ¶
SetClickedFunc sets a handler which fires when this cell is clicked.
func (*TableCell) SetExpansion ¶
SetExpansion sets the value by which the column of this cell expands if the available width for the table is more than the table width (prior to applying this expansion value). This is a proportional value. The amount of unused horizontal space is divided into widths to be added to each column. How much extra width a column receives depends on the expansion value: A value of 0 (the default) will not cause the column to increase in width. Other values are proportional, e.g. a value of 2 will cause a column to grow by twice the amount of a column with a value of 1.
Since this value affects an entire column, the maximum over all visible cells in that column is used.
This function panics if a negative value is provided.
func (*TableCell) SetFlipped ¶
SetFlipped sets the flipped state of cell. When a cell is in flipped state, it returns cell.color as background color and vice versa.
func (*TableCell) SetMaxWidth ¶
SetMaxWidth sets maximum width of the cell in screen space. This is used to give a column a maximum width. Any cell text whose screen width exceeds this width is cut off. Set to 0 if there is no maximum width.
func (*TableCell) SetPosition ¶
SetPosition sets position on screen for table cell.
func (*TableCell) SetStyle ¶
SetStyle sets the cell's style (foreground color, background color, and attributes) all at once.
func (*TableCell) SetTextColor ¶
SetTextColor sets the cell's text color.
func (*TableCell) SetTransparency ¶
SetTransparency sets the background transparency of this cell. A value of "true" will cause the cell to use the table's background color. A value of "false" will cause it to use its own background color.
type UsageBar ¶
func DataTableUsage ¶
func DataTableUsage() *UsageBar
func NewUsageBar ¶
func (*UsageBar) BeforeDraw ¶
type VirtualTable ¶
func NewVirtualTable ¶
func NewVirtualTable() *VirtualTable
func (*VirtualTable) Draw ¶
func (t *VirtualTable) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*VirtualTable) GetOffset ¶
func (t *VirtualTable) GetOffset() (row, column int)
GetOffset returns the current row and column offset. This indicates how many rows and columns the table is scrolled down and to the right.
func (*VirtualTable) GetShape ¶
func (t *VirtualTable) GetShape() (rowCount, columnCount int)
GetShape get number of rows and number of columns
func (*VirtualTable) InputHandler ¶
func (t *VirtualTable) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler returns the handler for this primitive.
func (*VirtualTable) KeepColumnInView ¶
func (t *VirtualTable) KeepColumnInView(column int) *VirtualTable
func (*VirtualTable) MouseHandler ¶
func (t *VirtualTable) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler returns the mouse handler for this primitive.
func (*VirtualTable) ScrollToBeginning ¶
func (t *VirtualTable) ScrollToBeginning() *VirtualTable
ScrollToBeginning scrolls the table to the beginning to that the top left corner of the table is shown.
func (*VirtualTable) ScrollToEnd ¶
func (t *VirtualTable) ScrollToEnd() *VirtualTable
ScrollToEnd scrolls the table to the beginning to that the bottom left corner of the table is shown. Adding more rows to the table will cause it to automatically scroll with the new data.
func (*VirtualTable) SetBorders ¶
func (t *VirtualTable) SetBorders(show bool) *VirtualTable
SetBorders sets whether or not each cell in the table is surrounded by a border.
func (*VirtualTable) SetBordersColor ¶
func (t *VirtualTable) SetBordersColor(color tcell.Color) *VirtualTable
SetBordersColor sets the color of the cell borders.
func (*VirtualTable) SetDoneFunc ¶
func (t *VirtualTable) SetDoneFunc(handler func(key tcell.Key)) *VirtualTable
SetDoneFunc sets a handler which is called whenever the user presses the Escape, Tab, or Backtab key.
func (*VirtualTable) SetFixed ¶
func (t *VirtualTable) SetFixed(rows, columns int) *VirtualTable
SetFixed sets the number of fixed rows and columns which are always visible even when the rest of the cells are scrolled out of view. Rows are always the top-most ones. Columns are always the left-most ones.
func (*VirtualTable) SetGetCellsFunc ¶
func (t *VirtualTable) SetGetCellsFunc(getCell func(row, column int) []*TableCell) *VirtualTable
SetGetCellsFunc set function to get table cell at a position
func (*VirtualTable) SetOffset ¶
func (t *VirtualTable) SetOffset(row, column int) *VirtualTable
SetOffset sets how many rows and columns should be skipped when drawing the table. This is useful for large tables that do not fit on the screen.
Fixed rows and columns are never skipped.
func (*VirtualTable) SetOnVisibleCellsChangeFunc ¶ added in v0.8.0
func (t *VirtualTable) SetOnVisibleCellsChangeFunc(handler func(rows, columns []int)) *VirtualTable
func (*VirtualTable) SetSeparator ¶
func (t *VirtualTable) SetSeparator(separator rune) *VirtualTable
SetSeparator sets the character used to fill the space between two neighboring cells. This is a space character ' ' per default but you may want to set it to Borders.Vertical (or any other rune) if the column separation should be more visible. If cell borders are activated, this is ignored.
Separators have the same color as borders.
func (*VirtualTable) SetShape ¶
func (t *VirtualTable) SetShape(rowCount, columnCount int) *VirtualTable
SetShape sets total number of rows and columns
func (*VirtualTable) SetSubSeparator ¶ added in v0.8.0
func (t *VirtualTable) SetSubSeparator(separator rune) *VirtualTable
SetSubSeparator sets the character used to fill the space between two sub cells. This is a space character ' ' per default but you may want to set it to Borders.Vertical (or any other rune) if the column separation should be more visible. If cell borders are activated, this is ignored.
Separators have the same color as borders.