Category: Programming


Eclipse plugin : Console window

May 5th, 2010 — 2:25am

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");
          }
}

Comment » | Featured, Programming

Eclipse : Configure PHP (PDT), How to ? Part : 2

January 8th, 2010 — 11:59pm

[3] Installing the perspective is the step where you actually ask eclipse to install the perspectives for you. In step 2 we had just listed the urls/locations where our package would be found. To install the new perspective, get to help > Install new software.

[4] Select the url to download the software from and the package you want to install. You can notice that in the picture below, the site to “work with” is selected as “PDT” from the drop down menu. Also the packages to be installed is selected by selecting “PDT 2.0 xx xx”. Once you have finished this, select to proceed “Next”.

[5] Review the list of packages being installed . This step is followed by “Finish” that will launch your instalation into an autopilot mode until restarting the the Eclipse IDE.

6 – Eclipse installs the packages you requested

[7] Select the perspective to work with once eclipse restarts after installation. To select a particular perspective in eclipse, say php or c,c++ you will have to get to Windows > Open perspective > other.

[8] Select the perspective you want to open form the list.

When it comes to PHP development the development becomes much easier if we are able to work on the files directly on the server. Unless you are more comfortable with a vi or emacs setup working so is difficult. Eclipse can offer you a facility to work with remote systems so that eclipse takes care of the FTP/SSH to the server while you can work on the file on eclipse as if it were a local copy. We would explore this option in future tutorials.

Comment » | Programming

Eclipse : Configure PHP (PDT), How to ? Part : 1

January 8th, 2010 — 11:25pm

Eclipse is a great development environment that will help you develop projects in almost all the most common languages that you might want to use. Eclipse can be configured to be used for Java, C, C++, Python, Ruby, HTML and PHP developments. There are potentially more possible developments but the above is just a list of few of them.

It is important to understand that eclipse is not a compiler that can compile these languages for you and offer the corresponding executable or alike. But eclipse is just a development environment that will use the compilers/linkers/servers that you have already installed on your computer. In other words, you can develop the C code in eclipse, but eclipse will in turn call the C compiler that has been installed in your computer. The same hold for other languages too, e.g Python development on eclipse will need you to install the python engine on your computer. Eclipse will interpret your python code using the python interpreter that you might have already installed.

The idea of using development environment for different languages needs eclipse to be configured to handle these different languages. Each configuration is called “perspective” in the eclipse terminology. Hence you need to configure the “php perspective” to work with eclipse for php development and when you want to write your “C/C++” code you need to switch the perspective to a “C/C++” perspective.

Tutorial: Install PDT in eclipse:

Follow the steps below and continue along to part : 2 of this tutorial and get your Eclipse installation all setup for PHP files.

[1] To configure the installation URL you must first get into windows > Preferences where you can select the urls where the repositories are located. This tutorial hold good for installation of any new development toolkit to eclipse. What would vary with each installation is the package that you might select to install.

[2] Add the following two urls by clicking add and filling in the details for name and location. (This is specific to installing PHP Development Toolkit for eclipse)

Comment » | Programming

Database design tutorial : UML, SQL & Normalization

January 7th, 2010 — 10:15pm

Numerous websites online offer tutorials on database designing. Some specifically detail php+Mysql usage. While there are numerous aspects of a database driven website, the two most important aspects are design and implementation. While most websites teach you how to write effective sql queries, not many teach you the art of design.

Tom Jewett form Department of Computer Engineering and Computer California State University, Long Beach has a gem of a website to offer regarding database design.

It it one of the best references available if you are looking to learn agian the fundamentals of database design or just refresh your sql skills.

Database design tutorial

Site: http://www.tomjewett.com/

DB Design, UML,SQL, 3rd Edition.

Comment » | Programming

Back to top