martedì 10 giugno 2008

Install Eclipse Ganymede RC2 (with CDT 5.0)

I'm waiting for this version of Eclipse from long time, when I read the CDT 5.0 plan. I think that with this version we have the best open source C++ IDE (but may be I don't try all IDEs of the world).
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
cd /opt/
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:
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse-ganymede-rc2"

$ECLIPSE_HOME/eclipse $*

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):
[Desktop Entry]
Name=Eclipse Ganymede RC2
Comment=Eclipse IDE

Save and close gedit.

Using Eclipse

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:

Spell check

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).

5 commenti:

  1. Actually there is an icon in the eclipse package. You can make your eclipse.desktop this way:

    [Desktop Entry]
    Name=Eclipse Ganymede RC2
    Comment=Eclipse IDE

  2. Absolutely with you it agree. It is good idea. It is ready to support you. achat levitra Bravo, this magnificent phrase is necessary just by the way

  3. Davidson garment is a quintessential Harley abercrombie Outlet davidson item, especially if you feature ones Harley decked abercrombie and fitch over. Featuring the whole distinctive line of leather abercrombie sale jackets, t-shirts, buckles, hats, belts, boots abercrombie & fitch and helmets, feeling of guilt reason this is abercrombie not to accessorize to max.A decent buy Harley enthusiast will abercrombie uk go in closet and grab a Harley t-shirt, leather jacket and boots. But, abercrombie london does your closet contain present accessory considering all abercrombie and Fitch Polo of? The Harley helmet. With out them your road abercrombie Polos trip could end in disaster.

  4. Doing the same thing for thomas sabo diamonds is going to cost you thomas sabo sale an arm and a leg as the colored diamonds thomas sabo jewellery are hard to come by. thomas sabo charms The deposit and jewelry boxes you have, thomas sabo online as well as desk and cabinets, vehicle doors and windows, sabo jewellery home and store front doors can all get ruined. thomas sabo charms sale Using a skilled locksmith you'll cheap thomas sabo charms be able to have the assurance that you get the best work that will be done right and guaranteed.All to often, discount thomas sabo charms instead of finding an automotive locksmith, thomas sabo charms clearance Washington DC residents try to take matters in to their own hands.

  5. Diese süße und fröhliche Kollektion thomas sabo charm umfasst Bands in den Formen der Diademe und Kronen mit thomas sabo anhänger Steinen, Burgen, Zauberstäbe, thomas sabo charms reduziert Glas Pantoffeln und Prinzessinnen selbst! thomas sabo charms günstig Und sie kommen in einer Vielzahl von noblen thomas sabo anhänger günstig und girly Farben: rosa, weiß, lila, thomas sabo anhänger billig blau und gold. Alle Mädchen wollen in einigen thomas sabo 2010 zu investieren und dann kann es losgehen dass Handelssystem und thomas sabo reduziert Sie erhalten alle Prinzessinnen euch sein! Und für Sie gibt es die thomas sabo shop Jungs Silly Bandz-Sea Creatures-Bereich.