Java code embedded in custom jpanel

Answered

Does idea have an API similar to the one shown above that can meet these requirements? Requirements: 1. Open the Java file and add a custom jpanel below the code (you can put text, buttons and other components); 2. This custom jpanel will not occupy line numbers or cover the code.

0
4 comments

Hi,

Yes, this is the Inlay API. If you want to implement something similar to https://www.jetbrains.com/idea/guide/assets/inline-comment-bea332fb.png, then check com.intellij.openapi.editor.ComponentInlayRenderer and related classes. Please note this is an experimental API, and may change in the future.

0

I can't find com.intellij.openapi.editor.ComponentInlayRenderer in IntelliJ IDEA 2020.2, is there any other solution in this version?

0

For older versions, please check com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentUIUtil methods and their usages in the intellij-community project.

0

Please sign in to leave a comment.