Exemple #1
0
 @Override
 public void stop(BundleContext context) throws Exception {
   plugin = null;
   final IConsoleManager mgr = ConsolePlugin.getDefault().getConsoleManager();
   mgr.removeConsoles(new IConsole[] {console});
   console = null;
   destroyStream(ConsoleStream.DEFAULT);
   destroyStream(ConsoleStream.STDOUT);
   destroyStream(ConsoleStream.STDERR);
   super.stop(context);
 }
 /* (non-Javadoc)
  * @see org.apache.log4j.Appender#close()
  */
 public void close() {
   if (_consoleStream != null) {
     try {
       _consoleStream.flush();
       _consoleStream.close();
       IConsoleManager mgr = ConsolePlugin.getDefault().getConsoleManager();
       mgr.removeConsoles(new IConsole[] {_consoleStream.getConsole()});
     } catch (IOException ioe) {
       _consoleStream.println(Activator.getResourceString("MessageConsoleAppender.ErrorClosing"));
       ioe.printStackTrace(new PrintStream(_consoleStream));
     }
   }
 }
 private static void removeAllConsoles() {
   IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
   consoleManager.removeConsoles(consoleManager.getConsoles());
 }