<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7494726939005914178</id><updated>2024-10-25T01:20:58.029+02:00</updated><title type='text'>Java Dingsda</title><subtitle type='html'>HowTos, HandsOn- und sonstige Tutorials rund um Eclipse RCP Entwicklung und Java.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-7428013986933737481</id><published>2017-08-03T23:13:00.001+02:00</published><updated>2017-08-04T10:50:07.127+02:00</updated><title type='text'>Kettle Pentaho PDI mit SAP Verbindung einrichten</title><content type='html'>Dieser Artikel beschreibt wie die Kettle Penthao PDI eingerichtet werden muss um mit einem SAP System per RFC zu kommunizieren. Weiterhin wird ein kurzer Blick auf die Vorgehensweise von Kettle bei der Informationsbeschaffung der Übergabeparameter und deren Typen gerichtet. Die Einrichtung erfolgt am Beispiel einer Windows 10 64-Bit Version.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; &lt;a href=&quot;https://sourceforge.net/projects/pentaho/files/Data%20Integration/&quot; target=&quot;_blank&quot;&gt;Kettle Pentaho PDI downloaden&lt;/a&gt;&amp;nbsp;und entpacken&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; In den Umgebungsvariablen von Windows sollten die Variablen JAVA_HOME und PENTAHO_JAVA gesetzt sein. Beide müssen auf das Verzeichniss des Java Runtime Enviroments (JRE) zeigen.&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Beispiel:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
JAVA_HOME = c:\Programm Files\Java\jre8&lt;br /&gt;
PENTAHO_JAVA = c:\Programm Files\Java\jre8&lt;br /&gt;
&lt;br /&gt;
Es sollte die Java Installation genutzt werden, die zu dem Betriebssystem passt z.B. 64 Java Version zum 64 Bit Betriebssystem.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; Für die Kommunikation von Kettle mit dem SAP System wird der SAP Java Connector (JCo) benötigt. Dieser kann &lt;a href=&quot;http://service.sap.com/connectors&quot; target=&quot;_blank&quot;&gt;bei SAP&lt;/a&gt; heruntergeladen werden. Voraussetzung ist ein SAP Service Marketplace Zugang, den viele SAP Kunden besitzen. Es sollte auf die rfichtige Betriebssystem Version geachtet werden. Für das o.g. Beispiel wird die Windows 64 Bit Version benötigt. Es sollte immer die version des Betriebssystems gewählt werden, da Kettle sich automatich per Batch Datei auf das richtige System einstellt.&lt;br /&gt;
Der JCo wird in einer ZIP Datei geliefert. Diese muss entpackt werden um vier Dateien daraus zu kopieren. Diese sind:&lt;br /&gt;
&lt;br /&gt;
sapjco3.dll&lt;br /&gt;
sapjco3.jar&lt;br /&gt;
sapjco3.pdb&lt;br /&gt;
sapjcomanifest.mf&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Schritt 4:&lt;/b&gt; Dateien in das lib Verzeichniss kopieren. Die im Schritt 3 heruntergeladenen Dateien müssen in daslib Verzeichniss der Kettle Installation kopiert werden. &lt;br /&gt;
&lt;br /&gt;
Schritt 5: Verbindung einrichten und testen&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Verbindungsaufbau und laden von Funktionsbausteinen&amp;nbsp; &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Wenn Kettle nach einem Funktionsbausein sucht und dessen Parameter anzeigen möchte werden folgende Funktionsbausteine im Hintergurnd aufgerufen:&lt;br /&gt;
&lt;br /&gt;
RFCPING&lt;br /&gt;
RFC_GET_FUNCTION_INTERFACE&lt;br /&gt;
DDIF_FIELDINFO_GET&lt;br /&gt;
RFC_FUNCTION_SEARCH&lt;br /&gt;
RFC_GET_NAMETAB&lt;br /&gt;
&lt;br /&gt;
Falls irgendwas nicht richtig läfut kann das externe Debugging im SAP einschaltet werden um einen externen Breakpoint zu setzen. Anschließen können im Debug Modus Eingabe und Ausgabeparemeter der jeweiligen Funktionsbausteine überprüft werden. Oft ist die Stelle an der die Exception oder der Fehelr auftritt aussagekräftiger als die Fehlermeldung selbst. Ein Beispiel hierfür ist der Fehler TABLE_NOT_ACTIVE, welcher &lt;a href=&quot;http://absni.blogspot.de/2017/06/tablenotactive-uber-rfc.html&quot; target=&quot;_blank&quot;&gt;hier beschrieben wird&lt;/a&gt;.&lt;br /&gt;
Buzzwords: Penthao, Kettle, Spoon, SAP, JCo</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/7428013986933737481/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2017/08/kettle-pentaho-pdi-mit-sap-verbindung.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/7428013986933737481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/7428013986933737481'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2017/08/kettle-pentaho-pdi-mit-sap-verbindung.html' title='Kettle Pentaho PDI mit SAP Verbindung einrichten'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-5973460604414901132</id><published>2013-10-17T23:02:00.000+02:00</published><updated>2013-10-17T23:02:58.443+02:00</updated><title type='text'>Eclipse RCP - Heapspace vergrößern</title><content type='html'>Version: Eclipse 3.7 Helios&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Problembeschreibung: &lt;/b&gt;Heapspace einer Eclipse RCP oder eine normalen Java Anwendung vergrößern. Es soll sowohl der minimale Speicherverbrauch als auch der Maximale geändert/vergößert werden. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Fallunterscheidung:&lt;/b&gt; Applikationsstart aus der Entwicklungsumgebung oder Applikationsstart durch Aufruf einer Executable (&quot;appName.exe&quot;) oder von der Kommandozeile aus. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Entwicklungsumgebung&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Diese Einstellung bewirkt, dass Java Projekte und im speziellen Eclipse RCP Projekte mit gewünschtem minimal und maximal Speicher aus der Entwiclungsumgebung gestartet werden. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Vorgehensweise&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Erzeuge ein Eclipse RCP Projekt oder ein Java Projekt. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Rechtsklick auf das Projekt. Im Kontextmenü &quot;Run As&quot; und anschließend &quot;Run Configurations...&quot; auswählen. Siehe Bild 1.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJZHcGSF_abcA5mXG_XQBn1atUK5U-aa16szHVfPQerES1rxXrV76rFH3AfzAD-HzyW0keUaKuCwTdbUp3sWkdtvRBl9FHKwbShPKRQY-7qVNq4rQySLeZwAae9Zc4FZ7PPbfD2eJRZZs/s1600/bild1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;341&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJZHcGSF_abcA5mXG_XQBn1atUK5U-aa16szHVfPQerES1rxXrV76rFH3AfzAD-HzyW0keUaKuCwTdbUp3sWkdtvRBl9FHKwbShPKRQY-7qVNq4rQySLeZwAae9Zc4FZ7PPbfD2eJRZZs/s400/bild1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Bild 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3. &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Den Reiter &quot;Arguments&quot; wie in Bild 2 für die gewünschte Konfiguration öffenen. Punkt 1 im Bild muss ausgewählt werden für eine Eclipse RCP Applikation, Punkt 2 entsprechend für eine normales Java Projekt. 
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFBjOACj5v5VmzBtw2RlKPuN3aJ-0XWIrJs6ZHLFxjWm2fHiyY4nbKG1JIi52G1IlXV_ix5vlfPzxi3uJ0af6TKF9vElLvtQFv-RDLFNhGq2Qlolx7eIzfu9p2JfMcE_5gYNKbZ2p8Gio/s1600/bild2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFBjOACj5v5VmzBtw2RlKPuN3aJ-0XWIrJs6ZHLFxjWm2fHiyY4nbKG1JIi52G1IlXV_ix5vlfPzxi3uJ0af6TKF9vElLvtQFv-RDLFNhGq2Qlolx7eIzfu9p2JfMcE_5gYNKbZ2p8Gio/s640/bild2.png&quot; width=&quot;532&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Bild 2&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Die Textbox &quot;VM arguments&quot; sollte dan folgende zwei Argumente besitzen &lt;i&gt;-Xms40m&lt;/i&gt; und &lt;i&gt;-Xmx512m&lt;/i&gt;. &lt;i&gt;Xms&lt;/i&gt; gibt dabei den minimalen Heapspeicher an und &lt;i&gt;Xmx&lt;/i&gt; den maximalen. Hier im Beispiel erfolgen die Angaben in Megabyte, da jeweils immer ein &#39;m&#39; angegeben ist. Es sind ebenfalls Angaben in Kilobyte mit &#39;k&#39; und in Gigabyte mit &#39;g&#39; möglich. Ob Gros- oder Kleinbuchstaben bei der Gößenangebe benutzt werden spielt keine Rolle. Es ist deshalb &lt;i&gt;-Xmx512m&lt;/i&gt; gleichwertig mit &lt;i&gt;-Xmx512M&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Applikationssstart über die Kommandozeile &lt;/b&gt;(in Windows cmd.exe) 
&lt;br /&gt;
&lt;br /&gt;
Beim Starten einer Applikation von der Kommandozeile werden die Argumente in den Java interpreter Aufruf übergeben. In Bild 3 sehen wir ein Beispielaufruf der &lt;i&gt;test.jar&lt;/i&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWLcugHxgzNIB1NQNCy15e_9ixmZso6UFFD1SoKaTwOUbpmbYo_OsZvanlErB6l3LXAUnzlUz_KzK3qpmNKjEbrfUS4jZZQVEPOJcqqnFqHnz_k7lBsR4L9wAHu8UoAqZtoxtyZzamGg8/s1600/bild3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWLcugHxgzNIB1NQNCy15e_9ixmZso6UFFD1SoKaTwOUbpmbYo_OsZvanlErB6l3LXAUnzlUz_KzK3qpmNKjEbrfUS4jZZQVEPOJcqqnFqHnz_k7lBsR4L9wAHu8UoAqZtoxtyZzamGg8/s1600/bild3.PNG&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Bild 3&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Applikationssstart durch eine Executable&lt;/b&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird eine Eclipse RCP exportiert und dadurch ohne die Entwicklungsumgebung lauffähig gemacht, dann müssen die beiden Paremeter &lt;i&gt;-Xms&lt;/i&gt; und &lt;i&gt;-Xmx&lt;/i&gt; in der &lt;i&gt;Product Configuration&lt;/i&gt; im Reiter &lt;i&gt;Launching&lt;/i&gt; eingetragen werden. Dies ist in Bild 4 zu sehen. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4qw81NP16VgxCHgYavL4u5rG6wDc3Dg13aGPPaxQg12czyebKN1kbwf3ctziklOhxc-JNAECTDrZEv40aIf7ImhckgepH6J_rhhyyHuhFuS2uRNzYT-TkAZOFyOV-W33leI9ZnYW1wU4/s1600/bild4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4qw81NP16VgxCHgYavL4u5rG6wDc3Dg13aGPPaxQg12czyebKN1kbwf3ctziklOhxc-JNAECTDrZEv40aIf7ImhckgepH6J_rhhyyHuhFuS2uRNzYT-TkAZOFyOV-W33leI9ZnYW1wU4/s640/bild4.PNG&quot; width=&quot;577&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Bild 4&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b&gt;Quellen:&lt;/b&gt;&lt;br /&gt;
http://javarevisited.blogspot.de/2011/11/hotspot-jvm-options-java-examples.html</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/5973460604414901132/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2013/10/eclipse-rcp-heapspace-vergroern.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5973460604414901132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5973460604414901132'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2013/10/eclipse-rcp-heapspace-vergroern.html' title='Eclipse RCP - Heapspace vergrößern'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJZHcGSF_abcA5mXG_XQBn1atUK5U-aa16szHVfPQerES1rxXrV76rFH3AfzAD-HzyW0keUaKuCwTdbUp3sWkdtvRBl9FHKwbShPKRQY-7qVNq4rQySLeZwAae9Zc4FZ7PPbfD2eJRZZs/s72-c/bild1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-2613583680050678068</id><published>2013-09-10T23:00:00.000+02:00</published><updated>2013-09-11T10:53:58.166+02:00</updated><title type='text'>Java - aus currentTimeMillis in formatierten Datum Srting</title><content type='html'>&lt;b&gt;Aufgabe:&lt;/b&gt; &lt;br /&gt;
Erzeuge aus der Milisekundenangabe des Systems &lt;code&gt;(long java.lang.System.currentTimeMillis() )&lt;/code&gt; einen Formatierten Datum String in der Form YYYYMMDD wobei YYYY = Jahr, MM = Monat, DD = Tag. Beispiele 20130213, 19990131, usw. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lösung:&lt;/b&gt; &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;String formatedDate = new SimpleDateFormat(&quot;yyyyMMdd&quot;)
                        .format(new Date(System.currentTimeMillis());&lt;/code&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/2613583680050678068/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2013/09/java-aus-currenttimemillis-in.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/2613583680050678068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/2613583680050678068'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2013/09/java-aus-currenttimemillis-in.html' title='Java - aus currentTimeMillis in formatierten Datum Srting'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-8764205828890451588</id><published>2013-03-21T00:02:00.000+01:00</published><updated>2013-03-21T00:02:37.830+01:00</updated><title type='text'>Eclipse RCP E4 - Erste Anwendung </title><content type='html'>&lt;b&gt;Aufgabe:&lt;/b&gt; Erste RCP E4 Applikation erstellen. Es handels sich hierbei um ein generiertes &lt;i&gt;Eclipse Application Project&lt;/i&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; Im Menü &lt;i&gt;File-&amp;gt;New-&amp;gt;Other...&lt;/i&gt; auswählen. Anschließend wie im Bild zu sehen &lt;i&gt;Eclipse 4 Application Project&lt;/i&gt; auswählen. und Anschließend mit &lt;i&gt;Next&lt;/i&gt; bestätigen&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO463dqEAp7MJbqNy8YRegz4nfJDmnvXxgCVtFDzq2nEsBzAlTAlAcSY1CWvk92jQTmQQgq9WVdNm0GZx3_oWR3E2ZcAWEnj6t7R7XSWQ0S76WlwqLhr1n31tndkR6OYaWZFWQn1XS6yg/s1600/proj_neu_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO463dqEAp7MJbqNy8YRegz4nfJDmnvXxgCVtFDzq2nEsBzAlTAlAcSY1CWvk92jQTmQQgq9WVdNm0GZx3_oWR3E2ZcAWEnj6t7R7XSWQ0S76WlwqLhr1n31tndkR6OYaWZFWQn1XS6yg/s1600/proj_neu_1.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abbildung 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; Projektnamen unter &lt;i&gt;ID&lt;/i&gt; eingeben und mit &lt;i&gt;Next&lt;/i&gt; bestätigen.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZa4ieMir46Ovq0Zmv6mODrN0fSPEEzGBATsK8F9txNeYrKe133uh1YqMA9B-39sxSYHM7kVVT-_YCRfErIl7vS-TrSDaXuPRwWGVFuUX9dEothkQZLTwiZKNm0ChfTLbLaAfv7MeaNRw/s1600/proj_neu_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZa4ieMir46Ovq0Zmv6mODrN0fSPEEzGBATsK8F9txNeYrKe133uh1YqMA9B-39sxSYHM7kVVT-_YCRfErIl7vS-TrSDaXuPRwWGVFuUX9dEothkQZLTwiZKNm0ChfTLbLaAfv7MeaNRw/s1600/proj_neu_2.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abbildung 2&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; Mit &lt;i&gt;Finish&lt;/i&gt; Projekt erzeugen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG4_JBII1ADFWWcQuoT4RH02eMtak4r6xO4zTOkBKtJSM-up3CCiHSX6GzV7M1nwH9GBKaFIWs0QpFvBDx2gGmnXGkspDW4B4f8_UBe33WMFk-zNmMPUdrA-3qHIZJGSnAs8POn-Niupk/s1600/proj_neu_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG4_JBII1ADFWWcQuoT4RH02eMtak4r6xO4zTOkBKtJSM-up3CCiHSX6GzV7M1nwH9GBKaFIWs0QpFvBDx2gGmnXGkspDW4B4f8_UBe33WMFk-zNmMPUdrA-3qHIZJGSnAs8POn-Niupk/s1600/proj_neu_3.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abbildung 3&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 4:&lt;/b&gt; Das Projekt wird gestartet durch einen Klick auf &lt;i&gt;Launch an Eclipse application&lt;/i&gt; (Abblidung 5) in der &lt;i&gt;Product Overview&lt;/i&gt; (Abbildung 4)
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF9vLqu9nn1jvZOobSEl7kKmfV8bpcFY2ejF_sY-pZNB0JVBpfLarh8A9-AnhRoRhP6_2-5MO-HoaiO6lH_Xl3GvaB4GAHPlHMiAlhjX3_VFI345WehgjfD8xlYQ-S5bNHStHF-hF7B0M/s1600/proj_neu_4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF9vLqu9nn1jvZOobSEl7kKmfV8bpcFY2ejF_sY-pZNB0JVBpfLarh8A9-AnhRoRhP6_2-5MO-HoaiO6lH_Xl3GvaB4GAHPlHMiAlhjX3_VFI345WehgjfD8xlYQ-S5bNHStHF-hF7B0M/s1600/proj_neu_4.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abbildung 4&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaxVsf-8k7hwSm-LGSG7-x_cRXZyZbybEZNW84uXy5SjN5fdN_uZJdw_p-HuXffVZGJMIQwbxj66M-dj6WBT80nZt4KTY40fXpGyQTV7c0AalNF_e-UgCRnPMbDnTy7SQZQ-A7fIsU8ww/s1600/proj_neu_5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaxVsf-8k7hwSm-LGSG7-x_cRXZyZbybEZNW84uXy5SjN5fdN_uZJdw_p-HuXffVZGJMIQwbxj66M-dj6WBT80nZt4KTY40fXpGyQTV7c0AalNF_e-UgCRnPMbDnTy7SQZQ-A7fIsU8ww/s1600/proj_neu_5.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abbildung 5&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Fehlerbehebung:&lt;/b&gt;  Sollten beim Ausführen Fehler auftreten (wie in Abbildung 6 und Listing 1 gezeigt), könnte der unten beschriebene Schritt helfen diese zu beheben.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm9wc6QBwePEAIVto4pVuc2tYe6WIhxvanZjS0oyiPjTcPuFjULMW_XLvNNGLzf-zHYNx2BKyPwqOD28E95f6AI_-6YNEbZ3vacP_RD20PRGe4XL4X7LHheZKUpn6QH_16T-SnC_UbaWI/s1600/proj_neu_error1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm9wc6QBwePEAIVto4pVuc2tYe6WIhxvanZjS0oyiPjTcPuFjULMW_XLvNNGLzf-zHYNx2BKyPwqOD28E95f6AI_-6YNEbZ3vacP_RD20PRGe4XL4X7LHheZKUpn6QH_16T-SnC_UbaWI/s1600/proj_neu_error1.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abbildung 6&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Listing 1&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
!SESSION 2013-03-20 22:18:54.415 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_13
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments:  -product com.blogspot.javadingsda.firste4.product
Command-line arguments:  -product com.blogspot.javadingsda.firste4.product -data C:\Users\Steffi\workspace/../runtime-com.blogspot.javadingsda.firste4.product -dev file:C:/Users/Steffi/workspace/.metadata/.plugins/org.eclipse.pde.core/com.blogspot.javadingsda.firste4.product/dev.properties -os win32 -ws win32 -arch x86 -consoleLog

!ENTRY org.eclipse.equinox.app 0 0 2013-03-20 22:18:56.599
!MESSAGE Product com.blogspot.javadingsda.firste4.product could not be found.

!ENTRY org.eclipse.osgi 2 0 2013-03-20 22:18:56.663
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-03-20 22:18:56.663
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.e4.ui.services_0.10.3.v20130123-162658.jar was not resolved.
!SUBENTRY 2 org.eclipse.e4.ui.services 2 0 2013-03-20 22:18:56.663
!MESSAGE Missing imported package org.w3c.dom.css_2.0.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-03-20 22:18:56.663
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.e4.ui.css.swt.theme_0.9.4.v20130123-162658.jar was not resolved.
!SUBENTRY 2 org.eclipse.e4.ui.css.swt.theme 2 0 2013-03-20 22:18:56.663
!MESSAGE Missing imported package org.w3c.dom.css_2.0.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-03-20 22:18:56.663

...

!SUBENTRY 2 com.blogspot.javadingsda.firste4 2 0 2013-03-20 22:18:56.756
!MESSAGE Missing required bundle org.eclipse.e4.ui.css.core_0.10.2.

!ENTRY org.eclipse.osgi 4 0 2013-03-20 22:18:56.756
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: No application id has been found.
 at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
 at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
 at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
 at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
 at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
An error has occurred. See the log file
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Fehlerursache 1:&lt;/b&gt; Unter Product Dependencies fehlen Plugins, die über den Button &lt;i&gt;Add Required Plug-ins&lt;/i&gt; hinzugefügt werden können. &lt;br /&gt;
Das Plugin selbst (im Beispiel ist es com.blogspot.javadingsda.firste4) muss ebenfalls vorhanden sein. &lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/8764205828890451588/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2013/03/eclipse-rcp-e4-erste-anwendung.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8764205828890451588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8764205828890451588'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2013/03/eclipse-rcp-e4-erste-anwendung.html' title='Eclipse RCP E4 - Erste Anwendung '/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO463dqEAp7MJbqNy8YRegz4nfJDmnvXxgCVtFDzq2nEsBzAlTAlAcSY1CWvk92jQTmQQgq9WVdNm0GZx3_oWR3E2ZcAWEnj6t7R7XSWQ0S76WlwqLhr1n31tndkR6OYaWZFWQn1XS6yg/s72-c/proj_neu_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-380884367292575659</id><published>2013-03-16T22:19:00.000+01:00</published><updated>2013-03-16T22:19:01.299+01:00</updated><title type='text'>Eclipse E4 Tutorial - Eclipse vorbereiten</title><content type='html'>&lt;b&gt;Aufgabe:&lt;/b&gt; Das Plugin &lt;i&gt;Eclipse E4 Tools&lt;/i&gt; installieren.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; Install Dialog aufrufen &lt;br /&gt;
&lt;br /&gt;
Im Menü &lt;i&gt;Help -&amp;gt; Install New Software...&lt;/i&gt; ausführen&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; Downloadlocation hinzufüguen &lt;br /&gt;
&lt;br /&gt;
Downloadlocation für Installation von Eclipse E4 Tools hinzufügen: &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;http://download.eclipse.org/e4/downloads/drops/R-0.12-201206131100/repository&lt;/i&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4fWqdu-MWlOX_SZK8KKg_sBRg5bGqNVaCP5NW-4Xb6MPpfsyjhFHwVf1Ab83hsImnmh_PylNxN7shS-udWw20hdecoF35acMnacGyexcKPNoEV5BB-QS2hSOg34nDT5k9xaEqzJOc2hY/s1600/install_tools_1.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4fWqdu-MWlOX_SZK8KKg_sBRg5bGqNVaCP5NW-4Xb6MPpfsyjhFHwVf1Ab83hsImnmh_PylNxN7shS-udWw20hdecoF35acMnacGyexcKPNoEV5BB-QS2hSOg34nDT5k9xaEqzJOc2hY/s1600/install_tools_1.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj491a9D3qJKw1rf1sBKMVG3kJijXNqKWG1st24DmYokA9mySpr2_JqQhF746BPtl4OSTmWDxNHetvs8Dpj9j7EqkTxt6a0FpKNSq1VgLbUvXYKPZ-DxYKlPfBI-I_e1gyxpRhYc9nkA2E/s1600/install_tools_2.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj491a9D3qJKw1rf1sBKMVG3kJijXNqKWG1st24DmYokA9mySpr2_JqQhF746BPtl4OSTmWDxNHetvs8Dpj9j7EqkTxt6a0FpKNSq1VgLbUvXYKPZ-DxYKlPfBI-I_e1gyxpRhYc9nkA2E/s1600/install_tools_2.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; Tools auswählen &lt;br /&gt;
&lt;br /&gt;
Folgendes Tool sollte installiert werden. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpMezun3Gj3C962bj_MLw85qPq7_2VcBOChBUP_ihco2Ck5HwY7Iuy-sWrcnIBSUx0628Bfg014CveAwd9jTiIoQv93k7vSDUP6vbr52Zy8yw_MARqblJ0FVtjwbr-gwl-boZZsCmN00Q/s1600/install_tools_4.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpMezun3Gj3C962bj_MLw85qPq7_2VcBOChBUP_ihco2Ck5HwY7Iuy-sWrcnIBSUx0628Bfg014CveAwd9jTiIoQv93k7vSDUP6vbr52Zy8yw_MARqblJ0FVtjwbr-gwl-boZZsCmN00Q/s1600/install_tools_4.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;E4 Tools -&amp;gt; Eclipse E4 Tools (Incubation)&lt;/b&gt; auswählen und mit &lt;b&gt;Next&lt;/b&gt; bestätigen. 

&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 4:&lt;/b&gt; Lizenzbestimmungen zustimmen und weiter mit &lt;b&gt;Finish&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9tFk8dN2iN6SM4A_H7g7oyyRoJbBazGIX3tnTiut0MJH99fnkvE0XY4joE_wNUHxAGjDRby7Vzy-89QBsYLmmmuXBgkfVaJ03hKbDPLD1go1TTJPwLNKFosqoEgF5q9QZSOBPhsQTUuE/s1600/install_tools_6.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9tFk8dN2iN6SM4A_H7g7oyyRoJbBazGIX3tnTiut0MJH99fnkvE0XY4joE_wNUHxAGjDRby7Vzy-89QBsYLmmmuXBgkfVaJ03hKbDPLD1go1TTJPwLNKFosqoEgF5q9QZSOBPhsQTUuE/s1600/install_tools_6.png&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 5:&lt;/b&gt; Eclipse neustarten &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisTu1Fzl6NTroi6VbtiT7PUyN8Wl4eOCDKrS91Y0h8NesPd9wX3LwGcBfqVvV4lRZR6uDP-1ePytflLQn7LmnIhUZlbsSBGwW7Z5TktDMi-Gj2dP9Eec1IV11YgTLIaAxdhSqvh0xKX50/s1600/install_tools_7.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisTu1Fzl6NTroi6VbtiT7PUyN8Wl4eOCDKrS91Y0h8NesPd9wX3LwGcBfqVvV4lRZR6uDP-1ePytflLQn7LmnIhUZlbsSBGwW7Z5TktDMi-Gj2dP9Eec1IV11YgTLIaAxdhSqvh0xKX50/s1600/install_tools_7.png&quot; /&gt; &lt;/a&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
Der Tipp dieses Tool einzusetzen wird im Eclipse E4 Tutorial von &lt;a href=&quot;http://eclipsesource.com/blogs/2012/05/10/eclipse-4-final-sprint-part-1-the-e4-application-model/&quot;&gt;http://eclipsesource.com&lt;/a&gt; erwähnt.

</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/380884367292575659/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2013/03/eclipse-e4-tutorial-eclipse-vorbereiten.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/380884367292575659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/380884367292575659'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2013/03/eclipse-e4-tutorial-eclipse-vorbereiten.html' title='Eclipse E4 Tutorial - Eclipse vorbereiten'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4fWqdu-MWlOX_SZK8KKg_sBRg5bGqNVaCP5NW-4Xb6MPpfsyjhFHwVf1Ab83hsImnmh_PylNxN7shS-udWw20hdecoF35acMnacGyexcKPNoEV5BB-QS2hSOg34nDT5k9xaEqzJOc2hY/s72-c/install_tools_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-427992680458483194</id><published>2013-01-14T00:01:00.002+01:00</published><updated>2013-01-14T00:01:50.561+01:00</updated><title type='text'>Eclipse RCP - Textboxen zur Schriftgröße unter Windows anpassen</title><content type='html'>&lt;b&gt;Artikelinhalt:&lt;/b&gt;Anpassen von Widgets wie Textboxen (&lt;code&gt;org.eclipse.swt.widgets.Text&lt;/code&gt;) oder Labels (&lt;code&gt;org.eclipse.swt.widgets.Label&lt;/code&gt;) an die Bildschirmauflösung. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Problembeschreibung:&lt;/b&gt; in Windows hat der Benutzer einer Eclipse RCP Anwendung die Möglichkeit die Schriftgröße in Standartapplikationen anzupassen. Unter Windows 7 ist dies in &lt;i&gt;&lt;b&gt;Systemsteuerung\Alle Systemsteuerungselemente\Anzeige&lt;/b&gt;&lt;/i&gt; möglich, indem die Textgröße auf Mittel 125% oder Größer 150% eingestellt wird. Weiterhin kann ein Benutzer auch unter &lt;i&gt;&lt;b&gt;Benutzerdefinierte Textgröße (DPI) festlegen&lt;/b&gt;&lt;/i&gt; die größe beliebig skalieren.
Werden Widgets mit fester Größe erzeugt, so kann es vorkommen, dass ein Text im Label nicht mehr vollständig angezeigt wird. 
&lt;br /&gt;
&lt;br /&gt;
Zu beachten ist, dass hier nicht die Schriftgröße skaliert wird, sonder die Auflösung (Anzahl der Bildpunkte oder oft auch DPI oder PPI genannt). In dieser Erkenntnis liegt auch die Lösung für das Problem. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lösungsansatz:&lt;/b&gt; Mit Hilfe der &lt;code&gt;Toolkit&lt;/code&gt; AWT Klasse ist es möglich die Bildschirmauflösung abzufragen. Unter Windows 7 ist die Textgröße von 100% gleichzusetzen mit 96 DPI. Die Textgröße von 150% entspricht dann 144 DPI. &lt;br /&gt;
&lt;br /&gt;
Mit folgenden zwei Zeilen kann der DPI Wert ermittelt werden. 
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
Toolkit tk = Toolkit.getDefaultToolkit();
System.out.println(&quot;Screen resolution = &quot; + tk.getScreenResolution());
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Beispielanwendung:&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; Erzeuge eine Eclipse RCP Applikation mit den Namen com.blogspot.javadingsda.getweindowdpiaus aus dem Template &lt;i&gt;RCP Application with a view&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; Ändere die Klasse View wie folgt ab: 

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.getweindowdpi;

import java.awt.Toolkit;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

public class View extends ViewPart {
 public static final String ID = 
           &quot;com.blogspot.javadingsda.getweindowdpi.view&quot;;

 public void createPartControl(Composite parent) {
  
  Toolkit tk = Toolkit.getDefaultToolkit();
  int resolution = tk.getScreenResolution();
  double factor = ((double)resolution) / 96;
  
  parent.setLayout(new GridLayout(1, false));
  
  // Text der sich der Auflösung anpasst
  Text textBox = new Text(parent,SWT.BORDER);
  GridData gdTextBox = new GridData();
  gdTextBox.widthHint = (int)(54 * factor);
  textBox.setLayoutData(gdTextBox);
  textBox.setText(&quot;Teststring!&quot;);
  
  // Text der sich nicht anpasst 
  Text textBox2 = new Text(parent,SWT.BORDER);
  GridData gdTextBox2 = new GridData();
  gdTextBox2.widthHint = 54;
  textBox2.setLayoutData(gdTextBox2);
  textBox2.setText(&quot;Teststring!&quot;);
  
 }

 public void setFocus() {
 }
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; Die Schriftgröße wie oben genannt in Windows ändern und Anwendung ausprobieren. Das obere Text Feld sollte sich anpassen, während das untere immer die gleiche Größe behält. </content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/427992680458483194/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2013/01/eclipse-rcp-textboxen-zur-schriftgroe.html#comment-form' title='2 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/427992680458483194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/427992680458483194'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2013/01/eclipse-rcp-textboxen-zur-schriftgroe.html' title='Eclipse RCP - Textboxen zur Schriftgröße unter Windows anpassen'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-3863881441978720531</id><published>2012-12-05T23:58:00.001+01:00</published><updated>2012-12-06T00:01:28.385+01:00</updated><title type='text'>Eclipse RCP / SWT - TreeViewer Sortierreihenfolge Teil 2</title><content type='html'>&lt;i&gt;Eclipse 3.7&lt;/i&gt; &lt;br /&gt;
&lt;br /&gt;
Problem: Knoten im TreeViewer sollen sortiert werden. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lösung:&lt;/b&gt; Der ViewSorter erledigt die Sortierung. In unserem Beispiel werden die Knoten alphabetisch sortiert. &lt;a href=&quot;http://javadingsda.blogspot.de/2012/12/eclipse-rcp-swt-treeviewer.html&quot;&gt;Im ersten Teil dieses Artikels&lt;/a&gt; wurde ein Beispiel vorbereitet. Im diesem Teil soll die Sortierung hinzugefügt werden.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; Erzeuge die Klasse &lt;code&gt;StructureViewerComparator&lt;/code&gt;. 
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;

public class StructureViewerComparator extends ViewerComparator {

  @Override
  public int compare(Viewer viewer, Object e1, Object e2) {
    if ((e1 instanceof MyTreeNode) &amp;amp;&amp;amp; (e2 instanceof MyTreeNode)){
      return e2.toString().compareTo(e1.toString());
    }
    return 0;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; In der &lt;code&gt;View&lt;/code&gt; Klasse, wird in der &lt;code&gt;createPartControl&lt;/code&gt; Methode dem Viewer ein neuer Comparator vom Typ &lt;code&gt;StructureViewerComparator&lt;/code&gt; hinzugefügt. 
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
 
public void createPartControl(Composite parent) {
  viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL
    | SWT.V_SCROLL);
  viewer.setContentProvider(new TreeContentProvider());
  viewer.setInput(new MyTreeNode(0,&quot;&quot;));
  viewer.setComparator(new StructureViewerComparator()); //Comparator hinzugefügt
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; Code ausführen! 



</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/3863881441978720531/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/12/eclipse-rcp-swt-treeviewer_5.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/3863881441978720531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/3863881441978720531'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/12/eclipse-rcp-swt-treeviewer_5.html' title='Eclipse RCP / SWT - TreeViewer Sortierreihenfolge Teil 2'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-8443189847098032124</id><published>2012-12-05T23:57:00.000+01:00</published><updated>2012-12-05T23:59:38.811+01:00</updated><title type='text'>Eclipse RCP / SWT - TreeViewer Sortierreihenfolge Teil 1</title><content type='html'>Eclipse 3.7 &lt;br /&gt;
&lt;br /&gt;
Problem: Knoten im TreeViewer sollen sortiert werden. &lt;br /&gt;
&lt;br /&gt;
Lösung: Der ViewSorter erledigt die Sortierung. In unserem Beispiel werden die Knoten alphabetisch sortiert. Im ersten Teil dieses Artikels wird ein Beispiel vorbereitet. &lt;a href=&quot;http://javadingsda.blogspot.de/2012/12/eclipse-rcp-swt-treeviewer_5.html&quot;&gt;Im zweiten&lt;/a&gt; die Sortierung hinzugefügt.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; Erstelle die &lt;a href=&quot;http://javadingsda.blogspot.de/2011/11/eclipse-rcp-swt-einfaches-treeviewer.html&quot;&gt;einfache TreeViewer Anwendung&lt;/a&gt; aus diesem Blog. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; Im zweiten Schritt wird das Modell der Knoten etwas abgeändert, damit eine Sortierung später nötig wird. Dazu wird der Klasse &lt;code&gt;MyTreeNode&lt;/code&gt; ein Attribut &lt;code&gt;prefix&lt;/code&gt;  hinzugefügt, welches im Konstruktor initialisiert wird. &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
public class MyTreeNode {
 private int depth;
 private MyTreeNode parent = null;
 private ArrayList children;
 private String prefix; // neues Attribut

        //Übergabeparameter an den Konstruktor werden geändert 
 public MyTreeNode(int depth, String prefix) { 
  children = new ArrayList();
  this.prefix = prefix; // Initialisierung
  this.depth = depth;
 }

 ...

 public String toString() {
  StringBuffer sb = new StringBuffer();
  sb.append(prefix + &quot; Knoten mit Tiefe &quot;);
  sb.append(String.valueOf(depth));
  return sb.toString();
 }
        ...
}
&lt;/code&gt;&lt;/pre&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; Im letzten Schritt wird an allen Stellen, an denen der Konstruktor aufgerufen wird der zweite Übergabeparameter mit einem willkürlichem &lt;code&gt;String&lt;/code&gt; gefüllt. Dazu wird in der Klasse &lt;code&gt;TreeContentProvider&lt;/code&gt; die Methode &lt;code&gt;createChildNodes(Object parent)&lt;/code&gt; wie folgt geändert. 

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
public class TreeContentProvider implements ITreeContentProvider {

...         

  public void createChildNodes(Object parent) {
    if (parent instanceof MyTreeNode) {
      MyTreeNode node = (MyTreeNode)parent;
      node.addChild(new MyTreeNode(node.getDepth() + 1, &quot;1&quot;)); // zweiter 
      node.addChild(new MyTreeNode(node.getDepth() + 1, &quot;5&quot;)); // Parameter 
      node.addChild(new MyTreeNode(node.getDepth() + 1, &quot;3&quot;)); // mit beliebigen 
      node.addChild(new MyTreeNode(node.getDepth() + 1, &quot;z&quot;)); // Werten
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
und zuletzt in der &lt;code&gt;View&lt;/code&gt; Klasse die Methode &lt;code&gt;createPartControl&lt;/code&gt; wie folgt geändert: 

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
public void createPartControl(Composite parent) {
  viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL
    | SWT.V_SCROLL);
  viewer.setContentProvider(new TreeContentProvider());
  viewer.setInput(new MyTreeNode(0,&quot;&quot;)); // hier ebenfalls aktualisiert
}
&lt;/code&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/8443189847098032124/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/12/eclipse-rcp-swt-treeviewer.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8443189847098032124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8443189847098032124'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/12/eclipse-rcp-swt-treeviewer.html' title='Eclipse RCP / SWT - TreeViewer Sortierreihenfolge Teil 1'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-4708011398925226441</id><published>2012-11-25T01:41:00.000+01:00</published><updated>2012-12-05T22:50:36.193+01:00</updated><title type='text'>Eclipse RCP - 4.2 Juno Bug bei Applikation mit Template</title><content type='html'>&lt;b&gt;Problem:&lt;/b&gt; Nach der Installation von Eclipse Juno 4.2 RCP Developer Version treten beim Erstellen von Eclipse RCP Applikationen aus einem Template heraus mehrere Fehler auf. &lt;br /&gt;
&lt;br /&gt;
Diese sehen wie folgt aus: &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
!ENTRY org.eclipse.e4.ui.workbench 4 0 2012-11-25 00:42:28.600
!MESSAGE Unable to retrieve the bundle from the URI: 
bundleclass://org.eclipse.e4.ui.workbench.addons.swt
/org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon


!ENTRY org.eclipse.e4.ui.workbench 4 0 2012-11-25 00:42:28.600
!MESSAGE Unable to retrieve the bundle from the URI: 
bundleclass://org.eclipse.e4.ui.workbench.addons.swt
/org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon

!ENTRY org.eclipse.e4.ui.workbench 4 0 2012-11-25 00:42:28.600
!MESSAGE Unable to retrieve the bundle from the URI: 
bundleclass://org.eclipse.e4.ui.workbench.addons.swt
/org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritte um das Problem nachzustellen:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; Download von &lt;a href=&quot;http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/SR1/eclipse-rcp-juno-SR1-win32.zip&quot;&gt;Eclipse Juno&lt;/a&gt; &lt;i&gt;(hier: Build id: 20120614-1722)&lt;/i&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schirtt 2:&lt;/b&gt; Komprimierte Datei entpacken und Eclipse starten &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; Ein Plugin Projekt erstllen der auf dem Template &quot;RCP application with a view&quot; basiert. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 4:&lt;/b&gt; Pluginprojekt ausführen. In der Standardausgabe erscheinen dann die Fehlermeldungen.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritte für eine Lösung&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lösungsschritt 1:&lt;/b&gt; das plugin &lt;code&gt;org.eclipse.e4.ui.workbench.addons.swt&lt;/code&gt; unter Dependencies im MANIFEST.MF hinzufügen siehe Abbildung 1. 
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK4zk-yhrpKxR0usu-JksKpjIYkkPqsjxfOjX4Ap0QZ2_G6NSJJ0A-RIK1DJDO0SfB0sEvGkUZ6ytWuRvd-CxSNTk6tDaL3rnpe9FgCVlE2ixCiKP61jPqGwiq3qpIPSEnzc4ufL4Girc/s1600/JunoBugAbb1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK4zk-yhrpKxR0usu-JksKpjIYkkPqsjxfOjX4Ap0QZ2_G6NSJJ0A-RIK1DJDO0SfB0sEvGkUZ6ytWuRvd-CxSNTk6tDaL3rnpe9FgCVlE2ixCiKP61jPqGwiq3qpIPSEnzc4ufL4Girc/s1600/JunoBugAbb1.PNG&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abbildung 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lösungsschritt 2:&lt;/b&gt;Speichern und Eclipse RCP Applikation ausführen. Fertig!
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dieser Artikel basiert auf der folgenden Quelle (Stand: 25.11.2012) : &lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=36907.3&quot;&gt;https://bugs.eclipse.org./bugs/show_bug.cgi?id=369073&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/4708011398925226441/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/11/eclipse-rcp-42-juno-bug-bei-applikation.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/4708011398925226441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/4708011398925226441'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/11/eclipse-rcp-42-juno-bug-bei-applikation.html' title='Eclipse RCP - 4.2 Juno Bug bei Applikation mit Template'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK4zk-yhrpKxR0usu-JksKpjIYkkPqsjxfOjX4Ap0QZ2_G6NSJJ0A-RIK1DJDO0SfB0sEvGkUZ6ytWuRvd-CxSNTk6tDaL3rnpe9FgCVlE2ixCiKP61jPqGwiq3qpIPSEnzc4ufL4Girc/s72-c/JunoBugAbb1.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-7453402207348592065</id><published>2012-11-08T22:32:00.001+01:00</published><updated>2012-11-08T22:53:14.222+01:00</updated><title type='text'>Eclipse RCP - Datei im Bundle öffnen</title><content type='html'>&lt;b&gt;Eclipse Version 3.7&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Problem:&lt;/b&gt; Wie öffne ich eine Datei, die sich im Bundle/meiner RCP Applikation befindet. In der Beispielanwendung wird eine BMP Datei geöffnet. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; &lt;i&gt;Verzeichnis mit BMP Datei anlegen&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Die Datei befindet sich im Rootverzeichnis des Projekts. Bild 1 zeigt eine Projektstruktur mit dem Verzeichnis &lt;code&gt;myfiles&lt;/code&gt; und einer Bilddatei &lt;code&gt;picture.bmp&lt;/code&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvJy_FyFcZE-nGdEnAjnBNPhu3mzHEuuuXT30gHlTxxtKTvHCQ8QeOWIMSYkTEvLZSFCuuRn2sK1eZSijWNU5WD_cK0qOzK2dmT3goqCGt3Nr6sBFIyygZnz7U-v9E7KCN3BGOyPfUnmI/s1600/loadfile1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvJy_FyFcZE-nGdEnAjnBNPhu3mzHEuuuXT30gHlTxxtKTvHCQ8QeOWIMSYkTEvLZSFCuuRn2sK1eZSijWNU5WD_cK0qOzK2dmT3goqCGt3Nr6sBFIyygZnz7U-v9E7KCN3BGOyPfUnmI/s400/loadfile1.PNG&quot; width=&quot;284&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Bild 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; &lt;i&gt;Build Configuration anpassen &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
In der Build Configuration des plugin.xml im Binary Build muss das Verzeichnis mit eingebunden sein. (Bild 2)

&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiov8vb-KmgDtlKMu9VzmONAUvcDm_1UzO0mdqjsynWmRjdWVpWOEtO-qKhqss9No1rwAbIeXZFNstzh34A6KapY0Libyix4Gvr35hRuj0u5TLBFHDY0YjotgyDJy2_JvVjFsb8AN_kkkE/s1600/loadfile2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiov8vb-KmgDtlKMu9VzmONAUvcDm_1UzO0mdqjsynWmRjdWVpWOEtO-qKhqss9No1rwAbIeXZFNstzh34A6KapY0Libyix4Gvr35hRuj0u5TLBFHDY0YjotgyDJy2_JvVjFsb8AN_kkkE/s1600/loadfile2.PNG&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Bild 2 &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; &lt;i&gt;Ausführenden Code einfügen&lt;/i&gt;
&lt;br /&gt;
&lt;br /&gt;
Der Quellcode kann z.B. in einen Command Handler eingefügt werden. Es wird die Standardapplikation für den jeweiligen Dateityp gestartet. Diese muss vorher im Betriebssystem definiert sein. In Windows ist dies z.B. Paint. &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
  URL fileURL = null;
  try {
    fileURL = FileLocator
               .toFileURL(Activator.getDefault()
               .getBundle()
               .getEntry(&quot;myfiles/picture.bmp&quot;));
    String filePath = fileURL.getPath();

    File file = new File(filePath);
    Desktop.getDesktop().open(file);
  } catch (IOException e) {
     e.printStackTrace();
  }
&lt;/code&gt;
&lt;/pre&gt;
Ein alternativer Code der die gleiche Wirkung hat wird im &lt;a href=&quot;http://codeache.blogspot.de/2007/05/loading-files-with-rcp.html&quot;&gt;Codeache Blog von Hugo Corbucci&lt;/a&gt; beschrieben. &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
  Bundle bundle = Activator.getDefault().getBundle();
  Path path = new Path(&quot;myfiles/picture.bmp&quot;); //$NON-NLS-1$
  URL url = FileLocator.find(bundle, path, Collections.EMPTY_MAP);
  URL fileUrl = null;
  try {
    fileUrl = FileLocator.toFileURL(url);
    File file = new File(fileUrl.getPath());
    Desktop.getDesktop().open(file);
  } catch (IOException e) {
    e.printStackTrace();
  }
&lt;/code&gt;
&lt;/pre&gt;
&lt;b&gt;Schritt 4:&lt;/b&gt; &lt;i&gt;Ausführen. Fertig!&lt;/i&gt;
</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/7453402207348592065/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/11/eclipse-rcp-datei-im-bundle-offnen.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/7453402207348592065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/7453402207348592065'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/11/eclipse-rcp-datei-im-bundle-offnen.html' title='Eclipse RCP - Datei im Bundle öffnen'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvJy_FyFcZE-nGdEnAjnBNPhu3mzHEuuuXT30gHlTxxtKTvHCQ8QeOWIMSYkTEvLZSFCuuRn2sK1eZSijWNU5WD_cK0qOzK2dmT3goqCGt3Nr6sBFIyygZnz7U-v9E7KCN3BGOyPfUnmI/s72-c/loadfile1.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-3641882117294608627</id><published>2012-11-05T18:00:00.000+01:00</published><updated>2012-11-08T22:48:11.878+01:00</updated><title type='text'>Eclipse RCP - Command und bedingtes Anzeigen von Menüeinträgen</title><content type='html'>&lt;b&gt;Problem: &lt;/b&gt;Die Applikation zeigt Menüs oder Contextmenüs (MenuContribution) an, die in Abhängigkeitei von der Selektion oder anderen Kriteren einen Menüeintrag (Command) Anzeigen soll. Die Commands sind deklarativ definiert. &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Ein konkreteres Szenario könnte wie folgt aussehen: &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Beim Rechtsklick auf ein Objekt in einem TreeViewer oder einen Tabelleneintrag im TableViewer soll ein Attribut aus dem jeweiligen Objekt abgefragt werden (test). &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lösung:&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Diese Lösung ist nicht zu 100% deklarativ. Jedoch stellt diese einen kurzen und übersichtlichen Weg dar. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt;&lt;br /&gt;
In der Handler Klasse muss die Methode isEnabled() überschrieben werden und immer dann true zurückliefern, wenn der Menüeintrag angezeigt werden soll. In allen Anderen Fällen muss diese Methode ein false zurückliefern. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt;&lt;br /&gt;
In der Datei plugin.xml muss im Tag MenuContribution das Command wie folgt definiert sein: &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
 &amp;lt;command 
       commandid=&quot;com.blogger.javadingsda.beispielCommand&quot; 
       label=&quot;Menüeintrag&quot;&amp;gt;
    &amp;lt;visiblewhen checkenabled=&quot;true&quot;&amp;gt;&amp;lt;/visiblewhen&amp;gt;
 &amp;lt;/command&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
(... Fortsetzung mit einem ausführlichen Beispiel folgt)
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Labels:&lt;br /&gt;
&lt;br /&gt;
visibleWhen, property, test, expressions framework, command core expressions&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/3641882117294608627/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/11/eclipse-rcp-command-und-bedingtes.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/3641882117294608627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/3641882117294608627'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/11/eclipse-rcp-command-und-bedingtes.html' title='Eclipse RCP - Command und bedingtes Anzeigen von Menüeinträgen'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-3524040396931951792</id><published>2012-11-03T23:30:00.000+01:00</published><updated>2012-11-03T22:46:57.644+01:00</updated><title type='text'>Eclipse RCP - There is no handler to execute for command</title><content type='html'>&lt;b&gt;Eclipse Version 3.7 &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Problem:&lt;/b&gt; Ihr habt ein Command angelegt. Zusätzlich habt ihr ein Handler zum Command angelegt und eine Klasse zum Handler erstellt die org.eclipse.core.commands.IHandler oder org.eclipse.core.commands.IHandler2 implementiert bzw. vom org.eclipse.core.commands.AbstractHandler erbt. Diese Klasse ist beim Handler eingetragen. Eigentlich sollte dann alles laufen, ihr erhält aber dennoch eine Exception mit dem Text &quot;There is no handler to execute for command...&quot;. &lt;br /&gt;
&lt;b&gt;Lösung&lt;/b&gt;: &lt;br /&gt;
&lt;br /&gt;
In der Klasse die zum Händler gehört muss die Methode istHandled() ein true zurückgeben, da sonst das Fremework eine NotHandledException wirft. Wenn es nicht unbedingt nötig sollte man auf das Überschreiben der isHandled Methode verzichten bzw. vom Abstract Handler erben. &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
@Override
public boolean isHandled() {

    return true;

}
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dieser Artikel basiert auf dem Forumbeitrag &lt;a href=&quot;http://slopjong.de/2010/04/01/there-is-no-handler-to-execute-for-command/&quot;&gt;http://slopjong.de/2010/04/01/there-is-no-handler-to-execute-for-command/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/3524040396931951792/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/11/eclipse-rcp-there-is-no-handler-to.html#comment-form' title='1 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/3524040396931951792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/3524040396931951792'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/11/eclipse-rcp-there-is-no-handler-to.html' title='Eclipse RCP - There is no handler to execute for command'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-8158359839831537800</id><published>2012-09-07T14:49:00.001+02:00</published><updated>2012-09-07T14:49:35.664+02:00</updated><title type='text'>Eclipse RCP - SWT ScrolledComposite schneller scrollen</title><content type='html'>Die Codezeile Zeigt wie ein ScrolledComposite dazu gebracht werden kann schneller über die Buttons zu Scrollen. Das Beispiel scrollt die ScrolledComposite &lt;em&gt;sc&lt;/em&gt; vertikal fünf mal schneller. &lt;br /&gt;
&lt;br /&gt;
sc.getVerticalBar().setIncrement(sc.getVerticalBar().getIncrement()*3); &lt;br /&gt;
&lt;br /&gt;
Quelle: &lt;a href=&quot;http://www.richclient2.de/2006_10_03/scrolledcomposite-and-the-mouse-wheel/&quot;&gt;http://www.richclient2.de/2006_10_03/scrolledcomposite-and-the-mouse-wheel/&lt;/a&gt; </content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/8158359839831537800/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/09/eclipse-rcp-swt-scrolledcomposite.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8158359839831537800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8158359839831537800'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/09/eclipse-rcp-swt-scrolledcomposite.html' title='Eclipse RCP - SWT ScrolledComposite schneller scrollen'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-5151688073936901064</id><published>2012-08-20T13:15:00.000+02:00</published><updated>2012-08-20T13:15:21.580+02:00</updated><title type='text'>Reguläre Ausdrücke</title><content type='html'>Habe neulich ein Tutorial für Reguläre Ausdrücke gesucht und bin fündig geworden. Da ich der Meinung bin, dass ein gutes Tuorial es verdient verlinkt zu werden hier der &lt;a href=&quot;http://www.danielfett.de/internet-und-opensource,artikel,regulaere-ausdruecke&quot;&gt;Link zum Tutorial&lt;/a&gt;. </content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/5151688073936901064/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/08/regulare-ausdrucke.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5151688073936901064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5151688073936901064'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/08/regulare-ausdrucke.html' title='Reguläre Ausdrücke'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-8028430641059166120</id><published>2012-07-31T23:30:00.000+02:00</published><updated>2012-08-01T10:46:32.199+02:00</updated><title type='text'>Eclipse RCP - Fenster Applikationsname ändern programmatisch</title><content type='html'>Dieses kurze Tutorial zeigt wie in einer Eclipse RCP Anwendung der Titel im Fenster beim Start via Code (programmatisch) geändert werden kann. &lt;br /&gt;
&lt;br /&gt;
Eclipse Version 3.7 &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; RCP Applikation mit dem Namen &lt;code&gt;com.blogspot.javadingsda.windowtitle&lt;/code&gt; aus der Vorlage &lt;i&gt;&#39;RCP application with a view&#39;&lt;/i&gt; erstellen. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; Füge in der Klasse &lt;code&gt;ApplicationWorkbenchAdvisor&lt;/code&gt; in der Methode &lt;code&gt;createWorkbenchWindowAdvisor&lt;/code&gt; die Zeile &lt;code&gt;configurer.setTitle(&quot;My Title!&quot;);&lt;/code&gt; hinzu.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
 
 @Override
 public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
                                 IWorkbenchWindowConfigurer configurer) {
   configurer.setTitle(&quot;My Title!&quot;); 
   return new ApplicationWorkbenchWindowAdvisor(configurer);
 }

 @Override
 public String getInitialWindowPerspectiveId() {
  return Perspective.ID;
 } 
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; Kompilieren und testen!</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/8028430641059166120/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/07/eclipse-rcp-fenster-applikationsname.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8028430641059166120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8028430641059166120'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/07/eclipse-rcp-fenster-applikationsname.html' title='Eclipse RCP - Fenster Applikationsname ändern programmatisch'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-4215689704321247749</id><published>2012-03-29T23:37:00.000+02:00</published><updated>2012-11-14T21:47:13.036+01:00</updated><title type='text'>Eclipse RCP - Widgets in der Statusleiste (StatusLine/Statusbar)</title><content type='html'>&lt;i&gt;Eclipse Version 3.7&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Dieser Artikel zeigt wie eine Statusleiste(im folgenden Text auch Statusline genannt) aktiviert werden kann und wie einige Widgets zu dieser hinzugefügt werden können.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihoSb8_bsmga_DXoQisuw-rsEC5VMQywweru1u26-UaNVvWH5DDeXyd20Ik-9UZquu53Yf7I_ZSEly1OAD3VnPj6qykVaxkq93JNxDqlf8aFqft8Id2ofBWzlej250POnOPeZR18mmCUA/s1600/StatusLine.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihoSb8_bsmga_DXoQisuw-rsEC5VMQywweru1u26-UaNVvWH5DDeXyd20Ik-9UZquu53Yf7I_ZSEly1OAD3VnPj6qykVaxkq93JNxDqlf8aFqft8Id2ofBWzlej250POnOPeZR18mmCUA/s1600/StatusLine.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;Problemstellung:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In der Statusleiste einer Eclipse RCP Anwendung soll eine Textbox mit 
einer Schaltfläche (Button) erscheinen. Beim Klick auf die Schalfläche 
soll der Text aus der Textbox in der view erscheinen. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lösung&lt;/b&gt;&lt;br /&gt;
Es gibt zwei wichtige Schritte die beachtet werden müssen, um eine Statusleiste zu erzeugen. Erstens muss in der Klasse, die vom &lt;code&gt;WorkbenchWindowAdvisor&lt;/code&gt; erbt (in unserem Beispiel ist es die Klasse &lt;code&gt;ApplicationWorkbenchWindowAdvisor&lt;/code&gt;) in der Methode &lt;code&gt;preWindowOpen&lt;/code&gt; die Anzeige der Statusline aktiviert werden. Zweitens muss die Methode &lt;code&gt;fillStatusLine&lt;/code&gt; in er Klasse &lt;code&gt;ApplicationActionBarAdvisor&lt;/code&gt; überschrieben werden um dort eine &lt;code&gt;ControlContribution&lt;/code&gt; einzufügen, die den Ihnalt der Statusleiste repräsentiert. Alle nötigen Schritte werden unten genauer beschrieben.
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1&lt;/b&gt;&lt;br /&gt;
Erzeuge eine RCP Application aus dem Template &lt;i&gt;RCP Eclipse Application with a view&lt;/i&gt; mit dem Namen &lt;code&gt;com.blogspot.javadingsda.statusline&lt;/code&gt;.
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2&lt;/b&gt;&lt;br /&gt;
Erzeuge die Klasse &lt;code&gt;StatusLineTextBox&lt;/code&gt;. Diese repräsentiert die Statuszeile. 

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.statusline;

import org.eclipse.jface.action.ControlContribution;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text;

public class StatusLineTextBox extends ControlContribution {

 Text textBox;
 private View view;

 public StatusLineTextBox(String str) {
  super(str);
 }

 @Override
 protected Control createControl(Composite parent) {

  textBox = new Text(parent, SWT.BORDER );
  textBox.setText(&quot;hier was eingeben!&quot;);
  
  Button button = new Button(parent, SWT.NONE);
  button.setText(&quot;Text oben ausgeben&quot;);
  button.addSelectionListener(new SelectionAdapter() {
   public void widgetSelected(SelectionEvent e) {
    view.setText(textBox.getText());
    view.update();
   }
  });

  return textBox;
 }

 public void addView(View view) {
  this.view = view;
 }
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3&lt;/b&gt;&lt;br /&gt;
Füge zur Klasse &lt;code&gt;ApplicationActionBarAdvisor&lt;/code&gt; die Methode &lt;code&gt;fillStatusLine&lt;/code&gt; hinzu. Die Klasse sollte wie folgt aussehen: 
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.statusline;

import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;

public class ApplicationActionBarAdvisor extends ActionBarAdvisor {

 public static StatusLineTextBox textBox = new StatusLineTextBox(&quot;MyBox&quot;);
 public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
  super(configurer);
 }
 
 &lt;span style=&quot;color: #cc0000;&quot;&gt;@Override
 protected void fillStatusLine(IStatusLineManager statusLine) {
  super.fillStatusLine(statusLine);
  statusLine.add(textBox);
 }&lt;/span&gt;
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 4&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.statusline;

import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {

 public ApplicationWorkbenchWindowAdvisor(
   IWorkbenchWindowConfigurer configurer) {
  super(configurer);
 }

 public ActionBarAdvisor createActionBarAdvisor(
   IActionBarConfigurer configurer) {
  return new ApplicationActionBarAdvisor(configurer);
 }

 @Override
 public void preWindowOpen() {
  IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
  configurer.setInitialSize(new Point(400, 300));
  configurer.setShowCoolBar(false);
  &lt;span style=&quot;color: #cc0000;&quot;&gt;configurer.setShowStatusLine(true); // auf true setzen&lt;/span&gt;
  configurer.setTitle(&quot;RCP Application&quot;);
 }
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 5&lt;/b&gt;&lt;br /&gt;
Anschließend muss nur noch die &lt;code&gt;View&lt;/code&gt; modifiziert werden. 

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.statusline;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.part.ViewPart;

public class View extends ViewPart {
 public static final String ID = &quot;com.blogspot.javadingsda.statusline.view&quot;;

 &lt;span style=&quot;color: #cc0000;&quot;&gt;private String text = &quot;Testmich!&quot;;

 private Label l1;&lt;/span&gt;

 public void createPartControl(Composite parent) {
  &lt;span style=&quot;color: #cc0000;&quot;&gt;ApplicationActionBarAdvisor.textBox.addView(this);
  l1 = new Label(parent, SWT.NONE);
  l1.setText(text);&lt;/span&gt;
 }

 public void setFocus() {}

 &lt;span style=&quot;color: #cc0000;&quot;&gt;public void setText(String text) {
  this.text = text;
 }

 public void update() {
  l1.setText(text);
 }&lt;/span&gt;
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
Anwendung ausführen. Fertig!
&lt;br /&gt;
&lt;br /&gt;
Dieser Artikel basiert auf den folgenden Quellen: 
&lt;a href=&quot;http://www.java-tips.org/other-api-tips/eclipse/how-to-add-swt-controls-in-statusline-and-toolbar-of-ec.html&quot;&gt;www.java-tips.org&lt;/a&gt; 
und &lt;a href=&quot;http://www.saxonysoft.de/index.php?option=com_content&amp;amp;view=article&amp;amp;id=53:eclipse-rcp-eine-combobox-der-statusleiste-hinzufuegen&amp;amp;catid=39:eclipse-rcp&amp;amp;Itemid=70&quot;&gt;www.saxonysoft.de&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/4215689704321247749/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/03/eclipse-rcp-widgets-in-der-statusleiste.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/4215689704321247749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/4215689704321247749'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/03/eclipse-rcp-widgets-in-der-statusleiste.html' title='Eclipse RCP - Widgets in der Statusleiste (StatusLine/Statusbar)'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihoSb8_bsmga_DXoQisuw-rsEC5VMQywweru1u26-UaNVvWH5DDeXyd20Ik-9UZquu53Yf7I_ZSEly1OAD3VnPj6qykVaxkq93JNxDqlf8aFqft8Id2ofBWzlej250POnOPeZR18mmCUA/s72-c/StatusLine.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-5875689423437223931</id><published>2012-03-06T23:42:00.002+01:00</published><updated>2012-05-11T13:07:16.643+02:00</updated><title type='text'>Eclipse RCP - TreeViewer drag and drop (DnD)</title><content type='html'>Eclipse Version 3.7 (Indigo)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF_A4OcPh3PooBU4IrKpfZkq5lpvgiGLAw3UK4k5fpJTm0QPZWVq9X-EKn8_boqRZI0DNKO6ZkFRjl7_V6YAdmWAWKklRxhyphenhyphen4HvfM_VV6UnlsvSQWhi6Fc8bgVa5ZjwLgP1h-SVE39cR0/s1600/treednd.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF_A4OcPh3PooBU4IrKpfZkq5lpvgiGLAw3UK4k5fpJTm0QPZWVq9X-EKn8_boqRZI0DNKO6ZkFRjl7_V6YAdmWAWKklRxhyphenhyphen4HvfM_VV6UnlsvSQWhi6Fc8bgVa5ZjwLgP1h-SVE39cR0/s320/treednd.png&quot; width=&quot;226&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
In diesem Artikel (Tutorial) wird ein einfaches &#39;Drag and Drop&#39; Beispiel mit einem TreeViewer gezeigt. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;
In einem TreeViewer sollen die Knoten per &#39;Drag and Drop&#39; umgeordnet werden. Es soll möglich sein, einen Knoten des TreeViewer
gezielt vor oder hinter einen anderen Knoten einzufügen. Es ist nicht möglich die Knoten eines TreeViewer zwischen zwei Fenstern zu schieben. Sollte ein Interesse an solch einem Tutorial bestehen, dann schickt mir bitte eine kurze Info per Mail.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt;&lt;br /&gt;
RCP Applikation mit dem Namen com.blogspot.javadingsda.dndfirst aus der Vorlage &#39;RCP application with a view&#39; erstellen. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt;&lt;br /&gt;
Entferne alle inneren Klassen, Methoden und Attribute aus der View Klasse und ersetze sie durch den unten aufgeführten Code. Die View Klasse sollte wie folgt aussehen. 
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.dndfirst;

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

public class View extends ViewPart {
 public static final String ID = &quot;com.blogspot.javadingsda.dndfirst.view&quot;;

 private TreeViewer viewer;
 Model model = new Model();

 public void createPartControl(Composite parent) {
  viewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
  viewer.setContentProvider(new ViewContentProvider());
  Transfer[] transferTypes = new Transfer[] { 
                                                    TextTransfer.getInstance() };
  viewer.addDragSupport(DND.DROP_MOVE | DND.DROP_COPY, 
                                      transferTypes,
          new NodeDragListener(viewer));
  viewer.addDropSupport(DND.DROP_MOVE | DND.DROP_COPY, 
                                      transferTypes,
          new NodeDropListener(this, viewer));
  viewer.setInput(model.getRoot());
 }

 public void setFocus() {
  viewer.getControl().setFocus();
 }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt;&lt;br /&gt;
Erzeuge die Klasse &lt;code&gt;ViewContentProvider&lt;/code&gt;. Die Funktionalität dieser Klasse (bzw. der Klasse &lt;code&gt;ITreeContentProvider&lt;/code&gt;) wird 
im Artikel &lt;a href=&quot;http://javadingsda.blogspot.com/2011/11/eclipse-rcp-swt-einfaches-treeviewer.html&quot;&gt;Eclipse RCP / SWT - Einfaches TreeViewer Beispiel&lt;/a&gt; erläutert.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.dndfirst;

import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class ViewContentProvider implements ITreeContentProvider {

 public void inputChanged(Viewer v, Object oldInput, Object newInput) {
 }

 public void dispose() {
 }

 public Object[] getElements(Object parent) {
  TreeNode ret = (TreeNode) parent;
  return ret.getChildren();
 }

 @Override
 public Object[] getChildren(Object parentElement) {
  TreeNode node = (TreeNode) parentElement;
  return node.getChildren();
 }

 @Override
 public Object getParent(Object element) {
  TreeNode node = (TreeNode) element;
  return node.getParent();
 }

 @Override
 public boolean hasChildren(Object element) {
  TreeNode node = (TreeNode) element;
  return node.getChildren().length &amp;gt; 0;
 }
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 4:&lt;/b&gt;&lt;br /&gt;
Erzeuge die Klasse &lt;code&gt;TreeNode&lt;/code&gt;. Diese repräsentiert die Knotenpunkte im Baum. Abgesehen von den standard Methoden wie &lt;code&gt;getParent&lt;/code&gt; und &lt;code&gt;addChild&lt;/code&gt; besitzt diese Klasse die Methoden &lt;code&gt;insertAfter&lt;/code&gt; und &lt;code&gt;insertBefore&lt;/code&gt;. Die Methode &lt;code&gt;insertAfter&lt;/code&gt; fügt einen Knoten hinter einen anderen Knoten hinzu. Die Methode &lt;code&gt;insertBefore&lt;/code&gt; fügt einen Knoten vor einen anderen Knoten.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;package com.blogspot.javadingsda.dndfirst;

import java.util.LinkedList;
import java.util.List;

public class TreeNode {

 private List&amp;lt;TreeNode&amp;gt; children = new LinkedList&amp;lt;TreeNode&amp;gt;();
 private String name; // visible name
 private TreeNode parent;

 public TreeNode(String name) {
  this.name = name;
 }

 public void addChild(TreeNode child) {
  if (child.getParent() != null) {
   ((TreeNode) child.getParent()).children.remove(child);
  }
  child.setParent(this);
  children.add(child);
 }

 public void removeChild(TreeNode node) {
  children.remove(node);
  node.setParent(null);
 }

 public void insertAfter(Object targetObj) {
  TreeNode target = convertToTreeNode(targetObj);
  List&amp;lt;TreeNode&amp;gt; childrenList = target.parent.children;
  int targetIndex = childrenList.indexOf(target);
  int thisIndex;
  int index;
  if (target.parent == this.parent) {
   thisIndex = childrenList.indexOf(this);
   if (thisIndex &amp;lt; targetIndex)
    index = targetIndex;
   else
    index = targetIndex + 1;
  } else {
   index = targetIndex + 1;
  }
  insertChild(target, index);
 }

 public void insertBefore(Object targetObj) {
  TreeNode target = convertToTreeNode(targetObj);
  int index;
  int thisIndex;
  int targetIndex = target.parent.children.indexOf(target);
  if (target.parent == this.parent){
   thisIndex = target.parent.children.indexOf(this);
   if (thisIndex &amp;lt; targetIndex) {
    index = targetIndex - 1;
   } else {
    index = targetIndex;
   }
  } else {
   index = targetIndex;
  }
  insertChild(target, index);
 }

 private void insertChild(TreeNode target, int index) {
  if (parent != null)
   parent.removeChild(this);
  target.parent.children.add(index, this);
  this.setParent(target.parent);
 }

 private TreeNode convertToTreeNode(Object obj) {
  if (obj instanceof TreeNode) {
   return (TreeNode) obj;
  }
  return null;
 }

 private void setParent(TreeNode parent) {
  this.parent = parent;
 }

 public String toString() {
  return name;
 }

 public Object[] getChildren() {
  return children.toArray();
 }

 public Object getParent() {
  return parent;
 }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;code&gt;
&lt;/code&gt;

&lt;b&gt;Schritt 5:&lt;/b&gt;&lt;br /&gt;
Erzeuge die Model Klasse. Die &lt;code&gt;Model&lt;/code&gt; Klasse erzeugt einen Baum in dem die Knoten durchnummeriert sind. Die Reihenfolge ist willkürlich.  
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.dndfirst;

import java.util.HashMap;

public class Model {

 private TreeNode root = new TreeNode(&quot;root&quot;);
 private HashMap&amp;lt;String, TreeNode&amp;gt; map = new HashMap&amp;lt;String, TreeNode&amp;gt;();

 public Model() {

  TreeNode node1 = new TreeNode(&quot;Node1&quot;);
  TreeNode node2 = new TreeNode(&quot;Node2&quot;);
  TreeNode node3 = new TreeNode(&quot;Node3&quot;);
  TreeNode node4 = new TreeNode(&quot;Node4&quot;);
  TreeNode node5 = new TreeNode(&quot;Node5&quot;);
  TreeNode node6 = new TreeNode(&quot;Node6&quot;);
  TreeNode node7 = new TreeNode(&quot;Node7&quot;);
  TreeNode node8 = new TreeNode(&quot;Node8&quot;);
  TreeNode node9 = new TreeNode(&quot;Node9&quot;);
  TreeNode node10 = new TreeNode(&quot;Node10&quot;);
  TreeNode node11 = new TreeNode(&quot;Node11&quot;);
  TreeNode node12 = new TreeNode(&quot;Node12&quot;);
  TreeNode node13 = new TreeNode(&quot;Node13&quot;);

  map.put(&quot;root&quot;, root);
  map.put(&quot;Node1&quot;, node1);
  map.put(&quot;Node2&quot;, node2);
  map.put(&quot;Node3&quot;, node3);
  map.put(&quot;Node4&quot;, node4);
  map.put(&quot;Node5&quot;, node5);
  map.put(&quot;Node6&quot;, node6);
  map.put(&quot;Node7&quot;, node7);
  map.put(&quot;Node8&quot;, node8);
  map.put(&quot;Node9&quot;, node9);
  map.put(&quot;Node10&quot;, node10);
  map.put(&quot;Node11&quot;, node11);
  map.put(&quot;Node12&quot;, node12);
  map.put(&quot;Node13&quot;, node13);

  root.addChild(node1);
  root.addChild(node2);
  node1.addChild(node3);
  node1.addChild(node4);
  node1.addChild(node5);
  node2.addChild(node6);
  node2.addChild(node7);
  node2.addChild(node8);
  node2.addChild(node9);
  node2.addChild(node10);
  root.addChild(node11);
  root.addChild(node12);
  root.addChild(node13);
 }

 public TreeNode getRoot() {
  return root;
 }

 public TreeNode get(String nodeName) {
  return map.get(nodeName);
 }
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;b&gt;Schritt 6:&lt;/b&gt;&lt;br /&gt;
Erzeuge die Klasse &lt;code&gt;NodeDragListener&lt;/code&gt;. Die vom &lt;code&gt;DragScourceAdapter&lt;/code&gt; geerbte Methode &lt;code&gt;dragSetData(DragSourceEvent event)&lt;/code&gt; hat die Aufgabe den Text des beim &#39;draggen&#39; selektierten Knotens im &lt;code&gt;data&lt;/code&gt; Attribut abzulegen. Sollte die Selektion nicht auf einem TreeViewer statt finden, dann wird die &#39;Drag and Drop&#39; Aktion abgebrochen.  
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.dndfirst;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.dnd.DragSourceAdapter;
import org.eclipse.swt.dnd.DragSourceEvent;

public class NodeDragListener extends DragSourceAdapter {

  private TreeViewer treeViewer;

  public NodeDragListener(TreeViewer treeViewer) {
    this.treeViewer = treeViewer;
  }

  @Override
  public void dragSetData(DragSourceEvent event) {
    ISelection selection = treeViewer.getSelection();

    if (selection instanceof TreeSelection) {
      TreeSelection treeSelection = (TreeSelection) selection;
      event.data = ((TreeNode) treeSelection.getFirstElement())
                                  .toString();
    } else {
      event.doit = false;
    }
  }
}

&lt;/code&gt;
&lt;/pre&gt;
&lt;b&gt;Schritt 7:&lt;/b&gt;&lt;br /&gt;
Erzeuge die Klasse &lt;code&gt;NodeDropListener&lt;/code&gt;. Diese Klasse steuert den &#39;Drop&#39;, d.h. die Ereignisse wenn der Benutzer einen Knoten wieder im Baum losläßt. Die Methode &lt;code&gt;validateDrop&lt;/code&gt; prüft ob ein Element auf der definierten stelle losgelassen (&#39;gedropt&#39;) werden kann. Diese wird vom &lt;code&gt;ViewDropAdapter&lt;/code&gt; benutzt. Die &lt;code&gt;drop&lt;/code&gt; Methode kümmert sich um das Verschieben der TreeNode im Baum, indem sie die Aufgabe an die richtige Methode der Ziel TreeNode delegiert. Das Attribut &lt;code&gt;operation&lt;/code&gt; zeigt an, in welcher Relation die TreeNode zur Ziel TreeNode hinzugefügt werden soll.   
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.dndfirst;

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerDropAdapter;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.TransferData;

class NodeDropListener extends ViewerDropAdapter {

  private View view;
  private TreeViewer treeViewer;
  private TreeNode target;
  private int operation;

  public NodeDropListener(View view, TreeViewer treeViewer) {
    super(treeViewer);
    this.view = view;
    this.treeViewer = treeViewer;
  }

  @Override
  public void drop(DropTargetEvent event)  {

    if (event.data instanceof String) {
      operation = this.determineLocation(event);
      TreeNode dropedNode = this.view.model.get((String) event.data);
      TreeNode parentDropedNode = (TreeNode) dropedNode.getParent();
      if (dropedNode == target)
        return;
      switch (this.operation) {
        case ViewerDropAdapter.LOCATION_AFTER:
          dropedNode.insertAfter(target);
          System.out.println(dropedNode + &quot; wurde hinter &quot; + target + &quot; eingefügt.&quot;);
          break;
        case ViewerDropAdapter.LOCATION_BEFORE:
          dropedNode.insertBefore(target);
          System.out.println(dropedNode + &quot; wurde vor &quot; + target + &quot; eingefügt.&quot;);
          break;
        case ViewerDropAdapter.LOCATION_ON:
          if (dropedNode != target.getParent())
               target.addChild(dropedNode);
          System.out.println(dropedNode + &quot; wurde zur &quot; + target + &quot; eingefügt.&quot;);
          break;
        case ViewerDropAdapter.LOCATION_NONE:
          break;
        default:
          break;
      }
      super.drop(event);
      treeViewer.refresh(this.target.getParent(), true);
      treeViewer.refresh(parentDropedNode, true);
    }
  }

  @Override
  public boolean performDrop(Object data) {
    return true;
  }

  @Override
  public boolean validateDrop(Object target, int operation,
                              TransferData transferType) {
    if (target instanceof TreeNode) {
      this.target = (TreeNode) target;
      this.operation = operation;
      return true;
    } else {
      this.target = null;
      this.operation = 0;
      return false;
    }
  }
}
&lt;/code&gt;
&lt;/pre&gt;
Wird die Anwendung ausgeführt, dann wird in der Standardkonsole die Position des einzufügenden Knotens angezeigt. &lt;br /&gt;
&lt;i&gt;Dieser Artikel baut auf dem Artikel &lt;a href=&quot;http://www.vogella.de/articles/EclipseDragAndDrop/article.html&quot;&gt;Eclipse Drag and Drop.&lt;/a&gt; von Lars Vogel&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/5875689423437223931/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/03/eclipse-rcp-treeviewer-drag-and-drop.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5875689423437223931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5875689423437223931'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/03/eclipse-rcp-treeviewer-drag-and-drop.html' title='Eclipse RCP - TreeViewer drag and drop (DnD)'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF_A4OcPh3PooBU4IrKpfZkq5lpvgiGLAw3UK4k5fpJTm0QPZWVq9X-EKn8_boqRZI0DNKO6ZkFRjl7_V6YAdmWAWKklRxhyphenhyphen4HvfM_VV6UnlsvSQWhi6Fc8bgVa5ZjwLgP1h-SVE39cR0/s72-c/treednd.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-5654897099523685543</id><published>2012-03-01T16:13:00.003+01:00</published><updated>2012-03-14T20:44:33.951+01:00</updated><title type='text'>Eclipse RCP - Plug-in Problem</title><content type='html'>&lt;b&gt;Problem: &lt;/b&gt;&lt;br /&gt;
Beim Ausführen eines Plugin Projekts erhält man die Fehlermeldung: &lt;br /&gt;
&lt;br /&gt;
!SESSION 2012-03-01 16:09:21.828 -----------------------------------------------&lt;br /&gt;
eclipse.buildId=unknown&lt;br /&gt;
java.version=1.6.0_22&lt;br /&gt;
java.vendor=Sun Microsystems Inc.&lt;br /&gt;
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE&lt;br /&gt;
Framework arguments:&amp;nbsp; -application com.blogspot.javadingsda.databindingeasy.application&lt;br /&gt;
Command-line arguments:&amp;nbsp; -application com.blogspot.javadingsda.databindingeasy.application -data C:\dev\workspaces\databinding/../runtime-com.blogspot.javadingsda.databindingeasy.application -dev file:C:/dev/workspaces/databinding/.metadata/.plugins/org.eclipse.pde.core/com.blogspot.javadingsda.databindingeasy.application/dev.properties -os win32 -ws win32 -arch x86 -consoleLog&lt;br /&gt;
&lt;br /&gt;
!ENTRY org.eclipse.osgi 2 0 2012-03-01 16:09:23.296&lt;br /&gt;
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:&lt;br /&gt;
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-03-01 16:09:23.296&lt;br /&gt;
!MESSAGE Bundle initial@reference:file:../../../workspaces/databinding/com.blogspot.javadingsda.databindingeasy/ was not resolved.&lt;br /&gt;
!SUBENTRY 2 com.blogspot.javadingsda.databindingeasy 2 0 2012-03-01 16:09:23.296&lt;br /&gt;
!MESSAGE Missing required bundle org.eclipse.core.databinding.beans_1.2.100.&lt;br /&gt;
&lt;br /&gt;
!ENTRY org.eclipse.osgi 2 0 2012-03-01 16:09:23.312&lt;br /&gt;
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:&lt;br /&gt;
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-03-01 16:09:23.312&lt;br /&gt;
!MESSAGE Bundle com.blogspot.javadingsda.databindingeasy_1.0.0.qualifier [32] was not resolved.&lt;br /&gt;
!SUBENTRY 2 com.blogspot.javadingsda.databindingeasy 2 0 2012-03-01 16:09:23.312&lt;br /&gt;
!MESSAGE Missing required bundle org.eclipse.core.databinding.beans_1.2.100.&lt;br /&gt;
&lt;br /&gt;
!ENTRY org.eclipse.osgi 4 0 2012-03-01 16:09:23.312&lt;br /&gt;
!MESSAGE Application error&lt;br /&gt;
!STACK 1&lt;br /&gt;
java.lang.RuntimeException: Application &quot;com.blogspot.javadingsda.databindingeasy.application&quot; could not be found in the registry. The applications available are: org.eclipse.equinox.app.error.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
so oder ähnlich .&lt;br /&gt;
In der plugin.xml wurden die benötigten Plugins aber hinzugefügt.&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqxjD8P6dO-J2dObYxJ3zOUQExSd7wknNuGTZZ1RYW7015dCyxkGVa0-FFiWQUXffNEw-1m_uF5MepwQpRFCEaYAiGi8NxqlGX_8KNsE4ah6owZac5FdTGb5IUE3yu6Mdh9jTzOcmRCjk/s1600/options.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqxjD8P6dO-J2dObYxJ3zOUQExSd7wknNuGTZZ1RYW7015dCyxkGVa0-FFiWQUXffNEw-1m_uF5MepwQpRFCEaYAiGi8NxqlGX_8KNsE4ah6owZac5FdTGb5IUE3yu6Mdh9jTzOcmRCjk/s1600/options.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT5PjWHkt6U4yY-JpCyJt8WCjHK2oEXXkkLLKzNnzIYIftDvSSYtrR4PFDMxQ_p9myJy2RGPjywwBuFk81QxL2WVL5N7MHgqKqQmbrmIlaY924wwhScDflTC2CqdIW_CuNLHA25am9YKU/s1600/dependencies_plugin_problem.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Mögliche Lösung: &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Rechter Mausklick auf das Projekt. Im Kontext Menü &#39;Properties&#39; auswählen. Dann &#39;Run/Debug Settings&#39;. Das zum Projekt passende Produkt auswählen und mit dem Edit Button bearbeiten. Reiter Plug-ins auswählen und nachsehen ob beim bemängelten Bundle ein Häckchen steht. In diesem Beispiel ist es &#39;org.eclipse.core.databinding.beans_1.2.100&#39;. Falls dies nicht der Fall ist, Häckchen setzen. &lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/5654897099523685543/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/03/plug-in-problem.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5654897099523685543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5654897099523685543'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/03/plug-in-problem.html' title='Eclipse RCP - Plug-in Problem'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqxjD8P6dO-J2dObYxJ3zOUQExSd7wknNuGTZZ1RYW7015dCyxkGVa0-FFiWQUXffNEw-1m_uF5MepwQpRFCEaYAiGi8NxqlGX_8KNsE4ah6owZac5FdTGb5IUE3yu6Mdh9jTzOcmRCjk/s72-c/options.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-3577186577266873234</id><published>2012-02-10T22:38:00.001+01:00</published><updated>2012-02-10T22:38:16.705+01:00</updated><title type='text'>Java - Temporäre Datei erstellen</title><content type='html'>Zwei richtig gute Seiten in denen recht ausfürlich beschrieben wird, wie eine temporäre Datei erstellt wird. &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dpunkt.de/java/Programmieren_mit_Java/Streams/13.html&quot;&gt;http://dpunkt.de/java/Programmieren_mit_Java/Streams/13.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.javabeginners.de/Dateien_und_Verzeichnisse/Datei_in_temp-Verzeichnis_erstellen.php&quot;&gt;http://www.javabeginners.de/Dateien_und_Verzeichnisse/Datei_in_temp-Verzeichnis_erstellen.php&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/3577186577266873234/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/02/java-temporare-datei-erstellen.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/3577186577266873234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/3577186577266873234'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/02/java-temporare-datei-erstellen.html' title='Java - Temporäre Datei erstellen'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-5197617063552827367</id><published>2012-02-10T22:35:00.001+01:00</published><updated>2012-02-11T18:15:41.668+01:00</updated><title type='text'>Eclipse RCP - Tutorial Videos</title><content type='html'>Eine Linksammlung zu Video Tutorials in deutsch:&lt;br /&gt;
&lt;a href=&quot;http://www.youtube.com/watch?v=33zqEtOM8E0&quot;&gt;View anzeigen und öffnen - Teil 1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.youtube.com/watch?v=PDyZ3SLoFCU&amp;amp;feature=mfu_in_order&amp;amp;list=UL&quot;&gt;View anzeigen und öffnen - Teil 2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.youtube.com/watch?v=19jUUBwtcNw&quot;&gt;Java3D und Eclipse RCP&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://vimeo.com/21847847&quot;&gt;Eclipse RCP: Mehrsprachigkeit von Ralf Ebert&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/5197617063552827367/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2012/02/eclipse-rcp-tutorial-videos.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5197617063552827367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5197617063552827367'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2012/02/eclipse-rcp-tutorial-videos.html' title='Eclipse RCP - Tutorial Videos'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-5136583570341466558</id><published>2011-12-18T20:01:00.000+01:00</published><updated>2012-11-06T09:36:43.863+01:00</updated><title type='text'>Eclipse RCP - MessageBox</title><content type='html'>Wie erhalte ich eine MessageBox und wie setze ich die MessageBox ein?&lt;br /&gt;
&lt;br /&gt;
Ein sehr gutes MessageBox Beispiel findet ihr bei &lt;a href=&quot;http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/MessageBoxExample.htm&quot;&gt;www.java2s.com&lt;/a&gt;

Die entscheidende Stelle hier nochmal kurz als Codesnippet: 

&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;MessageBox messageBox = 
  new MessageBox(shell, 
            SWT.ICON_WARNING | SWT.ABORT | SWT.RETRY | SWT.IGNORE);
        
messageBox.setText(&quot;Warning&quot;);
messageBox.setMessage(&quot;Save the changes before exiting?&quot;);
int buttonID = messageBox.open();&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;i&gt;Quelle: http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/MessageBoxExample.htm &lt;/i&gt;
&lt;br /&gt;
&lt;br /&gt;
Der zweite Parameter der MessageBox steuert die Anzahl und Art der Buttons die in der MessageBox angezeigt werden. Weiterhin kann mit dem zweiten Paremeter der Typ der MessageBox (hier Warnung) bestimmt werden. &lt;br /&gt;&lt;br /&gt;

Die MessageBox wird modal aufgerufen. Die Methode open() öffnet die MessageBox. Am Rückgabewert kann identifiziert werden, welcher Button vom Benutzer gedrückt wurde. 
&lt;br /&gt;
&lt;br /&gt;
Die &lt;span style=&quot;color: #999999;&quot;&gt;&lt;code&gt;buttonId&lt;/code&gt;&lt;/span&gt; kann mit dafür vorgesehenen Konstanten der Klasse SWT verglichen werden, z.B. &lt;code&gt;if ( buttonID == SWT.CANCEL ) { ...&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
Die aufgeführte Liste zeigt einige Konstanten für die Buttons: 
&lt;br /&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;ul&gt;&lt;code&gt;
&lt;li&gt;SWT.ABORT &lt;/li&gt;
&lt;li&gt;SWT.CANCEL &lt;/li&gt;
&lt;li&gt;SWT.IGNORE &lt;/li&gt;
&lt;li&gt;SWT.NO &lt;/li&gt;
&lt;li&gt;SWT.OK &lt;/li&gt;
&lt;li&gt;SWT.RETRY &lt;/li&gt;
&lt;li&gt;SWT.YES &lt;/li&gt;
&lt;/code&gt;&lt;/ul&gt;
&lt;code&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/5136583570341466558/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2011/12/eclipse-rcp-messagebox.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5136583570341466558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/5136583570341466558'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2011/12/eclipse-rcp-messagebox.html' title='Eclipse RCP - MessageBox'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-4470895736788753232</id><published>2011-11-25T20:30:00.000+01:00</published><updated>2011-11-28T22:26:06.778+01:00</updated><title type='text'>Eclipse RCP - Hintergrundfarbe und Image eines Labels im TreeViewer</title><content type='html'>Dieser Artikel beschreibt wie die Hintergrundfarbe eines Labels in einem TreeViewer geändert werden kann. 
&lt;br /&gt;
&lt;br /&gt;
Das Aussehen eines Knotens in einem &lt;code&gt;TreeViewer&lt;/code&gt; wird mit einem &lt;code&gt;LabelProvider&lt;/code&gt; gesteuert. Der &lt;code&gt;LabelProvider&lt;/code&gt; wird mit der Methode &lt;code&gt;setLabelProvider&lt;/code&gt; der Klasse &lt;code&gt;TreeViewer&lt;/code&gt; gesetzt. 
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
// deklaration des TreeViewers in einer View Klasse 
public TreeViewer viewer;

...
// createPartControl Methode der View Klasse 
public void createPartControl(Composite parent) { 

...

  viewer.setLabelProvider(new ViewLabelProvider());

...
}&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
Die Aufgaben des &lt;code&gt;LabelProvider&lt;/code&gt;s werden von den geerbten Klassen bzw. den implementierten Interfaces bestimmt. Die Klasse &lt;code&gt;LabelProvider&lt;/code&gt; bietet die Methoden &lt;code&gt;getText&lt;/code&gt; und &lt;code&gt;getImage&lt;/code&gt;, mit denen der Text und das Bild bestimmt werden können. Der Übergabeparameter &lt;code&gt;obj&lt;/code&gt; vom Typ Object ist das TreeElement, dass einen Knoten im Tree repräsentiert.
&lt;br /&gt;
&lt;br /&gt;
In der hier gezeigten Implementierung liefert der Parameter &lt;code&gt;obj&lt;/code&gt; den Text der im Label angezeigt wird, bzw. das Image das zum Label angezeigt wird. Würde man in der Methode &lt;code&gt;getImage&lt;/code&gt; immer das gleiche Bild zurückgeben, dann würde der TreeViewer das gleiche Bild für alle Knoten anzeigen. &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

class ViewLabelProvider extends LabelProvider implements IColorProvider {

 @Override
 public String getText(Object obj) {
     return obj.toString();
 }
 
 @Override
 public Image getImage(Object obj) {
     Image img = ((TreeObject)obj).getIcon();
     return img; 
 }

 @Override
 public Color getForeground(Object element) {
     return new Color(PlatformUI.getWorkbench().getDisplay(),
                      new RGB(255,255,255));
 }

  @Override
  public Color getBackground(Object element) {
    return new Color(PlatformUI.getWorkbench().getDisplay(),&amp;nbsp;
                     new RGB(100,100,100));
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Die Methoden &lt;code&gt;getForeground&lt;/code&gt; und &lt;code&gt;getBackground&lt;/code&gt; bestimmen die Schriftfarbe
und die Hintergrundfarbe. 
&lt;br /&gt;
&lt;br /&gt;
Es sollte beachtet werden, dass Bilder und Farben in einer Eclipse RCP Applikation verwaltet werden sollten. 
Das bedeutet, dass einmal erstellte Farben und Bilder wieder freigegeben werden sollten. 
Mehr dazu im &lt;a href=&quot;http://javadingsda.blogspot.com/2011/10/eclipse-rcp-bilder-fur-fortgeschrittene.html&quot;&gt;Bilder verwalten Artikel&lt;/a&gt; und im &lt;a href=&quot;http://www.ralfebert.de/eclipse_rcp/jface_dec_assist/&quot;&gt;Artikel zur Farbverwaltung &lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/4470895736788753232/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2011/11/eclipse-rcp-hintergrundfarbe-und-image.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/4470895736788753232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/4470895736788753232'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2011/11/eclipse-rcp-hintergrundfarbe-und-image.html' title='Eclipse RCP - Hintergrundfarbe und Image eines Labels im TreeViewer'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-6331958268917355250</id><published>2011-11-05T18:52:00.000+01:00</published><updated>2012-12-05T23:12:18.449+01:00</updated><title type='text'>Eclipse RCP / SWT - Einfaches TreeViewer Beispiel</title><content type='html'>&lt;i&gt;Eclipse 3.7 Indigo&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
In diesem Artikel wird ein einfaches &lt;code&gt;TreeViewer&lt;/code&gt; Beispiel gezeigt. Das Beispiel konzentriert sich nur auf das Anzeigen eines Baumes, wodurch alle anderen Aspekte wie Menüs, andere ViewPart Elemente und andere GUI Elemente vernachlässigt werden. Es wird ein unendlicher binärer Baum dargestellt, dessen Hierarchierstufen gezählt werden. Alle notwendigen Schritte werden in einem HandsOn Tutorial nachvollzogen. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; RCP Applikation mit dem Namen &lt;code&gt;com.blogspot.javadingsda.easytreeviewer&lt;/code&gt; aus der Vorlage &lt;i&gt;&#39;RCP application with a view&#39;&lt;/i&gt; erstellen. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; Entferne alle inneren Klassen, Methoden und Attribute aus der &lt;code&gt;View&lt;/code&gt; Klasse und ersetze sie durch den unten aufgeführten Code. Die View Klasse sollte wie folgt aussehen. 
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.easytreeviewer;

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

public class View extends ViewPart {
  public static final String ID = 
    &quot;com.blogspot.javadingsda.easytreeviewer.view&quot;;
  private TreeViewer treeViewer; 

  public void createPartControl(Composite parent) {
    treeViewer = new TreeViewer(parent);
    treeViewer.setContentProvider(new TreeContentProvider());
    treeViewer.setInput(new MyTreeNode(0));
  }

  public void setFocus() {
  }
}
&lt;/code&gt;
&lt;/pre&gt;
Um mit den darzustellenden Daten versorgt zu werden, benötigt der TreeViewer  eine Klasse, die das Interface ITreeContentProvider implementiert. Die Methoden des ITreeContentProvider werden im Posting &lt;a href=&quot;http://javadingsda.blogspot.com/2011/05/treeviewer-methoden-des.html&quot;&gt;ITreeContentProvider Methoden&lt;/a&gt; beschrieben. Für unser Beispiel sind die Methoden &lt;code&gt;hasChildren(Object parent), getChildren(Object parent), getParent(Object child) und getElements(Object parent)&lt;/code&gt;wichtig. Die Funktionsweise der Methoden wird weiter unten in Bezug auf unser Beispiel näher erläutert. In unserem Beispiel implementiert die Klasse &lt;code&gt;ViewContentProvider&lt;/code&gt; dieses Interface und wird dem TreeViewer mit der Methode &lt;code&gt;setContntProvider(IContentProvider provider)&lt;/code&gt; bekannt gemacht. &lt;br /&gt;
Die Methode &lt;code&gt;setInput(Object input)&lt;/code&gt; initialiseirt den Baum mit dem Root Knoten. Dieser wird nicht angezeigt. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 3: &lt;/b&gt; Erstelle die Klase &lt;code&gt;MyTreeNode&lt;/code&gt;.
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.easytreeviewer;

import java.util.ArrayList;

public class MyTreeNode {
    
  private int depth;
  private MyTreeNode parent = null;
  private ArrayList&lt;mytreenode&gt; children; 
    
  public MyTreeNode(int depth) {
    children = new ArrayList&lt;mytreenode&gt;();
    this.depth = depth;
  }
    
  public MyTreeNode getParent() {
    return parent;
  }
    
  public Object[] getChildren() {
    return children.toArray();
  }
    
  public void addChild(MyTreeNode childNode) {
    childNode.setParent(this);
    this.children.add(childNode);
  }

  private void setParent(MyTreeNode parent) {
    this.parent = parent;
  }
    
  public String toString() {
    StringBuffer sb = new StringBuffer();
    sb.append(&quot;Knoten mit Tiefe &quot;);
    sb.append(String.valueOf(depth));
    return sb.toString();
  }

  public int getDepth() {
    return this.depth;
  }
}
&lt;/mytreenode&gt;&lt;/mytreenode&gt;&lt;/code&gt;&lt;/pre&gt;
Die Klasse MyTreeNode ist für die Informationen eines Knotens verantworltich. Sie enthält eine Referenz auf einen Parent und Referenzen auf alle Kinderknoten. Die Tiefe wird mit dem Attribut &lt;code&gt;depth&lt;/code&gt; dargestellt und ist nur für unser Beispiel relevant. Die &lt;code&gt;toString&lt;/code&gt; Methode liefert die bezeichung des Labels im Knoten. Diese Klasse ist dann optional, wenn der &lt;code&gt;ITreeContentProvider&lt;/code&gt; die gesamte Darstellung übernimmt und nicht auf den hier vorgestellten &lt;code&gt;MyTreeNode&lt;/code&gt; Objekten arbeitet, sondern den Baum irgendwie anders verwaltet. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 4: &lt;/b&gt; Erstelle die Klase &lt;code&gt;TreeContentProvider&lt;/code&gt;.
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
package com.blogspot.javadingsda.easytreeviewer;

import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class TreeContentProvider implements ITreeContentProvider {

  @Override
  public void dispose() {
  }

  @Override
  public void inputChanged(Viewer viewer, Object oldInput, 
                           Object newInput) {
  }

  @Override
  public Object[] getElements(Object inputElement) {
    createChildNodes(inputElement);
    return getChildren(inputElement);
  }

  @Override
  public Object[] getChildren(Object parentElement) {
    if (parentElement instanceof MyTreeNode) {
      MyTreeNode parentNode = (MyTreeNode) parentElement;
      return parentNode.getChildren();
    }
    return null;
  }

  @Override
  public Object getParent(Object element) {
    if (element instanceof MyTreeNode) {
      MyTreeNode node = (MyTreeNode) element;
      return node.getParent();
    }
    return null;
  }

  @Override
  public boolean hasChildren(Object element) {
    if (element instanceof MyTreeNode) {
      MyTreeNode node = (MyTreeNode) element;
      if (node.getChildren().length == 0) {
        createChildNodes(node);
      }
      return true;
    }
    return false;
  }

  public void createChildNodes(Object parent) {
    if (parent instanceof MyTreeNode) {
      MyTreeNode node = (MyTreeNode)parent;
      node.addChild(new MyTreeNode(node.getDepth() + 1));
      node.addChild(new MyTreeNode(node.getDepth() + 1));
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;public Object[] getElements(Object inputElement)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Diese Methode wird aufgerufen, wenn der Baum das erste mal initialieriert wird, und zwar wenn die Methode &lt;code&gt;setInput(Object input)&lt;/code&gt; des TreeViewers aufgerufen wird. In unserem Beispiel werden in dieser Methode die ersten Kinderknoten erzeugt und wiedergegeben. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;public Object[] getChildren(Object parentElement)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;getChildren&lt;/code&gt; gibt die Kinderknoten zum parentElement wieder. In unserem Beispiel hält jeder Knoten Referenzen auf die Kinderknoten. Diese können mit der getChildren Methode abgefragt werden. &lt;code&gt;getChildren&lt;/code&gt; wird immer dann aufgerufen, wenn die Kinderknoten angezeigt werden sollen. 
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;public Object getParent(Object element)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Wird vom TreeViewer aufgerufen, wenn dieser geschlossene Knoten programmatisch aufdecken möchte und wenn der TreeViewer den &#39;geöffnet&#39; Status programmatisch setzen möchte. In unserem Beipiel kommt diese Methode nicht zum Einsatz, wird aber implementiert um der Vollständigkeit zu genügen. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;public boolean hasChildren(Object element)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Bevor der TreeViewer die Kinder eines Knotens anzeigt, wird dem Benutzer visuell angezeigt, dass sich unter einem geschlossenen Knoten weitere Knoten befinden. Das Aussehen ist Betriebssystemspezifisch. In WinXP ist dies ein kleines plus Zeichen, Win7 verwendet hingegen ein kleines Dreieck links neben dem Knoten. Die Methode &lt;code&gt;hasChildren&lt;/code&gt; liefert für diese Anzeige die Information, ob sich unter dem Knoten weitere Kinderknoten befinden. Der Übergabeparameter &lt;code&gt;element&lt;/code&gt; ist dabei der Elternknoten. In unserem Beispiel werden zwei neue Kinderknoten für einen Elternknoten erzeugt, wenn dieser keine Kinderknoten besitzt. Somit entseht der unendliche binäre Baum.  
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;public void createChildNodes(Object parent)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Diese Methode erzeugt zwei Kinderknoten zu einem Elternknoten. 
&lt;br /&gt;
&lt;br /&gt;
An dieser Stelle muss noch erwähnt werden, dass das Erzeugen der Kinderknoten auch in der MyTreeNode Klasse hätte implementiert werden können. Es ist generell eine Designfrage, ob der ITreeContentProvider alle informationen von den Knoten abfragt oder diese ermittelt.

&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 4: &lt;/b&gt; Anwendung starten.
&lt;br /&gt;
Die Anwendung kann ausgeführt und getestet werden.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Weiterlesen: &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javadingsda.blogspot.com/2012/03/eclipse-rcp-treeviewer-drag-and-drop.html&quot;&gt;TreeViewer mit &#39;Drag and Drop&#39;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javadingsda.blogspot.de/2011/05/swt-treeviewer-ereignisse-beim.html&quot;&gt;TreeViewer – Ereignisse beim öffnen/schließen eines Baumkontens im TreeViewer &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javadingsda.blogspot.de/2011/05/treeviewer-methoden-des.html&quot;&gt;TreeViewer - Methoden des ITreeContentProvider&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://javadingsda.blogspot.de/2011/11/eclipse-rcp-hintergrundfarbe-und-image.html&quot;&gt;Eclipse RCP - Hintergrundfarbe und Image eines Labels im TreeViewer &lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/6331958268917355250/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2011/11/eclipse-rcp-swt-einfaches-treeviewer.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/6331958268917355250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/6331958268917355250'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2011/11/eclipse-rcp-swt-einfaches-treeviewer.html' title='Eclipse RCP / SWT - Einfaches TreeViewer Beispiel'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-1046442155231465593</id><published>2011-10-23T21:16:00.005+02:00</published><updated>2011-11-24T10:21:31.895+01:00</updated><title type='text'>Eclipse RCP - Bilder laden und verwalten für Fortgeschrittene</title><content type='html'>Bilder werden mit Eclipse (bzw. SWT) unabhängig vom Dateityp in &lt;code&gt;Image&lt;/code&gt; Objekte geladen. Bilder die an vielen Stellen und häufig in einer RCP Applikaiton verwendet werden, sollten mit der ImageRegistry verwaltet werden. Dieser Artikel zeigt dies in einem einfachen Beispiel wie Bilder in und aus der ImageRegistry geladen werden. &lt;br /&gt;
Weiterhin werden drei Möglichkeiten wie ein Pfad zu einem Bild angegeben werden kann vorgestellt.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 1:&lt;/b&gt; erstelle eine RCP Eclipse Anwendung die auf dem Template &quot;RCP Application with a view&quot; basiert&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 2:&lt;/b&gt; kopiere das Bild &quot;alt_window_32.gif&quot; in das Package in dem sich die &lt;code&gt;View&lt;/code&gt; Klasse befindet. Das Projektverzeichnis sollte wie in &lt;i&gt;Abbildung 1&lt;/i&gt; dargestellt aussehen.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLDjh7Tsxr2VqdMkhRw2HllHk4LJLf1gS3rJzu7icBEeTtvgjG36EO4eizz-vZDVrp7Cv7jaugVSeYLb4tDhI8c2EDNNV80s0uPW2ef5TVQhXTnHebLVzfDfMGMgGwF5y8jMvkoWSdwmc/s1600/img_tutorial1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLDjh7Tsxr2VqdMkhRw2HllHk4LJLf1gS3rJzu7icBEeTtvgjG36EO4eizz-vZDVrp7Cv7jaugVSeYLb4tDhI8c2EDNNV80s0uPW2ef5TVQhXTnHebLVzfDfMGMgGwF5y8jMvkoWSdwmc/s1600/img_tutorial1.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Abbildung 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b&gt;Schritt 3:&lt;/b&gt; in der Klasse &lt;code&gt;View&lt;/code&gt; müssen alle inneren Klassen und Attribute gelöscht werden. Der Inhalt der Methoden &lt;code&gt;createPartControl&lt;/code&gt; und &lt;code&gt;setFocus &lt;/code&gt;sollte ebenfalls gelöscht werden. Der Inhalt der Methode &lt;code&gt;createPartControl &lt;/code&gt;wird mit dem Inhalt wie im Programmauszug 1 ersetzt.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.part.ViewPart;

public class View extends ViewPart {
  public static final String ID = 
               &quot;com.blogspot.javadingsda.testimageregistry.view&quot;;

  public void createPartControl(Composite parent) {
    &lt;span style=&quot;color: red;&quot;&gt;GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    parent.setLayout(layout);

    ImageRegistry reg = Activator.getDefault().getImageRegistry();

    Label label = new Label(parent, SWT.NONE);
    GridData gridData = new GridData();
    label.setData(gridData);
    label.setImage(reg.get(&quot;testpic&quot;));

    label = new Label(parent, SWT.NONE);
    gridData = new GridData();
    label.setData(gridData);
    label.setImage(reg.get(&quot;testpic2&quot;));

    label = new Label(parent, SWT.NONE);
    gridData = new GridData();
    label.setData(gridData);
    label.setImage(reg.get(&quot;testpic3&quot;));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;  }

  public void setFocus() {}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i style=&quot;font-family: inherit;&quot;&gt;Programmauszug 1 &lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Schritt 4:&lt;/b&gt; das Laden der Bilder in die &lt;code&gt;ImagerRegistry&lt;/code&gt; kann an beliebiger Stelle erfolgen. Es sollte nur vor der ersten Verwendung erfolgen. Wir entscheiden und dies in der &lt;code&gt;Perspective&lt;/code&gt; Klasse zu tun. Programmauszug 2 zeigt die modifizierte Klasse.&lt;br /&gt;
Bei &lt;i&gt;Lösung 1&lt;/i&gt; und &lt;i&gt;Lösung 2&lt;/i&gt; wird das Bild aus dem &lt;i&gt;&lt;code&gt;icons&lt;/code&gt;&lt;/i&gt; Verzeichnis geladen. &lt;i&gt;Lösung 3&lt;/i&gt; läd das Bild aus dem Package in dem sich die &lt;code&gt;View.class &lt;/code&gt;befindet. &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
import java.net.URL;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.osgi.framework.Bundle;

public class Perspective implements IPerspectiveFactory {

  public void createInitialLayout(IPageLayout layout) {
    layout.setEditorAreaVisible(false);
    layout.setFixed(true);

&lt;span style=&quot;color: red;&quot;&gt;    &lt;span style=&quot;color: #cc0000;&quot;&gt;ImageRegistry regystry = 
                     Activator.getDefault().getImageRegistry();
    String pathStr = &quot;icons/alt_window_32.gif&quot;;
    Path path = new Path(pathStr);
&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;
    &lt;span style=&quot;color: #38761d;&quot;&gt;// Lösung 1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;
    Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
    URL url = FileLocator.find(bundle, path, null);
    ImageDescriptor imageDescriptor = 
                    ImageDescriptor.createFromURL(url);
    regystry.put(&quot;testpic&quot;, imageDescriptor);
&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;    &lt;span style=&quot;color: #38761d;&quot;&gt;// Lösung 2&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;
    ImageDescriptor imageDescriptor2 = 
                    Activator.getImageDescriptor(pathStr);
    regystry.put(&quot;testpic2&quot;, imageDescriptor2);
&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;    &lt;span style=&quot;color: #38761d;&quot;&gt;// Lösung 3&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;
    ImageDescriptor imageDescriptor3 = 
       ImageDescriptor.createFromFile(View.class, &quot;alt_window_32.gif&quot;);
    regystry.put(&quot;testpic3&quot;, imageDescriptor3);&lt;/span&gt;&lt;/span&gt;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;Programmauszug 2&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Die gezeigten Beispiele bauen auf folgenden Quellen:&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/goog_171859540&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://http//www.javalobby.org/forums/thread.jspa?threadID=16557&quot;&gt;//http://www.javalobby.org/forums/thread.jspa?threadID=16557&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://http//www.eclipse.org/articles/Article-RCP-2/tutorial2.html&quot;&gt;//http://www.eclipse.org/articles/Article-RCP-2/tutorial2.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://http//www.eclipse.org/articles/Article-Using%20Images%20In%20Eclipse/Using%20Images%20In%20Eclipse.html&quot;&gt;//http://www.eclipse.org/articles/Article-Using%20Images%20In%20Eclipse/Using%20Images%20In%20Eclipse.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://http//www.eclipse.org/articles/Article-SWT-images/graphics-resources.html&quot;&gt;//http://www.eclipse.org/articles/Article-SWT-images/graphics-resources.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/1046442155231465593/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2011/10/eclipse-rcp-bilder-fur-fortgeschrittene.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/1046442155231465593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/1046442155231465593'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2011/10/eclipse-rcp-bilder-fur-fortgeschrittene.html' title='Eclipse RCP - Bilder laden und verwalten für Fortgeschrittene'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLDjh7Tsxr2VqdMkhRw2HllHk4LJLf1gS3rJzu7icBEeTtvgjG36EO4eizz-vZDVrp7Cv7jaugVSeYLb4tDhI8c2EDNNV80s0uPW2ef5TVQhXTnHebLVzfDfMGMgGwF5y8jMvkoWSdwmc/s72-c/img_tutorial1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7494726939005914178.post-8298458712499564320</id><published>2011-10-21T22:35:00.001+02:00</published><updated>2011-10-21T22:49:48.794+02:00</updated><title type='text'>Eclipse RCP / SWT Tabulator Reihenfolge bestimmen</title><content type='html'>Um die Tabulator Reihenfolge zu bestimmen müssen die Referenzen der Widgets in einem Array in der gewünschten Reihenfolge an das Composite übergeben werden, dass die Widgets enthält.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
@Override
public void createPartControl(Composite parent) { 
    ... 
    Button b1 = new Button(parent, SWT.NONE); 
    ... 
    Button b2 = new Button(parent, SWT.NONE); 
    .... 
    Button b3 = new Button(parent, SWT.NONE); 
    ...
    Control[] controls = new Control[] { b2, b1, b3 }; 
    parent.setTabList(controls); 
}
&lt;/code&gt;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://javadingsda.blogspot.com/feeds/8298458712499564320/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://javadingsda.blogspot.com/2011/10/eclipse-rcp-swt-tabulator-reihenfolge.html#comment-form' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8298458712499564320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7494726939005914178/posts/default/8298458712499564320'/><link rel='alternate' type='text/html' href='http://javadingsda.blogspot.com/2011/10/eclipse-rcp-swt-tabulator-reihenfolge.html' title='Eclipse RCP / SWT Tabulator Reihenfolge bestimmen'/><author><name>Adi</name><uri>http://www.blogger.com/profile/11041410139709642450</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>