1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

shell output notification issues

This commit is contained in:
David McKnight 2007-01-25 18:25:13 +00:00
parent 1f537cc4d1
commit c6f4dcc067
5 changed files with 49 additions and 8 deletions

View file

@ -75,8 +75,15 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple
try
{
waitForResponse();
return internalReadLine();
if (_hostShell.isActive())
{
waitForResponse();
return internalReadLine();
}
else
{
return null;
}
}
catch (Exception e)
{
@ -122,8 +129,7 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple
}
/**
* Causes the current thread to wait until this class request has been
* fulfilled.
* Causes the current thread to wait until notified
*/
public synchronized void waitForResponse()
{
@ -138,7 +144,7 @@ public class DStoreShellOutputReader extends AbstractHostShellOutputReader imple
}
/**
* Causes all threads waiting for this class request to be filled
* Causes all threads waiting for this
* to wake up.
*/
public synchronized void notifyResponse()

View file

@ -62,6 +62,13 @@ public class DStoreHostShell extends AbstractHostShell implements IHostShell
{
return _stderrHandler;
}
public DataElement getStatus()
{
return _status;
}
public void exit()
{

View file

@ -77,6 +77,7 @@ public abstract class AbstractHostShellOutputReader extends Thread implements I
else
{
finish();
_keepRunning = false;
}
}
@ -158,7 +159,6 @@ public abstract class AbstractHostShellOutputReader extends Thread implements I
{
_waitIncrement = 0;
_keepRunning = false;
//dispose();
}
}

View file

@ -130,5 +130,19 @@ public class DStoreServiceCommandShell extends ServiceCommandShell
}
*/
}
public boolean isActive()
{
boolean activeShell = _hostShell.isActive();
if (!activeShell)
{
DataElement status = ((DStoreHostShell)_hostShell).getStatus();
if (_output.size() < status.getNestedSize())
{
return true;
}
}
return activeShell;
}
}

View file

@ -527,14 +527,28 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
}
if (shell == null)
{
shell = SystemBasePlugin.getActiveWorkbenchShell();
try
{
shell = SystemBasePlugin.getActiveWorkbenchShell();
}
catch (Exception e)
{
shell = new Shell();
}
}
if (supportsPassword() || supportsUserId())
{
if (shell == null)
{
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
try
{
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
}
catch (Exception e)
{
shell = new Shell();
}
}
if (shell != null) {
boolean passwordNeeded = supportsPassword() && _passwordInfo.getPassword() == null;