Can anyone give me any tips for handling background jobs that need to update a tool window? Is there any built in support in idea for handling this?
Doing activity in other thread and using ApplicationManager.getApplication().invokeLater() to update view would be fine. Do you need something advanced to control backround jobs? Priorities maybe?
>> Can anyone give me any tips for handling background jobs that need to >> update a tool window? Is there any built in support in idea for >> handling this?
Doing activity in other thread and using ApplicationManager.getApplication().invokeLater() to update view would be fine. Do you need something advanced to control backround jobs? Priorities maybe?
That is the sort of information I was after. How is this invoke later different to the one in SwingUtils? Is there anything else in the API that might be useful to know?
Application.invokeLater() is able to suspend invocation request until requested modality state is reached in IDEA UI. ModalityState encapsulates the configuration of modal dialogs (including progress indicator) being shown if any.
InvokeLater() being called without ModaliltyState parameter will pass default modality state wich would be as follows: 1. When invoked from swing dispatch thread: current configuration of the dialogs 2. When invoked from other thread: NON_MODAL (no dialogs opened).
In your case calling to Application.invokeLater() with default modality state would result in toolwindow updates only when there's no any activity in the foreground.
Glen Stampoultzis wrote:
Doing activity in other thread and using
ApplicationManager.getApplication().invokeLater() to update view would
be fine. Do you need something advanced to control backround jobs?
Priorities maybe?
--
Maxim Shafirov
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Maxim Shafirov (JetBrains) wrote:
>> Can anyone give me any tips for handling background jobs that need to
>> update a tool window? Is there any built in support in idea for
>> handling this?
That is the sort of information I was after. How is this invoke later
different to the one in SwingUtils? Is there anything else in the API
that might be useful to know?
Application.invokeLater() is able to suspend invocation request until
requested modality state is reached in IDEA UI.
ModalityState encapsulates the configuration of modal dialogs (including
progress indicator) being shown if any.
InvokeLater() being called without ModaliltyState parameter will pass
default modality state wich would be as follows:
1. When invoked from swing dispatch thread: current configuration of the
dialogs
2. When invoked from other thread: NON_MODAL (no dialogs opened).
In your case calling to Application.invokeLater() with default modality
state would result in toolwindow updates only when there's no any
activity in the foreground.
--
Maxim Shafirov
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"