presenter

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 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 EditTextPresenter

type EditTextPresenter struct {
	OnModified func()
	ReadOnly   bool
	Selection  bool
	// contains filtered or unexported fields
}

func (*EditTextPresenter) Handle

func (edit *EditTextPresenter) Handle(view View, ev tcell.Event)

func (*EditTextPresenter) IsFocusable

func (edit *EditTextPresenter) IsFocusable() bool

func (*EditTextPresenter) Present

func (edit *EditTextPresenter) Present(view View)

func (*EditTextPresenter) ShowCursor

func (edit *EditTextPresenter) ShowCursor() bool

type FrameTextPresenter

type FrameTextPresenter struct {
}

func (*FrameTextPresenter) Handle

func (f *FrameTextPresenter) Handle(view View, ev tcell.Event)

func (*FrameTextPresenter) IsFocusable

func (f *FrameTextPresenter) IsFocusable() bool

func (*FrameTextPresenter) Present

func (f *FrameTextPresenter) Present(view View)

func (*FrameTextPresenter) ShowCursor

func (f *FrameTextPresenter) ShowCursor() bool

type HorizontalSeparatorTextPresenter

type HorizontalSeparatorTextPresenter struct {
}

func (*HorizontalSeparatorTextPresenter) Handle

func (h *HorizontalSeparatorTextPresenter) Handle(view View, ev tcell.Event)

func (*HorizontalSeparatorTextPresenter) IsFocusable

func (h *HorizontalSeparatorTextPresenter) IsFocusable() bool

func (*HorizontalSeparatorTextPresenter) Present

func (h *HorizontalSeparatorTextPresenter) Present(view View)

func (*HorizontalSeparatorTextPresenter) ShowCursor

func (h *HorizontalSeparatorTextPresenter) ShowCursor() bool

type LabelTextPresenter

type LabelTextPresenter struct {
	Text        string
	AlignCenter bool
}

func (*LabelTextPresenter) Handle

func (label *LabelTextPresenter) Handle(view View, ev tcell.Event)

func (*LabelTextPresenter) IsFocusable

func (label *LabelTextPresenter) IsFocusable() bool

func (*LabelTextPresenter) Present

func (label *LabelTextPresenter) Present(view View)

func (*LabelTextPresenter) ShowCursor

func (label *LabelTextPresenter) ShowCursor() bool

type LineNumberTextPresenter

type LineNumberTextPresenter struct {
	TargetView View
}

func (*LineNumberTextPresenter) Handle

func (ln *LineNumberTextPresenter) Handle(view View, ev tcell.Event)

func (*LineNumberTextPresenter) IsFocusable

func (ln *LineNumberTextPresenter) IsFocusable() bool

func (*LineNumberTextPresenter) Present

func (ln *LineNumberTextPresenter) Present(view View)

func (*LineNumberTextPresenter) ShowCursor

func (ln *LineNumberTextPresenter) ShowCursor() bool

type ListTextPresenter

type ListTextPresenter struct {
	Items         []string
	SelectedIndex int
	CursorChar    rune
	Prefix        string
}

func (*ListTextPresenter) AddItem

func (lp *ListTextPresenter) AddItem(item string)

AddItem is adds a new item to the list

func (*ListTextPresenter) Clear

func (lp *ListTextPresenter) Clear()

Clear is removes all items from the list

func (*ListTextPresenter) GetSelectedIndex

func (lp *ListTextPresenter) GetSelectedIndex() int

GetSelectedIndex returns the currently selected index

func (*ListTextPresenter) GetSelectedItem

func (lp *ListTextPresenter) GetSelectedItem() string

GetSelectedItem returns the currently selected item

func (*ListTextPresenter) Handle

func (lp *ListTextPresenter) Handle(view View, ev tcell.Event)

func (*ListTextPresenter) IsFocusable

func (lp *ListTextPresenter) IsFocusable() bool

func (*ListTextPresenter) Present

func (lp *ListTextPresenter) Present(view View)

func (*ListTextPresenter) RemoveItem

