Skip to content

Issue #7935 : Add pretty-print JSON button to Content Editor toolbar - #7937

Merged
hansva merged 1 commit into
apache:mainfrom
mattcasters:issue-7935
Aug 13, 2026
Merged

Issue #7935 : Add pretty-print JSON button to Content Editor toolbar#7937
hansva merged 1 commit into
apache:mainfrom
mattcasters:issue-7935

Conversation

@mattcasters

Copy link
Copy Markdown
Contributor

Summary

  • Extends TextCompositeToolbarJsonFormatButton so the existing pretty-print JSON action also appears on the shared Content Editor toolbar (IContentEditorWidget.GUI_PLUGIN_TOOLBAR_PARENT_ID).
  • Filters the button to editors with language json (e.g. explorer JsonExplorerFileType), matching the Markdown preview pattern.
  • Shares the Jackson pretty-print helper between TextComposite and Content Editor entry points.

Fixes #7935

Test plan

  • Compile plugins/transforms/json
  • Spotless apply on changed module
  • Open .json in Explorer: Pretty-print JSON button present on content editor toolbar
  • Non-JSON text files: button not shown
  • Format valid JSON: reformats and marks dirty
  • Invalid JSON: existing error dialog
  • Transform dialog JSON TextComposite still has the original format button

…olbar

Reuse TextCompositeToolbarJsonFormatButton to contribute the same format
action to IContentEditorWidget toolbars (explorer JSON files), filtered
by language == json.
@hansva
hansva merged commit a61ce27 into apache:main Aug 13, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Align the file types with the new TextComposite toolbar

2 participants