Bug 41806 - Platform mechanism for asynchronous prompts
Summary: Platform mechanism for asynchronous prompts
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-21 10:57 EDT by John Arthorne CLA
Modified: 2005-05-10 14:56 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2003-08-21 10:57:35 EDT
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.
Comment 1 Nick Edgar CLA 2003-09-02 14:28:27 EDT
Agree this would be useful.
Comment 2 Tod Creasey CLA 2003-09-03 13:46:51 EDT
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.
Comment 3 John Arthorne CLA 2003-10-28 18:35:45 EST
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.
Comment 4 John Arthorne CLA 2003-10-28 18:47:18 EST
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.
Comment 5 Dorian Birsan CLA 2003-10-28 20:29:15 EST
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.
Comment 6 Tod Creasey CLA 2003-11-10 10:20:56 EST
Fixed in build >20031110
Comment 7 Tod Creasey CLA 2005-05-10 14:56:08 EDT
Marking closed