Documentation ¶
Index ¶
- type FileTreeViewModel
- func (vm *FileTreeViewModel) ConstrainLayout()
- func (vm *FileTreeViewModel) CursorDown() bool
- func (vm *FileTreeViewModel) CursorLeft(filterRegex *regexp.Regexp) error
- func (vm *FileTreeViewModel) CursorRight(filterRegex *regexp.Regexp) error
- func (vm *FileTreeViewModel) CursorUp() bool
- func (vm *FileTreeViewModel) ExpandLayout()
- func (vm *FileTreeViewModel) IsVisible() bool
- func (vm *FileTreeViewModel) PageDown() error
- func (vm *FileTreeViewModel) PageUp() error
- func (vm *FileTreeViewModel) Render() error
- func (vm *FileTreeViewModel) ResetCursor()
- func (vm *FileTreeViewModel) SetTreeByLayer(bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop int) error
- func (vm *FileTreeViewModel) Setup(lowerBound, height int)
- func (vm *FileTreeViewModel) ToggleAttributes() error
- func (vm *FileTreeViewModel) ToggleCollapse(filterRegex *regexp.Regexp) error
- func (vm *FileTreeViewModel) ToggleCollapseAll() error
- func (vm *FileTreeViewModel) ToggleShowDiffType(diffType filetree.DiffType)
- func (vm *FileTreeViewModel) ToggleSortOrder() error
- func (vm *FileTreeViewModel) Update(filterRegex *regexp.Regexp, width, height int) error
- type LayerCompareMode
- type LayerSelection
- type LayerSetState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileTreeViewModel ¶
type FileTreeViewModel struct { ModelTree *filetree.FileTree ViewTree *filetree.FileTree RefTrees []*filetree.FileTree CollapseAll bool ShowAttributes bool HiddenDiffTypes []bool TreeIndex int Buffer bytes.Buffer // contains filtered or unexported fields }
FileTreeViewModel holds the UI objects and data models for populating the right pane. Specifically the pane that shows selected layer or aggregate file ASCII tree.
func NewFileTreeViewModel ¶
func NewFileTreeViewModel(tree *filetree.FileTree, refTrees []*filetree.FileTree, cache filetree.Comparer) (treeViewModel *FileTreeViewModel, err error)
NewFileTreeViewModel creates a new view object attached the the global [gocui] screen object.
func (*FileTreeViewModel) ConstrainLayout ¶
func (vm *FileTreeViewModel) ConstrainLayout()
func (*FileTreeViewModel) CursorDown ¶
func (vm *FileTreeViewModel) CursorDown() bool
doCursorDown performs the internal view's buffer adjustments on cursor down. Note: this is independent of the gocui buffer.
func (*FileTreeViewModel) CursorLeft ¶
func (vm *FileTreeViewModel) CursorLeft(filterRegex *regexp.Regexp) error
CursorLeft moves the cursor up until we reach the Parent Node or top of the tree
func (*FileTreeViewModel) CursorRight ¶
func (vm *FileTreeViewModel) CursorRight(filterRegex *regexp.Regexp) error
CursorRight descends into directory expanding it if needed
func (*FileTreeViewModel) CursorUp ¶
func (vm *FileTreeViewModel) CursorUp() bool
doCursorUp performs the internal view's buffer adjustments on cursor up. Note: this is independent of the gocui buffer.
func (*FileTreeViewModel) ExpandLayout ¶
func (vm *FileTreeViewModel) ExpandLayout()
func (*FileTreeViewModel) IsVisible ¶
func (vm *FileTreeViewModel) IsVisible() bool
IsVisible indicates if the file tree view pane is currently initialized
func (*FileTreeViewModel) PageDown ¶
func (vm *FileTreeViewModel) PageDown() error
PageDown moves to next page putting the cursor on top
func (*FileTreeViewModel) PageUp ¶
func (vm *FileTreeViewModel) PageUp() error
PageUp moves to previous page putting the cursor on top
func (*FileTreeViewModel) Render ¶
func (vm *FileTreeViewModel) Render() error
Render flushes the state objects (file tree) to the pane.
func (*FileTreeViewModel) ResetCursor ¶
func (vm *FileTreeViewModel) ResetCursor()
ResetCursor moves the cursor back to the top of the buffer and translates to the top of the buffer.
func (*FileTreeViewModel) SetTreeByLayer ¶
func (vm *FileTreeViewModel) SetTreeByLayer(bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop int) error
SetTreeByLayer populates the view model by stacking the indicated image layer file trees.
func (*FileTreeViewModel) Setup ¶
func (vm *FileTreeViewModel) Setup(lowerBound, height int)
Setup initializes the UI concerns within the context of a global [gocui] view object.
func (*FileTreeViewModel) ToggleAttributes ¶
func (vm *FileTreeViewModel) ToggleAttributes() error
ToggleCollapse will collapse/expand the selected FileNode.
func (*FileTreeViewModel) ToggleCollapse ¶
func (vm *FileTreeViewModel) ToggleCollapse(filterRegex *regexp.Regexp) error
ToggleCollapse will collapse/expand the selected FileNode.
func (*FileTreeViewModel) ToggleCollapseAll ¶
func (vm *FileTreeViewModel) ToggleCollapseAll() error
ToggleCollapseAll will collapse/expand the all directories.
func (*FileTreeViewModel) ToggleShowDiffType ¶
func (vm *FileTreeViewModel) ToggleShowDiffType(diffType filetree.DiffType)
ToggleShowDiffType will show/hide the selected DiffType in the filetree pane.
func (*FileTreeViewModel) ToggleSortOrder ¶
func (vm *FileTreeViewModel) ToggleSortOrder() error
ToggleSortOrder will toggle the sort order in which files are displayed
type LayerCompareMode ¶
type LayerCompareMode int
const ( CompareSingleLayer LayerCompareMode = iota CompareAllLayers )
type LayerSelection ¶
type LayerSetState ¶
type LayerSetState struct { LayerIndex int Layers []*image.Layer CompareMode LayerCompareMode CompareStartIndex int }
func NewLayerSetState ¶
func NewLayerSetState(layers []*image.Layer, compareMode LayerCompareMode) *LayerSetState
func (*LayerSetState) GetCompareIndexes ¶
func (state *LayerSetState) GetCompareIndexes() (bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop int)
getCompareIndexes determines the layer boundaries to use for comparison (based on the current compare mode)