Setting up a working e4 Development Environment (3)

Wow, the guys at Eclipse are really productive these days! e4 and the Platform 4.1 are at RC3 actually and I am sure during next week they’ll do a switch to RC4. But that is not really a problem cause I know all that I am writing now will be still valid for RC4. Part (1)of this series about setting up a working e4 environment covered how to get a basic environment working. Yeah, this post definately is still valid for RC3 and RC4, the only thing you must be afraid of is, that the location of e4 0.11 changes with every release candidate. So for RC3 actually it’s…

<br />
Name: e4 0.11RC3<br />
Location: http://download.eclipse.org/e4/downloads/drops/S-0.11RC3-201105292200/repository<br />

But this will change definitely for the upcoming Release Candidates, if there will be any… let’s wait and see. Okay, now let’s extend our basic environment and install support for Subversion and Git. As you know CVS, Subversion and Git are source code repository tools that help you manage and version your source code. We all also know that CVS is quite old and outdated. Subversion as the successor of CVS is very popular these days. Git as the most modern SCM tool is gaining more and more fans actually cause of its new and innovative concepts. Click here, here or hereto get deeper information about all these SCMs.

CVS

In order to use CVS you don’t need to install further extensions or plugins into your Eclipse 4.1, everything you need is on board. Let’s try it out by getting Kai Tödters e4-based Contacts-Demo. Right click in the package explorer and select IMPORT… from the upcoming popup menu. You’ll see an initial Import-Dialog where you can select from differenct sources, one choice you should see is CVS. Please select CVS | Projects from CVS and press the NEXTbutton.

Subversion (SVN)

Getting SVN to work is quite simple. All additonal plugins you need, are in the Indigo Repository. Start off by clicking Help | Install new software… and select the Indigo Repository: Go to the Collaboration section and select all entries starting by „Subversive“: Finish the installation as usual. After restarting Eclipse you’ll automatically get a screen to select a SVN Connector. Depending on your SVN Version please select the version you need. As we have installed SVN 1.6 on our servers I usually select „SVN Kit 1.3.5.“ here. After installing the connector and restarting once again, you can use Subversion. Test it by right clicking into the package explorer and hit IMPORT… besides CVS you now must see SVN also! Congratulations, you are done!

Git

ggbfh

Setting up a working e4 Development Environment (2)

Time is moving so fast! In the meantime e4 evolved from M7, RC1 to RC2-Release these days… The description how to install a basic working environment that I have written some days ago is still valid for RC2 except for the fact that the e4 0.11 Repository changed. Eat this…

Name: e4 0.11RC2
Location: http://download.eclipse.org/e4/downloads/drops/S-0.11RC2-201105241000/repository

They e4 Team fixed lots of bugs, for example the problem with the secure_storage file is gone now. Using the Indigo Repositories for installing additional plugins into e4 SDK (for example SVN, Git, …) also works like a charm now! Try it out, it’s definately worth a try!

Setting up a working e4 Development Environment (1)

e4 SDK 4.1M7 is out and starting with this series I will try to show you how to setup a Development-Environment with wich you can start working in and with e4. I will also explain how to setup important tools like Window Builder, EGit/JGit- and Subversion-Integration. Finally I will end up showing you how to get Kai Tödters Contacs-Demo and my Geo-Application working within Eclipse 4.1 SDK M7.

So let’s start the fun.

First of all you need to download the latest Eclipse 4.1 SDK M7 from here. You could also install e4 0.11M7 on top of an Eclipse 3.7 but I recommend you to do it directly in Eclipse 4.1  just to get started and a basic understanding of the next generation of the Eclipse IDE itself.

Unzip the downloaded file somewhere to your harddisk. I use Ubuntu 11.04 with a JDK 1.6.0_24 installed. On Linux-Sytems I usually install my software into my home directory, so for Eclipse 4.1 SDK M7 i create a directory „e4-m7“ in my home, move the original Zip-File there and unzip it. In the same directory I also create my workspace-folder. Doing it this way you can handle separate installations of Milestone Builds the same time, just a best practice that i figured out while working with all the different Milestone Builds in the past. After Copying and Unzipping, my Eclipse-Installation-Folder looks like this:

Next step is to start Eclipse, in order to do that just go into the folder $HOME/e4-m7/eclipse and doubleclick the eclipse executeable. Eclipse will start up asking you the workspace which you want to use. We use the workspace folder we have create within the e4-m7 folder so we select:

