ProgressIndicator () { return myIndicator != null ? myIndicator : ApplicationManager.getApplication().isHeadlessEnvironment() ? new EmptyProgressIndicator() : new BackgroundableProcessIndicator(myTask); // BackgroundableProcessIndicator should be created from EDT }