GtBridge.Phlow.ColumnedTree (gt_bridge v0.17.2)

Copy Markdown View Source

A Phlow columned tree view specification.

Displays a hierarchical tree with multiple columns in GT's inspector.

Summary

Functions

Convert the columned tree view to a dictionary format for serialization to GT.

Set the children function that returns children for a given item.

Add a column to the view.

Set the items to display. Can be a list or a function that returns a list.

Set the priority of the view.

Set the title of the view.

Types

t()

@type t() :: %GtBridge.Phlow.ColumnedTree{
  children_callback: (any() -> list()) | nil,
  columns: [GtBridge.Phlow.Column.t()],
  items_callback: (-> list()) | nil,
  view_priority: integer(),
  view_title: String.t()
}

Functions

as_dict(self)

@spec as_dict(t()) :: map()

Convert the columned tree view to a dictionary format for serialization to GT.

children(self, children_fn)

@spec children(t(), (any() -> list())) :: t()

Set the children function that returns children for a given item.

column(self, title, format_fn \\ nil)

@spec column(t(), String.t(), (any() -> String.t()) | nil) :: t()

Add a column to the view.

items(self, items_list)

@spec items(t(), list() | (-> list())) :: t()

Set the items to display. Can be a list or a function that returns a list.

priority(self, priority_value)

@spec priority(t(), integer()) :: t()

Set the priority of the view.

title(self, title_text)

@spec title(t(), String.t()) :: t()

Set the title of the view.