}
// take indicated actions
if (createDialog)
{
ConsoleProgressDialog dlg = new ConsoleProgressDialog(
proc.getCaption(),
cproc,
proc.getBufferedOutput(),
proc.getExitCode(),
cryptoServer);
if (showDialog)
dlg.showModal();
else
dlg.showOnOutput();
}
}
else
{
cproc.addProcessExitHandler(new ProcessExitEvent.Handler()
{
@Override
public void onProcessExit(ProcessExitEvent event)
{
cproc.reap(new VoidServerRequestCallback());
}
});
}
}
@Override
public void onError(ServerError error)
{
Debug.logError(error);
}
});
}
}
});
eventBus_.addHandler(
ConsoleProcessCreatedEvent.TYPE,
new ConsoleProcessCreatedEvent.Handler()
{
private boolean handleEvent(String targetWindow)
{
// calculate the current window name
String window = StringUtil.notNull(
satellite.getSatelliteName());
// handle it if the target is us
if (window.equals(targetWindow))
return true;
// also handle if we are the main window and the specified
// satellite doesn't exist
if (!satellite.isCurrentWindowSatellite() &&
!satelliteManager.satelliteWindowExists(targetWindow))
return true;
// othewise don't handle
else
return false;
}
@Override
public void onConsoleProcessCreated(
ConsoleProcessCreatedEvent event)
{
if (!handleEvent(event.getTargetWindow()))
return;
ConsoleProcessInfo procInfo = event.getProcessInfo();
ConsoleProcess proc = new ConsoleProcess(server_,
eventBus_,
procInfo);
ConsoleProgressDialog dlg = new ConsoleProgressDialog(
procInfo.getCaption(),
proc,
procInfo.getBufferedOutput(),
procInfo.getExitCode(),
cryptoServer);
if (procInfo.getShowOnOutput())
dlg.showOnOutput();
else
dlg.showModal();
}
});
}