//After the command completes, refresh and put message for user.
final IProcess[] processes = launch.getProcesses();
ProcessConsoleManager consoleManager = DebugUIPlugin.getDefault().getProcessConsoleManager();
if (processes.length >= 1) {
IConsole console = consoleManager.getConsole(processes[0]);
final IOConsoleOutputStream outputStream = ((IOConsole) console).newOutputStream();
Job j = new Job("Refresh on finish") {
protected IStatus run(IProgressMonitor monitor) {
boolean allTerminated = false;
while (!allTerminated) {
allTerminated = true;
for (IProcess p : processes) {
if (!p.isTerminated()) {
allTerminated = false;
break;
}
}
synchronized (this) {
try {
this.wait(50);
} catch (InterruptedException e) {
}
}
}
try {
outputStream.write(com.aptana.shared_core.string.StringUtils.format("Finished \""
+ finalManageDotPy.getLocation().toOSString() + " " + command + "\" execution."));
} catch (IOException e1) {
Log.log(e1);
}
try {
outputStream.close();
} catch (IOException e1) {
Log.log(e1);
}
try {
selectedProject.refreshLocal(IResource.DEPTH_INFINITE, null);