So far nothing special. Some seconds or minutes or hours later Eclipse 4.1 M7 will finally show up. If you get an error message or a small empty box and Eclipse doesn’t come up, it can be that there is a secure_storage file on you computer created by another Eclipse-Installation. This definitely can cause problems. In such a case just delete this file, which is normally located in the folder $HOME/.eclipse/org.eclipse.equinox.security/secure_storage. In a Unix-Terminal just do a rm to delete the file. On Windows please use Explorer to navigate to the file an delete it. After deleting the secure_storage file Eclipse 4.1M7 will start BUT you will loose all informations you entered in previous Eclipse-Installations that have to do with networking, especially the proxy settings. So you have to reenter them, which will of course result in another secure_storage file. On my Ubuntu-Box Eclipse looks quite pretty:


In order to be more productive in our e4 development, the e4 team provides us with further tools which are not part of the Eclipse 4.1 SDK Build. Included in the e4 tools you will find very helpful things like wizards, a graphical Workbench Model Editor and of course the e4 Sourcecode, which in fact is very interesting to learn e4 and to see what is under the hoods. Yeah, we need all this, so let’s go and install that stuff.
Move your mouse pointer to HELP | INSTALL NEW SOFTWARE… and in the upcoming dialog just press the ADD… button to add a new software repository to Eclipse from which we can install additional software. Please enter:

Name: e4 0.11M7
Location: http://download.eclipse.org/e4/downloads/drops/S-0.11M7-201105010200/repository

What are we doing here? We point Eclipse to the Software Repository with all the needed tools. The location/repository is different for every Milestone Build. On the Eclipse Website you’ll find this link on the download site of the e4 0.11M7 Build if you scroll down the page to the bottom. Here you’ll see a link „online repo site“… Some things are hard to find on the Eclipse Website, i know…

After adding this new repository, Eclipse will list you the available software, please select like this:

E4 Resources brings us the sourcecode, e4 Tools includes the wizards and the Workbench Model Editor and e4 XWT provides us with an optional package named „XWT“ which is in the e4 incubator at the moment. With XWT you are able to define your UIs in XML and connect it to the code via XAML-Technology. Really hot stuff and definitely worth to try it out! But back to e4…

After installing please do NOT restart Eclipse. We need further software so why not first installing everything we need and doing the restart at the end?

In professional RCP projects where you create a lot of UI it doesn’t make any sense to create the UI with pure coding. To be really productive we need a graphical tool to create the UI visually like we can do it with Netbeans or Visual Studio. The good news is: With Window Builder Pro (formerly a expensive tool from a company called „Instantiation“, then this company was acquired by Google because of the included Designer for GWT. Google brought Window Builder to the Eclipse Foundation) we have one of the best visual designers around – for free! Let’s install this into our Eclipse 4.1M7.

Again please move you mouse pointer to HELP | INSTALL NEW SOFTWARE… and add the following repository:

Name: Window Builder
Location: http://download.eclipse.org/windowbuilder/WB/integration/3.7

Arrived here please install the following:

At this point you have a fully functional and working development environment for e4. That’s why we are at the end of the first part of this series now. In my next post I will show how to create a first project and play around with Window Builder, after this we move our concentration to EGit/JGit and Subversion…

Have fun!

LifeCycleHandler to hook into the startup process of an e4-app

In the past on RCP 3.x we hooked into the Application*-Classes to popup things like login screens just before the main application came up. With e4 we dont have the Application-Classes anymore, instead there is a standard E4Application-Class wich is responsible to create the Workbench Model and startup the GUI. Using LifeCycleHandlers you we are able to hook into the startup process of an e4 application. You can register a handler from within your plugin.xml by adding a new property named „lifeCycleURI“ like this:

<pre><?xml version="1.0" encoding="UTF-8"?>
<plugin>

<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
name="de.hama.ui"
application="org.eclipse.e4.ui.workbench.swt.E4Application">
<property
name="appName"
value="de.hama.ui">
</property>
<property
name="applicationXMI"
value="de.hama.ui/Application.e4xmi">
</property>
<property
name="applicationCSS"
value="platform:/plugin/de.hama.ui/css/default.css">
</property>
<property
name="lifeCycleURI"
value="platform:/plugin/de.hama.ui/de.hama.ui.handlers.StartupLifeCycleHandler">
</property>
</product>
</extension>

</plugin>

So now we have the definition of a LifeCycleHandler and during runtime the class E4Application will look into the plugin „de.hama.ui“ to find a classed named „StartupLifeCycleHandler“ in the package „de.hama.ui.handlers“. Easy stuff so far. Like every handler in e4 a LifeCycleHandler is just a POJO, the difference now is that we do not use the @Execute or @CanExecute-Annotations to define wich method inside the handler has to be executed instead there is a new Eclipse-specific Annotation @PostContextCreate wich we can use to mark the method to be executed.After this method is executed, the e4 main app will show up.

