Skip to content

issue #7456: TextComposite toolbar with find/replace and plugin SPI - #7907

Draft
mattcasters wants to merge 2 commits into
apache:mainfrom
mattcasters:issue-7456
Draft

issue #7456: TextComposite toolbar with find/replace and plugin SPI#7907
mattcasters wants to merge 2 commits into
apache:mainfrom
mattcasters:issue-7456

Conversation

@mattcasters

Copy link
Copy Markdown
Contributor

Summary

Implements in-editor search for multi-line SQL/script/text fields (issue #7456), and opens the same surface for plugins:

  • Toolbar on TextComposite (same SPI model as TableView): undo/redo, cut/copy/paste, select all, find, find/replace
  • Find/replace dialog with Ctrl+F / Ctrl+H and context menu
  • styleType constructor parameter so toolbar filters see SQL/JSON/… at build time (filters run mid-construction)
  • Plugin contribution via @GuiToolbarElement + @GuiToolbarElementFilter on TextComposite.ID_TOOLBAR
  • Sample JSON pretty-print button in the JSON transform plugin
  • Developer documentation: GUI plugins and toolbars
  • Config option to show/hide the text editor toolbar

Notes for reviewers

  • Prefer getStyleType() over instanceof specialized subclasses (Hop Web stand-ins).
  • @GuiToolbarElementFilter runs during host construction: use constructor styleType only; check isEditable() / content in the action method.
  • Runtime: TextFindSupport unit tests; compile verified for ui and affected plugins.

Test plan

  • Open Table Input / Exec SQL / SQL Editor: toolbar visible; Ctrl+F finds text; Ctrl+H replace works
  • Mongo/JSON fields (styleType JSON): format-JSON toolbar button appears; pretty-prints valid JSON; invalid JSON shows error dialog
  • Read-only log panels: find available; edit actions disabled where appropriate
  • Configuration → show text editor toolbar off: toolbars hidden
  • Hop Web: SQL fields use StyledTextComp with STYLE_TYPE_SQL; toolbar/find still work

Fixes #7456

… SPI

Add an extensible toolbar on multi-line text editors (SQL, scripts, JSON,
logs, and so on) with built-in edit actions and find/replace, a styleType
constructor parameter for GuiToolbarElementFilter, developer documentation,
and a sample JSON pretty-print toolbar contribution.
@mattcasters mattcasters added this to the 2.20 milestone Aug 11, 2026
@mattcasters
mattcasters marked this pull request as draft August 11, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Search field for the SQL HOPs

1 participant