Community
Participate
Working Groups
In discussions with various teams on the subject of background build, someone suggested that platform UI introduce a mechanism to allow background processes to politely request interaction. Here is the scenario: - There is some long running process that may take several minutes to complete. At some point during that process, it needs to interact with the user (ask a question, show a warning, etc). The only option right now is to pop up a dialog. This is too intrusive in some cases. The user may be in the middle of some other task, and a modal dialog would force them to deal with the background request immediately. A more polite alternative is the Windows flashing button approach (when background shells open a modal dialog). When a background task needs interaction, it could add a blinking button to the status line (or next to the progress animation). The user can then chose to respond to the query when it is convenient for them. Another approach is a non-modal tooltip could pop up near the progress animation icon, saying something like, "A background task needs your input. Click here to respond." (like Windows update). This would look pretty slick, and avoid the user frustration of modal dialogs being thrust in their face from background processes.
Agree this would be useful.
A first cut of this support has been released into HEAD. There is now a ProgressFeedbackManager which has a method public IStatus requestInUI(UIJob job, String message) which takes a UIJob to run and message to inform the user of it. When this is called a non modal dialog is opened in which the user can double click the message and the UI job is run. This is only a first cut so please add comments/issues to this PR so that we can keep the list of interested parties consistent.
Current implementation fails every time: if(Thread.currentThread() == Display.getCurrent().getThread()){ throw new IllegalThreadStateException(ProgressMessages.getString("ProgressFeedbackManager.invalidThreadMessage")); //$NON-NLS-1$ } If in UI thread, it throws IllegalThreadStateException. If not in UI thread, it throws an NullPointerException because Display.getCurrent == null. Should be Display.getDefault() or some other way of getting display.
Also, the busy wait loop: while (wait[0]) { try { Thread.sleep(100); } catch (InterruptedException e) { } } should be replaced by: job.join(); It also shouldn't be possible to close the feedback request dialog until the user has responded, otherwise the UIJob is left stranded and the calling thread blocks forever.
The balloon tooltips in Windows taskbar area would be pretty slick, but if this is not easily achievable, perhaps a fast view could be used to display jobs requiring user interaction.
Fixed in build >20031110
Marking closed