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.
Please sign in to leave a comment.
I think what you are looking for is inlay hints: https://plugins.jetbrains.com/docs/intellij/inlay-hints.html
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.I can't find com.intellij.openapi.editor.ComponentInlayRenderer in IntelliJ IDEA 2020.2, is there any other solution in this version?
For older versions, please check
com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentUIUtil
methods and their usages in theintellij-community
project.