CommandToolbar

UI Toolkit VisualElement providing an interactive command search field with fuzzy-matched results, keyboard navigation, and rich text highlighting. Loaded from a UXML template, it displays a TextField for input and a ListView for search results. Users type to search, navigate with Tab/Arrow keys, and press Enter to execute. Hosted by CommandToolbarOverlay in the SceneView.

Definition

Namespace: Paragon.Core.Command.Editor Assembly: Paragon.Editor.dll

[EditorToolbarElement(id, typeof(SceneView))]
public class CommandToolbar : VisualElement

Inheritance: VisualElement → CommandToolbar

Remarks

CommandToolbar is the core interactive element of the command toolbar overlay. It orchestrates:

  1. Input handling — The TextField captures user input and triggers fuzzy search via CommandSearch.

  2. Results display — The ListView renders sorted CommandSearchResult entries with matched characters highlighted in gold (#ffd700) using rich text tags.

  3. Keyboard navigation — Tab/Down arrow cycles forward, Up arrow cycles backward, Space locks selection, Escape/Backspace clears selection, Enter executes.

  4. Execution — Parses the input into a command name and parameters, then delegates to Command.Execute().

The toolbar only shows commands with zero parameters in search results (parameterized commands are filtered out to avoid complex toolbar interaction).

Keyboard Shortcuts

Key
Action

Tab / Down Arrow

Highlight next result (cycles)

Up Arrow

Highlight previous result (cycles)

Space

Lock highlighted result and refine search

Escape / Backspace (when highlighting)

Clear highlight, restore filter text

Enter

Execute the current input as a command

Result Text Format

Matched characters are wrapped in gold <color=#ffd700> tags. Parameters are appended in dimmed gray (#808080AA):

Properties

IsHighlightingResult

Returns true when a search result is currently highlighted (selected via keyboard navigation).

Methods

Initialize

Sets up the toolbar UI from the UXML template, configures the ListView and TextField, and registers input callbacks. Must be called after construction.

Parameter
Type
Description

overlay

CommandToolbarOverlay

The hosting overlay, used for position adjustments when results list resizes

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

See Also

Last updated