Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipse-dev] How can i stream the outputstream data on conso le view?

Roopa,
HTH
 
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
consoleView=(IConsoleView)page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
console = getConsole("MyConsole");
stream = console.newMessageStream();    
consoleView.display(console);
stream.println((String)message);
 
private MessageConsole getConsole(String name) {
        ConsolePlugin plugin = ConsolePlugin.getDefault();
        IConsoleManager conMan = plugin.getConsoleManager();
        IConsole[] existing = conMan.getConsoles();
        for (int i = 0; i < existing.length; i++)
           if (name.equals(existing[i].getName()))
              return (MessageConsole) existing[i];
        //no console found, so create a new one
        MessageConsole myConsole = new MessageConsole(name, null);
        conMan.addConsoles(new IConsole[]{myConsole});
        return myConsole;
  }
 
-Raghu
-----Original Message-----
From: Roopa Mahishi [mailto:roopa.mahishi@xxxxxxxxxxx]
Sent: Monday, April 18, 2005 5:45 PM
To: eclipse-dev@xxxxxxxxxxx
Subject: [eclipse-dev] How can i stream the outputstream data on console view?


Hi,
I have created a plugin which calls a exec function.
I want to put the outputstream data on the console view.
I get the console view as :IConsole console = Myplugin.getDefault().getConsole();
How do i do send the outputstream data to the console view?

Roopa




Back to the top