FileBrowserTreeViewDelegate

class omni.kit.widget.filebrowser.tree_view.FileBrowserTreeViewDelegate(headers: Tuple[str], theme: str, **kwargs)

Bases: AbstractItemDelegate

The delegate that manages building browser items under the model as widgets inside the tree view.

Parameters
  • headers (Tuple[str]) – Tuple of columns to show in the tree view.

  • theme (str) – The theme name to use.

Keyword Arguments
  • mouse_pressed_fn (Callable) – Function called on mouse press. Function signature: void mouse_pressed_fn(item: FileBrowserItem, x: float, y: float, button: int, key_mode: int)

  • mouse_double_clicked_fn (Callable) – Function called on mouse double click. Function signature: void mouse_double_clicked_fn(item: FileBrowserItem, x: float, y: float, button: int, key_mode: int)

  • column_clicked_fn (Callable) – Function called when column clicked. Function signature: void column_clicked_fn(column_id: int)

  • datetime_format_changed_fn (Callable) – Function called when datetime format changed. Function signature: void datetime_format_changed_fn()

  • sort_by_column (int) – The column index to sort items, defaults to 0.

  • sort_ascending (bool) – Sort in ascending or otherwise descending order, defaults to ascending.

  • builtin_columnt_count (int) – Set count of builtin columns.

  • icon_provider (object) – Set this to override default icons.

Methods

__init__(self)

Constructs AbstractItemDelegate.

build_branch(model, item, column_id, level, ...)

Create a branch widget that opens or closes subtree.

build_header(column_id)

Build the given column.

build_widget(model, item, column_id, level, ...)

Create a widget per item.

clear_futures()

Stop and destroy all working futures

destroy()

Destructor.

set_column_delegates(delegates)

Add custom columns

Attributes

sort_ascending

Return True when sort in ascending order.

sort_by_column

Return the column index used for sorting.

__init__(self: omni.ui._ui.AbstractItemDelegate) None

Constructs AbstractItemDelegate.

`kwargsdict`

See below

### Keyword Arguments:

build_branch(model: FileBrowserModel, item: FileBrowserItem, column_id: int, level: int, expanded: bool)

Create a branch widget that opens or closes subtree.

Parameters
  • model (FileBrowserModel) – The model to build the branch with.

  • item (FileBrowserItem) – The item to build.

  • column_id (int) – ID of the column.

  • level (int) – level of the item inside the tree.

  • expanded (bool) – Set if the item is expanded.

build_header(column_id: int)

Build the given column.

Parameters

column_id (int) – ID of the column.

build_widget(model: FileBrowserModel, item: FileBrowserItem, column_id: int, level: int, expanded: bool)

Create a widget per item.

Parameters
  • model (FileBrowserModel) – The model to build the widget with.

  • item (FileBrowserItem) – The item to build.

  • column_id (int) – ID of the column.

  • level (int) – level of the item inside the tree.

  • expanded (bool) – Set if the item is expanded.

clear_futures()

Stop and destroy all working futures

destroy()

Destructor.

set_column_delegates(delegates: List[AbstractColumnDelegate])

Add custom columns

property sort_ascending: bool

Return True when sort in ascending order.

property sort_by_column: int

Return the column index used for sorting.