view = (IConsoleView) consoleParts.get(0);
} else {
//more than 1 view available
for (int i = 0; i < consoleParts.size(); i++) {
IConsoleView temp = (IConsoleView) consoleParts.get(i);
IConsole console = temp.getConsole();
if (console instanceof PydevConsole) {
PydevConsole tempConsole = (PydevConsole) console;
ScriptConsoleViewer viewer = tempConsole.getViewer();
long tempLastChangeMillis = viewer.getLastChangeMillis();
if (tempLastChangeMillis > lastChangeMillis) {
lastChangeMillis = tempLastChangeMillis;
view = temp;
}
}
}
}
if (view != null) {
IConsole console = view.getConsole();
if (console instanceof ScriptConsole && console.getType().equals(consoleType)) {
return (ScriptConsole) console;
}
}
}
}