Implementing line number display and code folding in the LanguageTextField class

Answered

I need a json data browser. I have implemented syntax highlighting.
But this is not enough, I also need to display the line number and foldable for better reading
This is my current code:

this.editorPane = new LanguageTextField(JsonLanguage.INSTANCE, project, "", false);
templateDataScrollPane.setViewportView(this.editorPane);
this.editorPane.setText(jsonString);

 

0
3 comments
Avatar
Permanently deleted user

Or I can use other class, please tell me, thanks

0

You can access Editor's settings and set proper configuration by your own:

this.editorPane.getEditor().getSettings().setLineNumbersShown(true);
1
Avatar
Permanently deleted user

@Jakub Chrzanowski Yes, I have found it, thank you!

0

Please sign in to leave a comment.