title: Create a background task in IntelliJ plugin
body: <p>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).</p>
  
  <p>I found the following <a href="https://github.com/inmite/android-selector-chapek/blob/master/src/utils/RunnableHelper.java">Helper class</a> and tried it by passing a Runnable object and implement its run method but it still blocking the UI and when I tried to do the threading myself i got the following error</p>
  
  <pre><code> Read access is allowed from event dispatch thread or inside read-action only (see com.intellij.openapi.application.Application.runReadAction())
       Details: Current thread: Thread[Thread-69 [WriteAccessToken],6,Idea Thread Group] 532224832
       Our dispatch thread:Thread[AWT-EventQueue-1 12.1.4#IU-129.713, eap:false,6,Idea Thread Group] 324031064
       SystemEventQueueThread: Thread[AWT-EventQueue-1 12.1.4#IU-129.713, eap:false,6,Idea Thread Group] 324031064
  </code></pre>