Eclipse plugin : Console window
Plugins are one of the most beautiful things that had happened to software development and applications. Firefox plugins are easy first step for everyone to try out. There are numerous tutorials online that will get you started with firefox development. Another application that lets you customize your application using plugins is Eclipse. It is built on the concept of extensibility. Like every other article on the internet this article will get you started with getting your first eclipse plugin up and running. It is good to have some idea of a programming language like C++ or Java to get into eclipse pluign development. I mentioned C++ just for the understanding of object oriented programming but the actual coding is going to be restricted to Java.
In many occasions you might want to create a new console window to dump the results from your eclipse plugin. To create a new console window or use the one that already exists, you can use the following code below.
class EclipseConsoleWindow{
private MessageConsole findConsole(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;
}
public static void main(Strings[] args){
MessageConsole myConsole = findConsole("YourAppNamee");
MessageConsoleStream YourAppName = myConsole.newMessageStream();
YourAppName.println("Print some text into the console");
}
}

