Skip to content

Improve EditorKit injection warning for platform users - #9721

Open
mbien wants to merge 1 commit into
apache:deliveryfrom
mbien:improve-editor-kit-warning
Open

mbien wants to merge 1 commit into
apache:deliveryfrom
mbien:improve-editor-kit-warning

Conversation

@mbien

@mbien mbien commented Oct 16, 2026

Copy link
Copy Markdown
Member
  • add migration path to the warning to make it more useful for platform or plugin developers
  • nb.disable.editorkit.hack can now be used to disable the kit injection including the warning
  • the default value of the flag will be set true in future first, before subsequent removal of the code

meta #9523

targets delivery

 - add migration path to the warning to make it more useful for
   platform or plugin developers
 - 'nb.disable.editorkit.hack' can now be used to disable the kit
   injection including the warning
 - the default value of the flag will be set true in future first,
   before subsequent removal of the code
@mbien mbien added this to the NB32 milestone Oct 16, 2026
@mbien
mbien requested a review from neilcsmith-net October 16, 2026 03:13
@mbien mbien added Editor Platform [ci] enable platform tests (platform/*) labels Oct 16, 2026

@lahodaj lahodaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. For the next release, we should change the setting to true/disable; and maybe think of adding a Jackpot rule.

@mbien

mbien commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

yep. thought about a jackpot rule too. but one constructor usage as no direct match i believe (still useful).

@neilcsmith-net neilcsmith-net left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Hopefully not too noisy in IDE usage.

Jackpot rule might be hard to get correct, as some usages are legitimate (built-ins). And the other fix is for people to register using JEditorPane::registerEditorKitForContentType as in the removed comment. That could be done in a module installer instead.

I assume the reason that the commented code was never used is that it can't handle lazy registration. The other fix here might be to listen on lookup for EditorKit availability and register using the proper Swing API. Given we're unlikely to do that for NB32 though, it's probably better to just assume removal of this feature.

@mbien

mbien commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

Jackpot rule might be hard to get correct

there is also the option to write the hint in java. There are some platform specific hints already.

but we would have to know what it should suggest, e.g the html mime type didn't work when I tried #9713 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Editor Platform [ci] enable platform tests (platform/*)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants