How to display json in a new window?


I have added a menu item to the debugger menu. After certain manipulations, I get a json string. Now I need to display this json string in a new window with highlighting and other things (collapsing code blocks, line numbering). The window should not close by itself. How do I do this?

public class DebuggerTreeActionImpl extends DebuggerTreeAction {

    protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
      //my code ...
      String json = "here is json";
      //Here you need to create a window and display json.

Comment actions Permalink


I don't understand what you mean that the window should not close by itself.

I suggest opening dialog:

and using

in the dialog.

Comment actions Permalink

Karol Lewandowski The modal window blocks the parent window, am I right? I need to create a window by the event, and so that the creation of this window does not affect the operation of all the main windows and tabs.

Comment actions Permalink

It doesn't have to block the parent window. It depends on the "modal" flag:

The link above is the implementation of dialog which is invoked with Evaluate Expression... action while debugging. It's not modal, so you can see and use its content and use the debugger at the same time.


Please sign in to leave a comment.