Here is an example of a LifeCycleHandler to open a Login-Dialog right before the startup of the main application:

public class StartupLifeCycleHandler {

@Inject
LoginDaoJdbc loginDao;

@PostContextCreate
public void startup(IEclipseContext context) {

int i = loginDialog.open();
if (i == Window.CANCEL)
System.exit(0);

context.set("lfsDS", loginDao.getInitialDataSource());
context.set("login", loginDialog.getLogin());

}

Hope that helps…. have fun!

Mein Sohn lernt Python – Lektion 1: Variablen

Wie der Papa, so der Sohne: Er fängt an, sich für das Programmieren zu interessieren. Das macht mich stolz, da bin ich dabei, das unterstütze ich. Also haben wir uns vor garnicht all zu langer Zeit in Nürnberg das Buch „Programmieren für Kids“ gekauft und heute angefangen das Buch durchzuarbeiten. Als Programmiersprache haben wir uns – oder besser ich mich – hier für Python entschieden. Wobei die Programmiersprache ja eigentlich egal ist, mir geht es in erster Linie darum, Interesse zu wecken und Begeisterung zu schaffen.Wie ich das heute nachhaltig geschafft habe, davon will ich nun berichten. Mein Sohn, Tom ist sein Name, kam also zu mir ins Büro und sagte „Papa, wollten wir nicht zusammen programmieren?“. Schon saß er neben mir, hat sein Netbook aufgeklappt und los gings. Hier ein Bild, dass im Rahmen dieses ersten kurzen Pair Programming entstanden ist:

Okay, ich habe mir vorgenommen, Tom ganz langsam an das Thema heranzuführen. Variablen sollten das heutige Thema sein. Ich habe ihn also folgende  beiden Zeilen schreiben lassen:

x = raw_input("Wie ist Dein Name?")
print x

Das wars eigentlich auch schon, aber diese Zeilen taten auch schon ihre Wirkung, denn hiermit konnte ich ihm das Prinzip der Variablen näher bringen. Hierzu habe ich eine kleine Kiste genommen und X draufgeschrieben. In die Kiste habe ich ein Tempotaschenbuch gelegt, auf die ich „tom“ geschrieben habe (das ist die Eingabe, die mein Sohn beim Starten dieses Programms gemacht hat). Hier nochmal ein Bild zur Verdeutlichung:

Die Kiste habe ich wieder in das Regal gestellt und meinem Sohn gesagt, das Regal wäre sein Netbook, der Hauptspeicher. Dieser Speicher besteht aus vielen kleinen Kistchen, sogenannte Speicherzellen, die man mit Daten befüllen kann. Damit man die Daten auch wieder findet, bekommt jede Kiste einen Namen (x). Über diesen Namen kann man dann den Speicher wieder auslesen und bekommt den Inhalt in der Speicherzelle, nämlich das Tempotaschentuch mit dem Namen tom.

Das war dann der Punkt, an dem Tom alles verstanden hatte. Der Aha-Effekt eben. Beim nächsten Mal will ich mit Schleifen weitermachen. Mal schauen, wie ich ihm das bildlich erkläre, ich werde in diesem Blog wieder davon berichten.

Coole Power-Tools für Mac und Linux

Schön längere Zeit arbeite ich ausschließlich unter Mac OS X und Linux. Windows betreibe ich nur noch als virtuelle Maschine. Auf unixoiden Betriebssystemen ist gerade für Power-User wie für uns Entwickler die Konsole ein unverzichtbares Werkzeug. Was ich aber lästig finde, ist jedesmal die Terminal-Applikation mit der Maus anklicken zu müssen um sie zu starten oder zu aktivieren. Was ich mir gewünscht habe, war ein Tool, dass auf Tastendruck (am besten in einer hübschen Animation) eine Konsole „aufklappt“ in der ich arbeiten kann. Nochmaligen Drücken dieser Tastenkombination soll das Terminal dann nach Gebrauch wieder zu machen.  So ein Tool habe ich gefunden, für Mac heisst es Visor und unter Linux macht Tilda einen guten Eindruck.Beide Apps lassen sich wunderbar konfigurieren, so richtig schön mit Anmation und Transparenz.

Visor für Mac:

Mit TotalFinder habe ich auch noch eine sehr nützliche Erweiterung für den Finder (unter Mac OS X) gefunden. Damit wird der Finder um Tabs erweitert (sehr nützlich), kann ebenfalls mit Tastenkombination gestartet werden (noch nützlicher) und es kann in den Einstellungen recht einfach festgelegt werden, dass .DS_Store-Dateien nicht mehr in Netzlaufwerke geschrieben werden soll (ganz angenehm für Kollegen ohne Mac, die das gleiche Netzlaufwerk benutzen). Hier ein Screenshot:

Die letzten Neuigkeiten…

…in aller Kürze (denn da liegt die Würze):

– auf jaxenter.de erschien vor kurzen mein letzter Online-Artikel Swing mit Substanz, dieser Artikel wird auch in der kommenden Ausgabe von „Der Entwickler“ enthalten sein.

– Für das aktuelle Eclipse Magazin 06/09 habe ich den kompletten Schwerpunkt (Jetty Webcontainer) inklusive Interview geschrieben.

– Ich habe jetzt mit den Arbeiten am neuen Axis2-Buch (wieder zusammen im altbewährten Team mit Thilo und Dapeng) begonnen.

– In der übernächsten Ausgabe von „Der Entwickler“ bin ich mit einem Eclipse-Thema vertreten.

– In den nächsten Ausgaben des Eclipse Magazins wird e4, die nächste Eclipse-Version, einen festen Platz bekommen. Auch hier werde ich ein paar geistliche Ergüsse beisteuern.

– Auf jaxenter.de starten wir demnächst eine neue, experiementielle Serie mit dem Titel „Not freaky, just geeky“. Verrücktes, aber interessantes Konzept glaube ich mir da ausgedacht zu haben. Mehr wird noch nicht verraten. Lasst Euch überraschen!

– Ich programmiere einen Sidplayer für Android, endlich gute alte C64-Musik am Handy hören…

Dyslexic Devil Worshipper?

„Do you know what a Dyslexic Devil Worshipper is?“ – Das waren meine Schlussworte, weise Worte vielleicht, doch heute weiss ich nicht mehr was ich damals, als 19 Jähriger C64-Freak damit ausdrücken wollte. Wie dem auch sei, in der damaligen C64-Szene gabs es Magazine auf Diskette, sogenannte Diskmags, die unter den Scenern verteilt wurden. Und für eines dieser Magazine, es nannte sich SKYHIGH, wurde ich damals interviewed – schließlich hatte ich es auf Platz 19 der (welt-)besten C64-Grafiker gebracht… und das schien für die Verantwortlichen des Magazins wohl ein Grund gewesen zu sein, mich zu interviewen.

Wie dem auch sei, es war ein Genuss, die alten Zeilen wieder zu lesen… hier geht’s zum Interview

Axis2-Buch wird neu aufgelegt!

Nach zwei Jahren, vielen positiven Rückmeldungen und Fragen nach einener neuen Auflage haben wir Autoren uns nun tatsächlich dazu entschlossen, unserem Axis2-Buch eine neue Auflage zu spendieren! Vermutlich gegen Ende des Jahres wird es also ein vollständig aktualisiertes Axis2-Buch geben, in dem nicht nur die aktuellste Axis2-Version berücksichtigt sein wird, sondern dass wir auch mit neuen Inhalten anreichern wie zum Beispiel JAX-WS, der Integration mit diversen dynamischen Sprachen, ein vollständig überarbeitetes REST-Kapitel, OSGI-Integration, einen Einblick in die WS*-Erweiterungen und eine Abgrenzung zu anderen Web Service Frameworks wie Metro, CXF …

Man darf also gespannt sein !

Bis zur Veröffentlichung wird es von unserem Team darüberhinaus Artikel zu Axis2 in bekannten Magazinen wie Javamagazin, Eclipse Magazin oder auf jaxenter.de geben ! Ausserdem wird Thilo in diesem Jahr auf der W-JAX in München vertreten sein und einen netten Workshop halten…

Mein MacBook Pro ist da!

Jetzt kanns los gehen. Der Totalumstieg auf Mac OS X steht an! Nachdem ich im letzten Jahr meine ersten Gehversuche mit Mac OS X und einem iMac privat gemacht habe und ich mittlerweile absolut überzeugt wurde, ist nun der Moment gekommen, dass ich komplett auf Mac OS X umsteige. Heute kam mein nagelneues Firmen-Notebook an: ein MacBook Pro mit 2,93 GHZ Prozesser und 4 GB RAM. Das sollte erstmal reichen. Adieu Windows, naja zumindest in virtualisierter Form wird es mir ja noch erhalten bleiben…