possible to get active task status and text

Hi,

Can I get any active background task(s), as shown in the status bar. I'm interested in getting the current percentage completion and the text.

I have tried many things, really, to no avail.

cheers, jamie

0
正式评论

You can invoke ((StatusBarEx) WindowManager.getInstance().getFrame(project).getStatusBar()).getBackgroundProcesses()

After that you can query the returned progress indicators for getText(), getFraction() etc.

Thank you Peter, you are awesome.

I tried (amongst other things):

project.getMessageBus().connect(project).subscribe(StatusBar.Info.TOPIC, new StatusBarInfo() { ... }

But I only received null text via setInfo.

0

That event is about "status" content in the status bar, which is to the right of the "progress" content, and quite different. It's mostly changed when you mouse-over an action, or put your caret onto a warning in the editor.

0

Is there any other method of getting the background tasks? Problem is I need this to work in headless mode, and getFrame() is null then.

0

In headless mode, the platform runs most its processes (e.g. indexing) synchronously, without background tasks. Do you have any specific tasks in mind?

0

Yes, I am starting to realise that. My problem is that I require headless mode but so far I have been working in headed mode as it's easier, and the transition is harder than I expected.

The particular task right now is importing a project from a maven pom. 

 

0

请先登录再写评论。