elements

package
v1.3.14 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHeaders

func FormatHeaders(headers http.Header) []string

Types

type Button

type Button struct {
	window.View
	// contains filtered or unexported fields
}

func NewButton

func NewButton(mw *window.Window, text string, area window.AreaTransformer) *Button

func (*Button) Draw

func (e *Button) Draw(c *console.Console)

func (*Button) GetText

func (e *Button) GetText() string

func (*Button) IsPressed

func (e *Button) IsPressed() bool

func (*Button) OnEvent

func (e *Button) OnEvent(event tb.Event)

func (*Button) OnPress

func (e *Button) OnPress(onPress func()) *Button

func (*Button) OnRelease

func (e *Button) OnRelease(onRelease func()) *Button

func (*Button) Press

func (e *Button) Press()

func (*Button) Release

func (e *Button) Release()

func (*Button) SetCustomStyle

func (e *Button) SetCustomStyle(customStyle tb.Attribute)

func (*Button) SetInactive

func (e *Button) SetInactive()

func (*Button) SetPressedStyle

func (e *Button) SetPressedStyle(style window.ButtonStyle)

func (*Button) SetReleasedStyle

func (e *Button) SetReleasedStyle(style window.ButtonStyle)

func (*Button) SetText

func (e *Button) SetText(text string)

type ColorJSONScheme

type ColorJSONScheme struct {
	KeyColor          tb.Attribute
	KeyObjectColor    tb.Attribute
	ValueColor        tb.Attribute
	TagColor          tb.Attribute
	ColonColor        tb.Attribute
	CollapseSignColor tb.Attribute
}

func DefaultColorJSONScheme

func DefaultColorJSONScheme() ColorJSONScheme

type Container

type Container struct {
	window.View
}

func NewContainer

func NewContainer(areaTransformer window.AreaTransformer) *Container

func (*Container) Draw

func (e *Container) Draw(c *console.Console)

type Frame

type Frame struct {
	window.View
	// contains filtered or unexported fields
}

func NewFrame

func NewFrame(areaTransformer window.AreaTransformer, style window.FrameStyle) *Frame

func (*Frame) Draw

func (e *Frame) Draw(c *console.Console)

type HLine

type HLine struct {
	window.View
	// contains filtered or unexported fields
}

func NewHLine

func NewHLine(areaTransformer window.AreaTransformer) *HLine

func (*HLine) Draw

func (e *HLine) Draw(c *console.Console)

type HeadersView

type HeadersView struct {
	SelectView
	// contains filtered or unexported fields
}

func NewHeadersView

func NewHeadersView(areaTransformer window.AreaTransformer) *HeadersView

func (*HeadersView) Foregrounds

func (e *HeadersView) Foregrounds(selected, _ bool, s string) ([]tb.Attribute, tb.Attribute)

func (*HeadersView) SetHeaders

func (e *HeadersView) SetHeaders(headers http.Header)

func (*HeadersView) SetKeyColor

func (e *HeadersView) SetKeyColor(color tb.Attribute)

func (*HeadersView) SetValueColor

func (e *HeadersView) SetValueColor(color tb.Attribute)

type JSONView

type JSONView struct {
	window.View
	// contains filtered or unexported fields
}

func NewJSONView

func NewJSONView(areaTransformer window.AreaTransformer) *JSONView

func (*JSONView) Colours

func (e *JSONView) Colours(colors ColorJSONScheme) *JSONView

func (*JSONView) Draw

func (e *JSONView) Draw(c *console.Console)

func (*JSONView) Home

func (e *JSONView) Home()

func (*JSONView) OnEvent

func (e *JSONView) OnEvent(event tb.Event)

func (*JSONView) OnSpace

func (e *JSONView) OnSpace()

func (*JSONView) PrintLine

func (e *JSONView) PrintLine(c *console.Console, x, y int, s string, fgs []tb.Attribute, bg tb.Attribute)

func (*JSONView) ScrollDown

func (e *JSONView) ScrollDown()

func (*JSONView) ScrollLeft

