controller

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

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseController

type BaseController struct {
	IController
	// contains filtered or unexported fields
}

BaseController is the base controller for all controllers

type Controllers

type Controllers struct {
	// contains filtered or unexported fields
}

Controllers contains all controllers

func CreateControllers

func CreateControllers(g *gocui.Gui, views *view.Views) *Controllers

CreateControllers creates controllers object

func (*Controllers) GetController

func (c *Controllers) GetController(controllerType Type) IController

GetController returns controller by type

type Event

type Event int8
const (
	ShowErrorLog Event = iota
	InputVisible
	LogVisible
)

type ExplorerController

type ExplorerController struct {
	*BaseController
	// contains filtered or unexported fields
}

ExplorerController is the controller for the explorer view

func (*ExplorerController) Focus

func (ec *ExplorerController) Focus()

Focus focuses cursor to the current entry

func (*ExplorerController) FocusByIndex

func (ec *ExplorerController) FocusByIndex(idx int)

FocusPrevious focuses the previous entry

func (*ExplorerController) FocusFirst

func (ec *ExplorerController) FocusFirst()

FocusFirst focuses the first entry

func (*ExplorerController) FocusLast

func (ec *ExplorerController) FocusLast()

FocusLast focuses the last entry

func (*ExplorerController) FocusNext

func (ec *ExplorerController) FocusNext()

FocusNext focuses the next entry

func (*ExplorerController) FocusPath

func (ec *ExplorerController) FocusPath(path string)

FocusPath focuses the entry with the given path

func (*ExplorerController) FocusPrevious

func (ec *ExplorerController) FocusPrevious()

FocusPrevious focuses the previous entry

func (*ExplorerController) GetCurrentEntry

func (ec *ExplorerController) GetCurrentEntry() fs.IEntry

GetCurrentEntry returns the current entry

func (*ExplorerController) GetEntries

func (ec *ExplorerController) GetEntries() []fs.IEntry

GetEntries returns the list of entries

func (*ExplorerController) GetFocus

func (ec *ExplorerController) GetFocus() int

GetFocus returns the index of the focused entry

func (*ExplorerController) GetPath

func (ec *ExplorerController) GetPath() string

GetPath returns the current path

func (*ExplorerController) LoadDirectory

func (ec *ExplorerController) LoadDirectory(path string, focusPath optional.Optional[string])

LoadDirectory loads the directory at the given path

func (*ExplorerController) UpdateView

func (ec *ExplorerController) UpdateView()

UpdateView updates the view

type HelpController

type HelpController struct {
	*BaseController
	// contains filtered or unexported fields
}

HelpController is a controller for help view.

func (*HelpController) SetHelp

func (hc *HelpController) SetHelp(title string, keys []string, msgs []string)

SetHelp sets the help information.

func (*HelpController) UpdateView

func (hc *HelpController) UpdateView()

UpdateView updates the view.

type IController

type IController interface{}

IController interface

type InputController

type InputController struct {
	*BaseController
	// contains filtered or unexported fields
}

InputController is a controller for input view

func (*InputController) GetInputBuffer

func (ic *InputController) GetInputBuffer() string

GetInputBuffer gets content from the input buffer

func (*InputController) SetInputBuffer

func (ic *InputController) SetInputBuffer(input string)

SetInputBuffer sets `input` to the input buffer, this action will show the input view

func (*InputController) UpdateInputBufferFromKey

func (ic *InputController) UpdateInputBufferFromKey(key key.Key)

UpdateInputBufferFromKey updates the input buffer from key

type LogController

type LogController struct {
	*BaseController
	// contains filtered or unexported fields
}

LogController is a controller for log view

func (*LogController) SetLog

func (lc *LogController) SetLog(level view.LogLevel, msgFormat string, args ...interface{})

SetLog sets the log level and message

func (*LogController) SetVisible

func (lc *LogController) SetVisible(visible bool)

SetVisible sets the visibility of the log view

func (*LogController) ShowLog

func (lc *LogController) ShowLog()

ShowLog shows the log view

func (*LogController) UpdateView

func (lc *LogController) UpdateView()

UpdateView updates the log view

type Mediator

type Mediator interface {
	// contains filtered or unexported methods
}

Mediator is the mediator between controllers

type SelectionController

type SelectionController struct {
	*BaseController
	// contains filtered or unexported fields
}

SelectionController is a controller for selection view.

func (*SelectionController) ClearSelections

func (sc *SelectionController) ClearSelections()

ClearSelections clears all selections.

func (*SelectionController) GetSelections

func (sc *SelectionController) GetSelections() []string

GetSelections returns the current selections.

func (*SelectionController) SelectPath

func (sc *SelectionController) SelectPath(path string)

SelectPath add the given path to selection list.

func (*SelectionController) ToggleSelection

func (sc *SelectionController) ToggleSelection(path string)

ToggleSelection toggles the selection of the given item.

type Type

type Type int8
const (
	Explorer Type = iota
	Help
	Selection
	Log
	Input
)

Jump to

Keyboard shortcuts

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