If you read my blog you are already using Eclipse (installed as I told on this post). Since we don't want to wait until the end of june we will install the RC2 version but mantaining the old stable version, in this way we can test the RC2 and use both.
Go to the Eclipse Ganymede RC2 download page and select Eclipse IDE for C/C++ Developers for download Eclipse with CDT plugin.
It's hard but we need to wait until the download is complete.
Ok, now we can install Eclipse on the /opt directory. We will install Eclipse RC2 on the /opt/eclipse-ganymede-rc2 directory, we already have /opt/eclipse.
Now open a Terminal.
tar xzf eclipse-cpp-ganymede-RC2-linux-gtk.tar.gz
sudo mv eclipse /opt/eclipse-ganymede-rc2
sudo chown -R root:root eclipse-ganymede-rc2/
sudo chmod -R +r eclipse-ganymede-rc2/
sudo chmod +x `sudo find eclipse-ganymede-rc2 -type d`
Now we can create the lunch script on /usr/bin using gedit:
sudo touch /usr/bin/eclipse-ganymede-rc2
sudo chmod 755 /usr/bin/eclipse-ganymede-rc2
sudo gedit /usr/bin/eclipse-ganymede-rc2
and paste this:
Save the file and close gedit.
Now we can create the menu item using gedit:
sudo gedit /usr/share/applications/eclipse-ganymede-rc2.desktop
and paste this (I use the old Eclipse icon on /opt/eclipse since it is not present in the RC2 package):
Name=Eclipse Ganymede RC2
Save and close gedit.
Now if we open the Gnome menu we can see:
We can lunch Eclipse Ganymede RC2 and see Eclipse splash:
and after this we have to select the workspace. I use my default workspace, the same I use for the Eclipse stable version:
The first visible feature is the spell-checking on comments and string constants. I think this is a good idea, especially for me since I don't know english very well but I insist on write comment in eglish. If a word is not in the dictionary the editor underline the word and when we move the mouse pointer on the word a tooltip display suggestions.
The main feature, for me, is the refactoring. On CDT 5.0 we have not only the "Rename" option, further we can: "Extract constant", "Extract function", "Hide method" and the two refactoring I wait: "Generate getters and setters" and "Implement method".
The "Generate getters and setters" write for us the get and set functions for a class attribute. We simply need to right-click on a class attribute and select from the Refactor menu the "Generate getters and setters" option.
A wizard dialog appear and we can choose desired functions:
when we click Next we can see the refactoring preview:
and if we click Finish the changes to the code are applied.
The "Implement method" refactoring is my preferred, I think to this refactor evry time I need to write a function. If we declare a function in the header file using this refactor Eclipse automatically add required code on the implementation file. We can select "Implement method" from the Refactor menu.
On the Refactoring dialog we can see the preview:
if we click Finish the refactoring update the cpp file.
Also the "Extract function" refactoring is a new entry, but rarely we need to perform this refactoring. We can select a piece of code from an existing function and when we select "Extract function" from the Refactor menu.
The Refactoring wizard appear and we can enter the name of the new function to generate. We can see also the list of the new function arguments. This arguments are automatically detected depending on selected code, and it works!
If we click Next we can see the preview.
When we click finish the new function is automatically generated.
The only feature I miss is the autotools integration. I try the CDT plugin for autotools but for me is not complete (or may be I am not be able to use it).