func (e *JSONView) ScrollLeft()

func (*JSONView) ScrollRight

func (e *JSONView) ScrollRight()

func (*JSONView) ScrollUp

func (e *JSONView) ScrollUp()

func (*JSONView) Set

func (e *JSONView) Set(obj interface{})

func (*JSONView) SetHighlightColor

func (e *JSONView) SetHighlightColor(hlColor tb.Attribute)

func (*JSONView) WithColorJSONScheme

func (e *JSONView) WithColorJSONScheme(jsonColors ColorJSONScheme) *JSONView

type SelectView

type SelectView struct {
	window.View
	// contains filtered or unexported fields
}

func NewSelectView

func NewSelectView(areaTransformer window.AreaTransformer) *SelectView

func (*SelectView) Append

func (e *SelectView) Append(content SelectViewItem)

func (*SelectView) Draw

func (e *SelectView) Draw(c *console.Console)

func (*SelectView) GetItems

func (e *SelectView) GetItems() []SelectViewItem

func (*SelectView) GetNotVisited

func (e *SelectView) GetNotVisited() int

func (*SelectView) GetSize

func (e *SelectView) GetSize() int

func (*SelectView) Home

func (e *SelectView) Home()

func (*SelectView) InitSelectView

func (e *SelectView) InitSelectView(areaTransformer window.AreaTransformer, foregrounds func(bool, bool, string) ([]tb.Attribute, tb.Attribute))

func (*SelectView) MarkAllVisited

func (e *SelectView) MarkAllVisited()

func (*SelectView) OnChange

func (e *SelectView) OnChange(onChange func()) *SelectView

func (*SelectView) OnEnd

func (e *SelectView) OnEnd()

func (*SelectView) OnEvent

func (e *SelectView) OnEvent(event tb.Event)

func (*SelectView) OnSelect

func (e *SelectView) OnSelect(onSelect func(l interface{})) *SelectView

func (*SelectView) ResetMarker

func (e *SelectView) ResetMarker()

func (*SelectView) ScrollDown

func (e *SelectView) ScrollDown(visit bool)

func (*SelectView) ScrollLeft

func (e *SelectView) ScrollLeft()

func (*SelectView) ScrollRight

func (e *SelectView) ScrollRight()

func (*SelectView) ScrollUp

func (e *SelectView) ScrollUp(visit bool)

func (*SelectView) Set

func (e *SelectView) Set(content []SelectViewItem)

func (*SelectView) SetHighlightColor

func (e *SelectView) SetHighlightColor(hlColor tb.Attribute)

func (*SelectView) SetVisitedColor

func (e *SelectView) SetVisitedColor(color tb.Attribute)

type SelectViewItem

type SelectViewItem interface {
	String() string
}

type TextView

type TextView struct {
	window.View
	// contains filtered or unexported fields
}

func NewTextView

func NewTextView(areaTransformer window.AreaTransformer, text string) *TextView

func (*TextView) Draw

func (e *TextView) Draw(c *console.Console)

func (*TextView) GetText

func (e *TextView) GetText() string

func (*TextView) SetText

func (e *TextView) SetText(text string)

type Toggle

type Toggle struct {
	Button
}

func NewToggle

func NewToggle(mw *window.Window, text string, areaTransformer window.AreaTransformer) *Toggle

func (*Toggle) OnEvent

func (e *Toggle) OnEvent(event tb.Event)

type VLine

type VLine struct {
	window.View
	// contains filtered or unexported fields
}

func NewVLine

func NewVLine(areaTransformer window.AreaTransformer) *VLine

func (*VLine) Draw

func (e *VLine) Draw(c *console.Console)

type Value

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

func (*Value) Collapse

func (e *Value) Collapse(lines []string) []byte

func (*Value) Collapsed

func (e *Value) Collapsed() bool

func (*Value) GetByRow

func (e *Value) GetByRow(row int) *Value

func (*Value) Inflate

func (e *Value) Inflate(lines []string) []byte

Jump to

Keyboard shortcuts

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