Class CodeBlockRenderer
java.lang.Object
uno.anahata.ai.swing.render.CodeBlockRenderer
A utility class responsible for creating syntax-highlighted code block
components.
- Author:
- anahata
-
Method Summary
Modifier and TypeMethodDescriptionstatic JComponentrender(String language, String code, EditorKitProvider editorKitProvider) Creates a syntax-highlighted JEditorPane for the given code, wraps it in a JScrollPane, and returns the component.
-
Method Details
-
render
Creates a syntax-highlighted JEditorPane for the given code, wraps it in a JScrollPane, and returns the component.- Parameters:
language- The programming language for syntax highlighting.code- The source code to render.editorKitProvider- The provider to get the correct EditorKit from.- Returns:
- A JComponent (a JScrollPane containing the JEditorPane) ready to be displayed.
-
