Create a background task in IntelliJ plugin

后端 未结 2 1000
难免孤独
难免孤独 2021-02-05 13:51

I\'m developing an IntelliJ-idea plugin and want to run code in background task (visible in the background tasks dialog and in another thread than the UI).

I found the f

2条回答
  •  广开言路
    2021-02-05 14:25

    Here is the general solution

    ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
        public void run() {
            ApplicationManager.getApplication().runReadAction(new Runnable() {
                public void run() {
                // do whatever you need to do
                }
            });
        }
    });
    

提交回复
热议问题