[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] BusyIndicator with unknown duration

Hi!

I'd like to use the BusyIndicator. The problem I have is, that the
duration of blocking the GUI isn't know. Thus I want to walk through a
while loop as long as their statement is true. I'd like to control the
loop via a global attribute.

Anyway, the implementation is not working, and I cannot see the problem.

Here's the code:

private boolean b = true;
[...]
b = true;
Application.DISPLAY.syncExec(new Runnable()
{
	public void run()
	{
		BusyIndicator.showWhile(Application.DISPLAY, new Runnable()
		{
			public void run()
			{
				while(b)
					try{Thread.sleep(0);}catch(...){}
			}
		}
	}
});

try{Thread.sleep(10000);}catch(...){}
b = false;
[...]

thanks a lot
Stefan