func (lp *ListTextPresenter) RemoveItem(index int)

RemoveItem is removes an item at the specified index

func (*ListTextPresenter) SetSelectedIndex

func (lp *ListTextPresenter) SetSelectedIndex(index int)

SetSelectedIndex is sets the selected index

func (*ListTextPresenter) ShowCursor

func (lp *ListTextPresenter) ShowCursor() bool

type ScrollBarTextPresenter

type ScrollBarTextPresenter struct {
	TargetView View
}

func (*ScrollBarTextPresenter) Handle

func (sb *ScrollBarTextPresenter) Handle(view View, ev tcell.Event)

func (*ScrollBarTextPresenter) IsFocusable

func (sb *ScrollBarTextPresenter) IsFocusable() bool

func (*ScrollBarTextPresenter) Present

func (sb *ScrollBarTextPresenter) Present(view View)

func (*ScrollBarTextPresenter) ShowCursor

func (sb *ScrollBarTextPresenter) ShowCursor() bool

type Segment

type Segment struct {
	TextLayout    *view.TextLayout
	IsGhostLine   bool
	ModelLine     int
	ViewLine      int
	LocalViewLine int
}

type TreeNode

type TreeNode struct {
	Name       string
	Path       string
	IsDir      bool
	IsExpanded bool
	Children   []*TreeNode
	Parent     *TreeNode
	Level      int
}

type TreeTextPresenter

type TreeTextPresenter struct {
	RootDirectory string

	OnFileOpen func(filePath string)
	// contains filtered or unexported fields
}

func (*TreeTextPresenter) GetSelectedPath

func (t *TreeTextPresenter) GetSelectedPath() string

func (*TreeTextPresenter) Handle

func (t *TreeTextPresenter) Handle(view View, ev tcell.Event)

func (*TreeTextPresenter) IsFocusable

func (t *TreeTextPresenter) IsFocusable() bool

func (*TreeTextPresenter) Present

func (t *TreeTextPresenter) Present(view View)

func (*TreeTextPresenter) Reload

func (t *TreeTextPresenter) Reload()

Reload reloads the children of all expanded nodes in the tree

func (*TreeTextPresenter) ReloadPath

func (t *TreeTextPresenter) ReloadPath(path string)

ReloadPath reloads the children of the node at the specified path if it exists and is expanded

func (*TreeTextPresenter) ReloadSelected

func (t *TreeTextPresenter) ReloadSelected()

ReloadSelected reloads the children of the currently selected node if it's a directory

func (*TreeTextPresenter) Reset

func (t *TreeTextPresenter) Reset(rootDirectory string)

func (*TreeTextPresenter) ShowCursor

func (t *TreeTextPresenter) ShowCursor() bool

type VerticalSeparatorTextPresenter

type VerticalSeparatorTextPresenter struct {
}

func (*VerticalSeparatorTextPresenter) Handle

func (v *VerticalSeparatorTextPresenter) Handle(view View, ev tcell.Event)

func (*VerticalSeparatorTextPresenter) IsFocusable

func (v *VerticalSeparatorTextPresenter) IsFocusable() bool

func (*VerticalSeparatorTextPresenter) Present

func (v *VerticalSeparatorTextPresenter) Present(view View)

func (*VerticalSeparatorTextPresenter) ShowCursor

func (v *VerticalSeparatorTextPresenter) ShowCursor() bool

type View

type View interface {
	TextFrame()
	TextVertical()
	TextHorizontal()
	TextClear()
	CursorUpdate()
	InsertString(s string)
	RemoveChar()
	RemoveSelection()
	Submit() bool
	SelectionStart()
	SelectionEnd()
	MoveLeft()
	MoveRight()
	MoveUp()
	MoveDown()
	MoveLineStart()
	MoveLineEnd()
	MoveReset()
	BreakIter() iter.Seq[Segment]
	GetDocument() model.Document
	GetWidth() int
	GetHeight() int
	GetScrollX() int
	GetScrollY() int
	GetViewHeight() int
	GetViewPosition() int
}

Jump to

Keyboard shortcuts

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