1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-18 13:45:45 +02:00

[207095] Implicit connect needs to run in the same job as caller

This commit is contained in:
David McKnight 2007-10-25 21:03:56 +00:00
parent 56bd71d3f2
commit e925b3380b

View file

@ -476,21 +476,28 @@ public abstract class SubSystem extends RSEModelObject
* will throw a SystemMessageException you can easily display to the user by using a method * will throw a SystemMessageException you can easily display to the user by using a method
* in it. * in it.
*/ */
public void checkIsConnected() throws SystemMessageException public void checkIsConnected(IProgressMonitor monitor) throws SystemMessageException
{ {
if (!isConnected()) if (!isConnected())
{ {
try try
{ {
Display display = Display.getCurrent(); if (monitor != null)
if (display != null)
{ {
connect(false, null); connect(monitor, false);
} }
else else
{ {
// Not on UI-thread Display display = Display.getCurrent();
connect(new NullProgressMonitor(), false); if (display != null)
{
connect(false, null);
}
else
{
// Not on UI-thread
connect(new NullProgressMonitor(), false);
}
} }
} }
catch (Exception e) catch (Exception e)