return;
}
delayedEvents.add(event);
final IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
if (listener == null) {
listener = new IConsoleListener() {
@Override
public void consolesRemoved(IConsole[] consoles) {
synchronized (sync) {
for (IConsole console : consoles) {
if (console.equals(slingConsole)) {
slingConsole = null;
}
}
}
}
@Override
public void consolesAdded(IConsole[] consoles) {
synchronized (sync) {
for (IConsole console : consoles) {
if (console.getType().equals(SlingConsoleFactory.CONSOLE_TYPE_SLING)) {
slingConsole = (MessageConsole) console;
synchronized (delayedEvents) {
for (Iterator<Event> it = delayedEvents.iterator(); it.hasNext();) {
logEvent(it.next(), slingConsole);
it.remove();
}
}
consoleManager.removeConsoleListener(listener);
listener = null;
break;
}
}
}
}
};
consoleManager.addConsoleListener(listener);
}
}
}