Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeChecker Console gets focus on write #193

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ private static MessageConsole getConsole() {

public static void consoleWrite(String msg) {
console = getConsole();
showConsole();

MessageConsoleStream out = console.newMessageStream();
out.println(msg);
}
Expand All @@ -37,17 +39,25 @@ public static void setActiveConsole() {
@Override
public void openConsole() {
console = getConsole();
if (console != null) {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existing = manager.getConsoles();
boolean exists = false;
for (int i = 0; i < existing.length; i++) {
if(console == existing[i])
exists = true;
}
if(!exists)
manager.addConsoles(new IConsole[] {console});
manager.showConsoleView(console);
showConsole();
}

/**
* Shows console.
*/
public static void showConsole() {
if (console == null)
return;

IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existing = manager.getConsoles();
boolean exists = false;
for (int i = 0; i < existing.length; i++) {
if (console == existing[i])
exists = true;
}
if (!exists)
manager.addConsoles(new IConsole[] { console });
manager.showConsoleView(console);
}
}