KetraTerm
API · DevelopmentAll versions

SwingTerminalSearchBar

Optional host-owned search bar for a SwingTerminal.

The bar owns visible search chrome only. Search scanning, highlight projection, and result navigation stay in SwingTerminal. Hosts decide whether to instantiate this class, where to mount component, and which shortcuts invoke its actions. The bar installs no command shortcuts; normal Swing focus traversal and button activation remain available.

Parameters

terminal

terminal whose headless search API backs this bar.

messages

host message bundle, read on the EDT outside painting. Static labels are captured at construction.

Constructors

Link copied to clipboard
constructor(terminal: SwingTerminal, messages: SwingHostMessages)
constructor(terminal: SwingTerminal)

Creates a search bar using the JVM display locale and bundled messages.

Properties

Link copied to clipboard

Swing component that hosts should mount as floating pane chrome.

Functions

Link copied to clipboard
fun close()

Closes the search bar and clears active terminal search highlights.

Link copied to clipboard

Returns whether the search bar is visible.

Link copied to clipboard
fun open()

Opens the search bar and focuses the query field.

Link copied to clipboard

Performs a host-selected search action on the EDT, using the same behavior as its button. Returns false when the bar is closed and the host should leave the command unclaimed.

Link copied to clipboard

Reapplies the last supplied colors. Off-EDT calls enqueue work on the EDT.

Applies one prepared host palette without changing the query, visibility or search. Off-EDT calls enqueue work on the EDT; EDT calls apply immediately and repaint. The snapshot is retained until replaced, including across close/open cycles.

Link copied to clipboard

Supplies plain-text shortcut hints from the host's actual bindings. Install on the EDT. provider is read on the EDT when a tooltip is requested, so keymap changes appear without rebuilding the bar. Return null or blank text for an unbound action. This does not install bindings or choose shortcuts.