<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Blog Petals planet</title>
	
	<link>http://planet.petalslink.com</link>
	<description>Deals with Petals ESB, Petals Suite, SOA, PetalsLink...</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:54:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
<image>
<link>http://planet.petalslink.com</link>
<url>http://planete.petalslink.com/home/wp-content/mbp-favicon/favicon.png</url>
<title>Blog Petals planet</title>
</image>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PetalsPlanet" /><feedburner:info uri="petalsplanet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Goodbye PetalsLink, hello JBoss|Red Hat !</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/nuR1O30__gM/</link>
		<comments>http://mickaelistria.wordpress.com/2012/01/31/goodbye-petalslink-hello-jbossred-hat/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 14:54:55 +0000</pubDate>
		<dc:creator>Mickael Istria</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mickaelistria.wordpress.com/?p=311</guid>
		<description><![CDATA[Today is my last day working for PetalsLink. Working for PetalsLink was a quite interesting experience: On the technical side, I enjoyed moving all the XML-based tooling of PetalsStudio to a more powerful EMF-based approach for Petals JBI editor &#8211; for those who don&#8217;t know JBI, it is a standard that allows to define SOA [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mickaelistria.wordpress.com&#38;blog=22721041&#38;post=311&#38;subd=mickaelistria&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today is my last day working for PetalsLink.</p>
<p><img class="aligncenter" title="PetalsLink" src="http://www.petalslink.com/themes/bluemarine/logo.png" alt="" width="240" height="84" /></p>
<p>Working for PetalsLink was a quite interesting experience:</p>
<p>On the technical side, I enjoyed moving all the XML-based tooling of <a href="http://www.petalslink.com/produits/petals-studio">PetalsStudio</a> to a more powerful EMF-based approach for Petals JBI editor &#8211; for those who don&#8217;t know <a href="http://www.jcp.org/en/jsr/detail?id=208">JBI</a>, it is a standard that allows to define SOA artifacts in your ESB. Moving to EMF allowed us to provide better tooling faster, because most of the complexity in manipulating JBI can be removed with very few efforts leveraging <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.5.0/org/eclipse/emf/ecore/util/ExtendedMetaData.html">EMF ExtendedMetaData</a>. That was the first time I faced this part of EMF, and I got pretty impressed of how well it works (working with EMF always gives this impression of &#8220;being well&#8221;). I also improved the ability to plug new JBI components into the Studio, which is a critical point when you have to deal with connectors for almost everything &#8211; Mail, SFTP, Talend, XSLT&#8230;. So that was an interesting challenge in term of conception and development.<br />
Petals Studio was also the pretext to start using <a href="http://git.petalslink.com/">Git</a>, <a href="https://github.com/petalslink/petals-studio">GitHub</a> and <a href="http://www.sonarsource.org/">Sonar</a>. I am pretty happy to have learnt these 3 tools that clearly improved the way I work.</p>
<p>Also, I had the great opportunity to work closely to several Eclipse projects:</p>
<ul>
<li>I could contribute the Tycho build of GMF Tooling, put it on <a href="https://hudson.eclipse.org/hudson/job/tycho-gmp.gmf.tooling/">Hudson</a>, get source moved to <a href="https://git.eclipse.org/c/gmf-tooling/org.eclipse.gmf-tooling.git">Git</a>/mirrored to <a href="https://github.com/eclipse/gmf-tooling">GitHub</a>, improve <a href="http://wiki.eclipse.org/Graphical_Modeling_Framework">wiki</a>&#8230; GMF Tooling is a project I&#8217;ve used for 3 years now and I often saw in it some critical organization points to improve to make it more dynamic in term of development. Working at PetalsLink gave me the opportunity to do what I think was necessary to keep the project healthy. With the help of Michael Golubev, I now think this was an real success.</li>
<li>I could contribute to Nebula the <a href="http://www.eclipse.org/nebula/widgets/treemapper/treemapper.php">TreeMapper</a> widget, which will probably have some very interesting use-cases soon. As I became a committer, I also helped in improving Tycho build and <a href="https://hudson.eclipse.org/hudson/job/nebula.nebula/">CI</a>, nad it seems like the project liked it if we look at the <a href="http://www.eclipse.org/nebula/downloads.php">new p2 update-sites</a>.</li>
<li>I contributed some small improvements to Eclipse BPEL designer, tried (unsuccessfully) to make SWTBot use Tycho, and developed a <a href="http://marketplace.eclipse.org/content/draw2d-preview">useful extension for Draw2d</a>.</li>
</ul>
<p>The only thing I wish I would be able to do here is to push ahead the usage of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=360935">Sonar at Eclipse</a>, at least for GMF Tooling and Nebula.</p>
<p>But I probably learnt even more things from PetalsLink by discovering another company organisation that is very different from what I could experiment before (<a href="http://www.openwide.fr/">OpenWide</a> and <a href="http://www.bonitasoft.com/">BonitaSoft</a>): PetalsLink is focused on the Research about SOA and agility of Systems of Information. It is a wide topic! Petals products are quite good compared to other alternatives in the SOA landscape, but they don&#8217;t meet the success they deserve, it was a bit frustrating for a developer.</p>
<p>I enjoyed working for PetalsLink, all the expectations are fulfilled, so it is time for me to go ahead, to find a new experience, a new team, new challenges, new issues&#8230; I love discovering new things!</p>
<p>That&#8217;s why I&#8217;ll start working for JBoss|Red Hat tomorrow, as part of the team developing <a href="http://www.jboss.org/tools">JBoss Tools</a> and <a href="http://www.jboss.com/products/devstudio/">JBoss Developer Studio</a>.</p>
<p style="text-align:left;"><a href="http://mickaelistria.files.wordpress.com/2012/01/jboss_logo.png"><img class="aligncenter  wp-image-316" title="jboss_logo" src="http://mickaelistria.files.wordpress.com/2012/01/jboss_logo.png?w=253&#038;h=144" alt="" width="253" height="144" /></a></p>
<p style="text-align:left;">I&#8217;ll have the opportunity to work with a great team! My main occupation for the next monthes will be to assist <a href="http://divby0.blogspot.com/">Nick Boldt</a> in making JBoss Tools CI and build infrastructure better and better. I&#8217;d also like to open the road towards efficient QA for JBoss Tools, including -among other- usage of Jacoco and Sonar. Then I&#8217;ll also work on developing nice stuff for some JBoss Tools modules, most probably on the SOA/BPM part.</p>
<p style="text-align:left;">That&#8217;s gonna be a lot of fun! I&#8217;m eager to be tomorrow and actually get started for this new team/employer/project/product/users.</p>
<p style="text-align:left;">Let&#8217;s keep in touch via this blog and <a href="https://twitter.com/#!/mickaelistria">twitter</a> <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mickaelistria.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mickaelistria.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mickaelistria.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mickaelistria.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mickaelistria.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mickaelistria.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mickaelistria.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mickaelistria.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mickaelistria.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mickaelistria.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mickaelistria.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mickaelistria.wordpress.com/311/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mickaelistria.wordpress.com/311/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mickaelistria.wordpress.com/311/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mickaelistria.wordpress.com&amp;blog=22721041&amp;post=311&amp;subd=mickaelistria&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/nuR1O30__gM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mickaelistria.wordpress.com/2012/01/31/goodbye-petalslink-hello-jbossred-hat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://mickaelistria.files.wordpress.com/2012/01/jboss_logo.png" length="" type="" />
<enclosure url="http://www.petalslink.com/themes/bluemarine/logo.png" length="" type="" />
<enclosure url="http://0.gravatar.com/avatar/49c11a0a072a661ef4f43a3ea62fb252?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
		<feedburner:origLink>http://mickaelistria.wordpress.com/2012/01/31/goodbye-petalslink-hello-jbossred-hat/</feedburner:origLink></item>
		<item>
		<title>OW2Con2011 Videos are online</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/bMG3bHoA5UE/</link>
		<comments>http://chamerling.org/2012/01/06/ow2con2011-videos-are-online/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 08:40:50 +0000</pubDate>
		<dc:creator>Christophe Hamerling</dc:creator>
				<category><![CDATA[Christophe Hamerling]]></category>
		<category><![CDATA[ow2]]></category>
		<category><![CDATA[Petals ESB]]></category>
		<category><![CDATA[petalslink]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[bpm]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Cloud computing]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[ow2con]]></category>
		<category><![CDATA[Petals BPM]]></category>
		<category><![CDATA[Software as a service]]></category>

		<guid isPermaLink="false">http://chamerling.org/?p=1446</guid>
		<description><![CDATA[The videos of all the OW2Con2011 have been published to the OW2 Youtube channel. My talk about Petals BPM and The Cloud is also available. You are right, I need to smile more, be less tired and have a demo of the BPM editor working on low resolution displays&#8230; BTW, the demo of the DSB Monitoring &#038; &#8230; <a href="http://chamerling.org/2012/01/06/ow2con2011-videos-are-online/">Lire la suite <span>&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.org&#38;blog=3069558&#38;post=1446&#38;subd=chamerling&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The videos of all the OW2Con2011 have been published to the <a href="http://www.youtube.com/user/channelOW2" >OW2 Youtube channel</a>. My talk about <a title="Back From OW2Con 2011" href="http://chamerling.org/2011/11/28/back-from-ow2con-2011/" >Petals BPM and The Cloud</a> is also available.</p>
<span style="text-align:center; display: block;"><a href="http://chamerling.org/2012/01/06/ow2con2011-videos-are-online/"><img src="http://img.youtube.com/vi/15c2p_1UtAM/2.jpg" alt="" /></a></span>
<p>You are right, I need to smile more, be less tired and have a demo of the BPM editor working on low resolution displays&#8230; BTW, the demo of the <a href="https://github.com/chamerling/dsbmanager-webapp" >DSB Monitoring &amp; Management console</a> used to deploy and monitor BPEL process works.</p>
<br />Classé dans:<a href='http://chamerling.org/category/conference-2/'>Conference</a> Tagged: <a href='http://chamerling.org/tag/bpm/'>bpm</a>, <a href='http://chamerling.org/tag/cloud-2/'>cloud</a>, <a href='http://chamerling.org/tag/cloud-computing/'>Cloud computing</a>, <a href='http://chamerling.org/tag/open-source/'>Open source</a>, <a href='http://chamerling.org/tag/ow2/'>ow2</a>, <a href='http://chamerling.org/tag/ow2con/'>ow2con</a>, <a href='http://chamerling.org/tag/petals/'>PEtALS</a>, <a href='http://chamerling.org/tag/petals-bpm/'>Petals BPM</a>, <a href='http://chamerling.org/tag/petalslink/'>petalslink</a>, <a href='http://chamerling.org/tag/soa/'>SOA</a>, <a href='http://chamerling.org/tag/software-as-a-service/'>Software as a service</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/1446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/1446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/1446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/1446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chamerling.wordpress.com/1446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chamerling.wordpress.com/1446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chamerling.wordpress.com/1446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chamerling.wordpress.com/1446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/1446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/1446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/1446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/1446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/1446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/1446/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.org&amp;blog=3069558&amp;post=1446&amp;subd=chamerling&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/bMG3bHoA5UE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.org/2012/01/06/ow2con2011-videos-are-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://1.gravatar.com/avatar/b6c497af6bc43da74f94095683908ca7?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
		<feedburner:origLink>http://chamerling.org/2012/01/06/ow2con2011-videos-are-online/</feedburner:origLink></item>
		<item>
		<title>Créer un Dégradé autour d’une Image avec The Gimp</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/8RqHWIz23yY/</link>
		<comments>http://vzurczak2.wordpress.com/2012/01/06/creer-un-degrade-autour-dune-image-avec-the-gimp/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 00:43:00 +0000</pubDate>
		<dc:creator>Vincent Zurczak</dc:creator>
				<category><![CDATA[Vincent Zurczak]]></category>
		<category><![CDATA[Général]]></category>
		<category><![CDATA[The Gimp]]></category>

		<guid isPermaLink="false">http://vzurczak2.wordpress.com/?p=176</guid>
		<description><![CDATA[Salut. Voilà un rapide tutoriel pour vous apprendre à créer un dégradé (circulaire) autour d&#8217;une image. Le but est de mettre en valeur le centre ou une partie de l&#8217;image et d&#8217;atténuer les bords. Et j&#8217;en fais un article parce que j&#8217;ai passé une grosse demi-heure à chercher comment faire, que ce soit sur le [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak2.wordpress.com&#38;blog=16811662&#38;post=176&#38;subd=vzurczak2&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Salut.</p>
<p>Voilà un rapide tutoriel pour vous apprendre à créer un dégradé (circulaire) autour d&#8217;une image. Le but est de mettre en valeur le centre ou une partie de l&#8217;image et d&#8217;atténuer les bords. Et j&#8217;en fais un article parce que j&#8217;ai passé une grosse demi-heure à chercher comment faire, que ce soit sur le net et en bidouillant dans The Gimp.</p>
<p>Voilà ce à quoi on veut arriver :</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-1.jpg" title="Pour les curieux, la pile de bois culmine à 3 mètres au-dessus du sol"><img class="aligncenter size-medium wp-image-177" title="Pour les curieux, la pile de bois culmine à 3 mètres au-dessus du sol" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-1.jpg?w=300&#038;h=282" alt="Un chat sur une pile de bois..." width="300" height="282" /></a></p>
<p>On commence par ouvrir notre image de départ avec The Gimp.<br />
Afin de ne pas pourrir l&#8217;originale, on duplique l&#8217;image (menu <strong>Image &gt; Dupliquer</strong>).<br />
Rajoutez un calque et le remplir de la couleur ou du motif à utiliser. Dans cet exemple, je vais utiliser un fond noir. Laissez ce deuxième calque au-dessus de l&#8217;autre.</p>
<p>Assurez-vous que le 2ème calque est bien sélectionné (c&#8217;est important), puis ajoutez-lui un masque de calque (menu <strong>Calque &gt; Masque &gt; Ajouter un masque de calque&#8230;</strong>). Une boite de dialogue apparaît : choisissez <strong>Noir (transparence totale)</strong>.</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-2.jpg"><img class="aligncenter size-medium wp-image-178" title="The-Gimp--Degrade-Autour-Image--2" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-2.jpg?w=243&#038;h=300" alt="Ajout d'un masque de calque" width="243" height="300" /></a><br />
Dans la fenêtre des calques, vous devriez donc voir&#8230;</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-3.jpg"><img class="aligncenter size-medium wp-image-179" title="The-Gimp--Degrade-Autour-Image--3" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-3.jpg?w=212&#038;h=300" alt="Les calques, après rajout d'un masque de calque" width="212" height="300" /></a></p>
<p>Sélectionnez maintenant l&#8217;outil <strong>Dégradé</strong>, <strong>PP vers AP (RGB)</strong> et une forme <strong>radiale</strong>.</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-6.jpg"><img class="aligncenter size-medium wp-image-182" title="The-Gimp--Degrade-Autour-Image--6" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-6.jpg?w=172&#038;h=300" alt="Selection de l'outil Dégradé" width="172" height="300" /></a><br />
Dans la fenêtre des calques, assurez-vous que le 2ème calque (noir ici) est bien sélectionné, et que le focus est sur le masque de calque (en gros, vous cliquez sur le carré à droite dans le calque). Allez maintenant sur votre image et dessinez un cercle qui donnera le focus à la partie de l&#8217;image que vous voulez valoriser. Pour <a href="http://docs.gimp.org/fr/gimp-tool-blend.html">rappel</a>, l&#8217;outil dégradé en mode radial prend 2 points : le premier clic détermine le centre du cercle, et le deuxème permet de définir un rayon.</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-4.jpg"><img class="aligncenter size-medium wp-image-180" title="The-Gimp--Degrade-Autour-Image--4" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-4.jpg?w=300&#038;h=241" alt="La photo du chat, avant découpe" width="300" height="241" /></a></p>
<p>Miracle, ça marche&#8230; Même s&#8217;il vous faudra peut-être plusieurs essais pour arriver au bon réglage.<br />
Dans les calques, le dégradé apparaît sur le masque de calque (que vous aviez sélectionné avant).</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-5.jpg"><img class="aligncenter size-full wp-image-181" title="The-Gimp--Degrade-Autour-Image--5" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-5.jpg?w=600" alt="Les calques, avec le dégradé visible sur le masque"   /></a></p>
<p>Après, il vous suffit de redécouper l&#8217;image pour dégager les bords superflus.<br />
Notez que ça marche bien pour les sélections circulaires. Pour d&#8217;autres formes, on peut jouer avec d&#8217;autres dégradés, ou bien travailler / déformer le calque avec le dégradé (par exemple pour arriver à une ellipse au lieu d&#8217;un cercle). Et j&#8217;ai bien dit <em>travailler le calque</em>, pas l&#8217;image.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vzurczak2.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak2.wordpress.com&amp;blog=16811662&amp;post=176&amp;subd=vzurczak2&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/8RqHWIz23yY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vzurczak2.wordpress.com/2012/01/06/creer-un-degrade-autour-dune-image-avec-the-gimp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://0.gravatar.com/avatar/45cf3bb2253fd4285acb0cfeba915a18?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-1.jpg?w=300" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-2.jpg?w=243" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-3.jpg?w=212" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-6.jpg?w=172" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-4.jpg?w=300" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-5.jpg" length="" type="" />
		<feedburner:origLink>http://vzurczak2.wordpress.com/2012/01/06/creer-un-degrade-autour-dune-image-avec-the-gimp/</feedburner:origLink></item>
		<item>
		<title>Créer un Dégradé autour d’une Image avec The Gimp</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/8RqHWIz23yY/</link>
		<comments>http://vzurczak2.wordpress.com/2012/01/06/creer-un-degrade-autour-dune-image-avec-the-gimp/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 00:43:00 +0000</pubDate>
		<dc:creator>Vincent Zurczak</dc:creator>
				<category><![CDATA[Vincent Zurczak]]></category>
		<category><![CDATA[Général]]></category>
		<category><![CDATA[The Gimp]]></category>

		<guid isPermaLink="false">http://vzurczak2.wordpress.com/?p=176</guid>
		<description><![CDATA[Salut. Voilà un rapide tutoriel pour vous apprendre à créer un dégradé (circulaire) autour d&#8217;une image. Le but est de mettre en valeur le centre ou une partie de l&#8217;image et d&#8217;atténuer les bords. Et j&#8217;en fais un article parce que j&#8217;ai passé une grosse demi-heure à chercher comment faire, que ce soit sur le [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak2.wordpress.com&#38;blog=16811662&#38;post=176&#38;subd=vzurczak2&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Salut.</p>
<p>Voilà un rapide tutoriel pour vous apprendre à créer un dégradé (circulaire) autour d&#8217;une image. Le but est de mettre en valeur le centre ou une partie de l&#8217;image et d&#8217;atténuer les bords. Et j&#8217;en fais un article parce que j&#8217;ai passé une grosse demi-heure à chercher comment faire, que ce soit sur le net et en bidouillant dans The Gimp.</p>
<p>Voilà ce à quoi on veut arriver :</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-1.jpg" title="Pour les curieux, la pile de bois culmine à 3 mètres au-dessus du sol"><img class="aligncenter size-medium wp-image-177" title="Pour les curieux, la pile de bois culmine à 3 mètres au-dessus du sol" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-1.jpg?w=300&#038;h=282" alt="Un chat sur une pile de bois..." width="300" height="282" /></a></p>
<p>On commence par ouvrir notre image de départ avec The Gimp.<br />
Afin de ne pas pourrir l&#8217;originale, on duplique l&#8217;image (menu <strong>Image &gt; Dupliquer</strong>).<br />
Rajoutez un calque et le remplir de la couleur ou du motif à utiliser. Dans cet exemple, je vais utiliser un fond noir. Laissez ce deuxième calque au-dessus de l&#8217;autre.</p>
<p>Assurez-vous que le 2ème calque est bien sélectionné (c&#8217;est important), puis ajoutez-lui un masque de calque (menu <strong>Calque &gt; Masque &gt; Ajouter un masque de calque&#8230;</strong>). Une boite de dialogue apparaît : choisissez <strong>Noir (transparence totale)</strong>.</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-2.jpg"><img class="aligncenter size-medium wp-image-178" title="The-Gimp--Degrade-Autour-Image--2" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-2.jpg?w=243&#038;h=300" alt="Ajout d'un masque de calque" width="243" height="300" /></a><br />
Dans la fenêtre des calques, vous devriez donc voir&#8230;</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-3.jpg"><img class="aligncenter size-medium wp-image-179" title="The-Gimp--Degrade-Autour-Image--3" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-3.jpg?w=212&#038;h=300" alt="Les calques, après rajout d'un masque de calque" width="212" height="300" /></a></p>
<p>Sélectionnez maintenant l&#8217;outil <strong>Dégradé</strong>, <strong>PP vers AP (RGB)</strong> et une forme <strong>radiale</strong>.</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-6.jpg"><img class="aligncenter size-medium wp-image-182" title="The-Gimp--Degrade-Autour-Image--6" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-6.jpg?w=172&#038;h=300" alt="Selection de l'outil Dégradé" width="172" height="300" /></a><br />
Dans la fenêtre des calques, assurez-vous que le 2ème calque (noir ici) est bien sélectionné, et que le focus est sur le masque de calque (en gros, vous cliquez sur le carré à droite dans le calque). Allez maintenant sur votre image et dessinez un cercle qui donnera le focus à la partie de l&#8217;image que vous voulez valoriser. Pour <a href="http://docs.gimp.org/fr/gimp-tool-blend.html">rappel</a>, l&#8217;outil dégradé en mode radial prend 2 points : le premier clic détermine le centre du cercle, et le deuxème permet de définir un rayon.</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-4.jpg"><img class="aligncenter size-medium wp-image-180" title="The-Gimp--Degrade-Autour-Image--4" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-4.jpg?w=300&#038;h=241" alt="La photo du chat, avant découpe" width="300" height="241" /></a></p>
<p>Miracle, ça marche&#8230; Même s&#8217;il vous faudra peut-être plusieurs essais pour arriver au bon réglage.<br />
Dans les calques, le dégradé apparaît sur le masque de calque (que vous aviez sélectionné avant).</p>
<p><a href="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-5.jpg"><img class="aligncenter size-full wp-image-181" title="The-Gimp--Degrade-Autour-Image--5" src="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-5.jpg?w=600" alt="Les calques, avec le dégradé visible sur le masque"   /></a></p>
<p>Après, il vous suffit de redécouper l&#8217;image pour dégager les bords superflus.<br />
Notez que ça marche bien pour les sélections circulaires. Pour d&#8217;autres formes, on peut jouer avec d&#8217;autres dégradés, ou bien travailler / déformer le calque avec le dégradé (par exemple pour arriver à une ellipse au lieu d&#8217;un cercle). Et j&#8217;ai bien dit <em>travailler le calque</em>, pas l&#8217;image.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vzurczak2.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vzurczak2.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vzurczak2.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak2.wordpress.com&amp;blog=16811662&amp;post=176&amp;subd=vzurczak2&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/8RqHWIz23yY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vzurczak2.wordpress.com/2012/01/06/creer-un-degrade-autour-dune-image-avec-the-gimp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://0.gravatar.com/avatar/45cf3bb2253fd4285acb0cfeba915a18?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-1.jpg?w=300" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-2.jpg?w=243" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-3.jpg?w=212" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-6.jpg?w=172" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-4.jpg?w=300" length="" type="" />
<enclosure url="http://vzurczak2.files.wordpress.com/2012/01/the-gimp-degrade-autour-image-5.jpg" length="" type="" />
		<feedburner:origLink>http://vzurczak2.wordpress.com/2012/01/06/creer-un-degrade-autour-dune-image-avec-the-gimp/</feedburner:origLink></item>
		<item>
		<title>Git, Patches and new Contributors</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/eIu5gFFTxZo/</link>
		<comments>http://vzurczak.wordpress.com/2012/01/05/git-patches-new-contributors/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 21:51:41 +0000</pubDate>
		<dc:creator>Vincent Zurczak</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Diff files]]></category>
		<category><![CDATA[Eclipse contributions]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Paches]]></category>

		<guid isPermaLink="false">http://vzurczak.wordpress.com/?p=325</guid>
		<description><![CDATA[I have recently committed in the Eclipse BPEL Designer some patches that were contributed in our Bugzilla. This fact itself is not important. However, I used the Git command apply and kept the author name in the commit. I had never used this feature before, but it is extremely powerful. And very convenient to track [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak.wordpress.com&#38;blog=10081016&#38;post=325&#38;subd=vzurczak&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have recently committed in the Eclipse BPEL Designer some patches that were contributed in our Bugzilla. This fact itself is not important. However, I used the Git command <strong>apply</strong> and kept the author name in the commit. I had never used this feature before, but it is extremely powerful. And very convenient to <strong>track activities and propose new committers on a project</strong>.</p>
<p>I let some traces in this article (as an example and for me, for later).<br />
Notice that the <strong>apply</strong> command did not work with EGit, I had to use the command line. I guess it will be fixed in a future version.</p>
<ul>
<li>First, we need a patch, given as a diff file, e.g. in <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=357512">a bug entry</a>.</li>
<li>As a committer, you should apply and check this patch. So, you first need to copy the patch in your (cloned) Git repository.</li>
<li>Get some stats about the patch :
<pre><em>git apply --stat myPatchFile</em></pre>
</li>
</ul>
<ul>
<li>Make sure the patch can be applied :
<pre><em>git apply --check myPatchFile</em></pre>
</li>
</ul>
<ul>
<li>Apply the patch :
<pre><em>git apply myPatchFile</em></pre>
</li>
</ul>
<ul>
<li>Delete the patch file.</li>
</ul>
<p>Then, you can check that the patch works and then commit it, before pushing the modification.<br />
One important thing is to keep the author&#8217;s name in the commit. The author and the committer are different. And both can be kept in the commit and in the history. Here is an example in the command line:</p>
<blockquote>
<pre>git commit -a --author="authorUsername &lt;author.mail.address@sth.com&gt;"</pre>
</blockquote>
<p>After the push, both the author and commiter names will appear in the repository.</p>
<p><a href="http://vzurczak.files.wordpress.com/2012/01/git-patches.jpg"><img class="alignnone size-medium wp-image-326" title="Git-Patches" src="http://vzurczak.files.wordpress.com/2012/01/git-patches.jpg?w=300&#038;h=61" alt="The author and committer names appear in the history" width="300" height="61" /></a></p>
<p>I don&#8217;t know if everyone in Eclipse projects uses this feature, but from the community perspective, this is very interesting (IMO).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vzurczak.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vzurczak.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vzurczak.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vzurczak.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vzurczak.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vzurczak.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vzurczak.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vzurczak.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vzurczak.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vzurczak.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vzurczak.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vzurczak.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vzurczak.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vzurczak.wordpress.com/325/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak.wordpress.com&amp;blog=10081016&amp;post=325&amp;subd=vzurczak&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/eIu5gFFTxZo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vzurczak.wordpress.com/2012/01/05/git-patches-new-contributors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://vzurczak.files.wordpress.com/2012/01/git-patches.jpg?w=300" length="" type="" />
<enclosure url="http://0.gravatar.com/avatar/45cf3bb2253fd4285acb0cfeba915a18?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
		<feedburner:origLink>http://vzurczak.wordpress.com/2012/01/05/git-patches-new-contributors/</feedburner:origLink></item>
		<item>
		<title>Enhanced Tabs thanks to ScrolledPageBook</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/HNBPTv2h_YY/</link>
		<comments>http://vzurczak.wordpress.com/2012/01/04/enhanced-tabs-thanks-to-scrolledpagebook/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 21:49:45 +0000</pubDate>
		<dc:creator>Vincent Zurczak</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java tips]]></category>
		<category><![CDATA[Scrolled Page Book]]></category>
		<category><![CDATA[SWT]]></category>
		<category><![CDATA[Tabs]]></category>

		<guid isPermaLink="false">http://vzurczak.wordpress.com/?p=312</guid>
		<description><![CDATA[With SWT, tab folders are a way to integrate in a same container several widgets. However, it appears to be quite limited in terms of design and creativity. I here propose some alternatives for sexier user interfaces. Tab Folder This is our witness section. Here is a snippet (the full code is avilable at the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak.wordpress.com&#38;blog=10081016&#38;post=312&#38;subd=vzurczak&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With SWT, <a href="http://www.eclipse.org/swt/widgets/">tab folders</a> are a way to integrate in a same container several widgets. However, it appears to be quite limited in terms of design and creativity. I here propose some alternatives for sexier user interfaces.</p>
<h2>Tab Folder</h2>
<p>This is our witness section.<br />
Here is a snippet (the full code is avilable at the end of the article)&#8230;</p>
<p><pre class="brush: java;">public void createTabs( Composite parent ) {

	final TabFolder tabFolder = new TabFolder( parent, SWT.NONE );
	tabFolder.setLayoutData( new GridData( GridData.FILL_BOTH ));

	for( int i=0; i&lt;=4; i++) {
		TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
		tabItem.setText( &quot;Item &quot; + i );
		tabItem.setControl( createTabContent( tabFolder ));
	}
}

private Composite createTabContent( Composite parent ) {

	Composite c = new Composite( parent, SWT.NONE );
	c.setLayout( new GridLayout( 2, false ));
	String[] properties = { &quot;First Name:&quot;, &quot;Last Name:&quot;, &quot;Nick Name:&quot; };

	for( String property : properties ) {
		new Label( c, SWT.NONE ).setText( property );
		new Text( c, SWT.SINGLE | SWT.BORDER ).setLayoutData( new GridData( GridData.FILL_HORIZONTAL ));
	}

	return c;
}</pre></p>
<p>And here is a screenshot.</p>
<p><a href="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-tabfolder.jpg"><img class="alignnone size-medium wp-image-313" title="Enhanced-Tabs-thanks-to-ScrolledPageBook--TabFolder" src="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-tabfolder.jpg?w=300&#038;h=203" alt="An example with a Tab folder" width="300" height="203" /></a></p>
<p>As you can see, everything is centered, except the tabs.<br />
And that&#8217;s not cool at all.</p>
<h2>Custom Tab Folder</h2>
<p>The <a href="http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/custom/CTabFolder.html">CTabFolder class</a> is a little more powerful, but similar limitations appear quickly. It is not possible to center the tabs. And they are either above or below the content, never on side.</p>
<p><a href="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-ctabfolder.jpg"><img class="alignnone size-medium wp-image-314" title="Enhanced-Tabs-thanks-to-ScrolledPageBook--CTabFolder" src="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-ctabfolder.jpg?w=300&#038;h=201" alt="An example with a CTab folder" width="300" height="201" /></a></p>
<p><pre class="brush: java;">public void createTabs( Composite parent ) {

	final CTabFolder tabFolder = new CTabFolder( parent, SWT.BORDER );
	tabFolder.setLayoutData( new GridData( GridData.FILL_BOTH ));
	tabFolder.setSimple( false );

	for( int i=0; i&lt;=4; i++ ) {
		CTabItem tabItem = new CTabItem( tabFolder, SWT.NONE );
		tabItem.setText( &quot; Item &quot; + i + &quot; &quot; );
		tabItem.setControl( createTabContent( tabFolder ));
	}
}</pre></p>
<p>Note that you can <a href="http://www.java2s.com/Tutorial/Java/0280__SWT/AddImagetoCTabFolder.htm">add images</a> on the tab.</p>
<h2>Scrolled Page Book</h2>
<p>An alternative to these classes is <a href="http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/forms/widgets/ScrolledPageBook.html">ScrolledPageBook</a>.<br />
It can be used in Eclipse plugins, but also in standalone applications. In addition to SWT bundles, you only have to add <strong>org.eclipse.ui.forms</strong> to your classpath. No need to be in a form to use it.</p>
<p>Let&#8217;s see a first illustration, with navigation labels and not (yet) tabs.<br />
The principle is simple: you have a set of labels and a scrolled page book. When the user clicks on a label, we change the displayed page in the book.</p>
<p><pre class="brush: java;">public void createTabs( Composite parent ) {

	// Add the container for navigation labels
	final int tabCpt = 5;
	Composite container = new Composite( parent, SWT.NONE );
	container.setLayout( new GridLayout( tabCpt, true ));
	container.setLayoutData( new GridData( SWT.CENTER, SWT.DEFAULT, true, false ));

	// Add the page book
	final ScrolledPageBook pageBook = new ScrolledPageBook( parent );
	pageBook.setLayoutData( new GridData( GridData.FILL_BOTH ));

	// The listener when the user clicks on a &quot;tab&quot;
	Listener listener = new Listener() {
		@Override
		public void handleEvent( Event event ) {
			pageBook.showPage( event.widget.getData());
		}
	};

	// Register the pages and bind it all
	for( int i=0; i&lt;=4; i++ ) {
		Label l = new Label( container, SWT.BORDER );
		l.setText( &quot;Item &quot; + i );
		l.setData( i );

		pageBook.registerPage( i, createTabContent( pageBook.getContainer(), i ));
		l.addListener( SWT.MouseDown, listener );
	}

	// Force to display the first tab
	pageBook.showPage( 0 );
}</pre></p>
<p>And here is a preview.</p>
<p><a href="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-simple-scrolledpagebook.jpg"><img class="alignnone size-medium wp-image-315" title="Enhanced-Tabs-thanks-to-ScrolledPageBook--Simple-ScrolledPageBook" src="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-simple-scrolledpagebook.jpg?w=300&#038;h=202" alt="A first try with a scrolled page book" width="300" height="202" /></a></p>
<p>Ugly, isn&#8217;t it?<br />
But we can fix it.</p>
<h2>Tabs with a Scrolled Page Book</h2>
<p>To have a real tab&#8217;s look &amp; feel, we have to reduce the margin between the content and the labels. We also need make our labels look better. Partial borders will be added around the labels thanks to a paint listener.</p>
<p><a href="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-tabs-with-scrolledpagebook.jpg"><img class="alignnone size-medium wp-image-316" title="Enhanced-Tabs-thanks-to-ScrolledPageBook--Tabs-With-ScrolledPageBook" src="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-tabs-with-scrolledpagebook.jpg?w=300&#038;h=200" alt="Tabs with a scrolled page book" width="300" height="200" /></a></p>
<p>Here is the code (it&#8217;s a little bit longer than before).</p>
<p><pre class="brush: java;">/**
 * Remember the selected index.
 */
private Integer selectedIndex = 0;

/**
 * Creates the tabs.
 * @param parent the parent
 */
public void createTabs( Composite parent ) {
		
	// Add the container for navigation labels
	final int tabCpt = 5;
	Composite container = new Composite( parent, SWT.NONE );
	GridLayout layout = new GridLayout( tabCpt, true );
	layout.marginHeight = 0;
	container.setLayout( layout );
	container.setLayoutData( new GridData( SWT.CENTER, SWT.DEFAULT, true, false ));
		
	// Add the page book
	final ScrolledPageBook pageBook = new ScrolledPageBook( parent );
	pageBook.setLayoutData( new GridData( GridData.FILL_BOTH ));
		
	// The listener when the user clicks on a &quot;tab&quot;
	final List&lt;Label&gt; navigationLabels = new ArrayList&lt;Label&gt; ();
	Listener listener = new Listener() {
		@Override
		public void handleEvent( Event event ) {
			pageBook.showPage( event.widget.getData());
				
			// Remember the last selected index
			TabsWithScrolledPageBookSnippet.this.selectedIndex = (Integer) event.widget.getData();
			
			// Highlight the selected tab
			for( Label l : navigationLabels ) {
				Color color;
				if( l != event.widget &amp;&amp; l.getParent() != event.widget )
					color = Display.getDefault().getSystemColor( SWT.COLOR_WIDGET_BACKGROUND );
				else
					color = Display.getDefault().getSystemColor( SWT.COLOR_WHITE );
					
				l.setBackground( color );
				l.getParent().setBackground( color );
			}
		}
	};
		
	// The paint listener, to paint partial borders
	PaintListener paintListener = new PaintListener() {
		@Override
		public void paintControl( PaintEvent event ) {
			
			Color color;
			if( TabsWithScrolledPageBookSnippet.this.selectedIndex.equals( event.widget.getData()))
				color = Display.getDefault().getSystemColor( SWT.COLOR_GRAY );
			else
				color = Display.getDefault().getSystemColor( SWT.COLOR_WIDGET_DARK_SHADOW );
				
			Rectangle rect = ((Composite) event.widget).getBounds();
			event.gc.setForeground( color );
			event.gc.setAntialias( SWT.ON );
			event.gc.drawLine( 0, 0, rect.width - 1, 0 );
			event.gc.drawLine( 0, 0, 0, rect.height - 1 );
			event.gc.drawLine( rect.width - 1, 0, rect.width - 1, rect.height - 1 );
		}
	};
		
	// Register the pages and bind it all
	for( int i=0; i&lt;tabCpt; i++ ) {
		Label l = createTabLabel( i, container, paintListener, listener );
		navigationLabels.add( l );
		pageBook.registerPage( i, createTabContent( pageBook.getContainer(), i ));
	}
		
	// Force to display the first tab (and force it to be highlighted)
	navigationLabels.get( 0 ).notifyListeners( SWT.MouseDown, new Event());
}
	
	
/**
 * Creates a label for the tab (wrapped in a composite for better display).
 * @param index the tab index
 * @param parent the container for the label
 * @param paintListener the paint listener for the label's container (to paint partial borders)
 * @param mouseDownListener the listener for when a tab is selected
 * @return the created label
 */
private Label createTabLabel( int index, Composite parent, PaintListener paintListener, Listener mouseDownListener ) {
	
	// Wrap the labels in a composite
	Composite c = new Composite( parent, SWT.NONE );
	c.setLayout( new GridLayout());
	c.setLayoutData( new GridData( 80, 25 ));
	c.setData( index );

	// To paint partial borders
	c.addPaintListener( paintListener );

	// Deal with the content
	Label l = new Label( c, SWT.NONE );
	l.setLayoutData( new GridData( SWT.CENTER, SWT.CENTER, true, true ));
	l.setText( &quot;Item &quot; + index );
	l.setData( index );

	// The click listener
	l.addListener( SWT.MouseDown, mouseDownListener );
	c.addListener( SWT.MouseDown, mouseDownListener );

	return l;
}</pre></p>
</pre>
<h2>Horizontal Tabs</h2>
<p>By playing with the previous example, we can also obtain a result similar to the Eclipse tabbed properties. In the following example, the navigation labels are placed on the left of the content. I hardly changed the code (about 10 lines, it is just about the layout).</p>
<p><a href="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-other-tabs-with-scrolledpagebook.jpg"><img class="alignnone size-medium wp-image-317" title="Enhanced-Tabs-thanks-to-ScrolledPageBook--Other-Tabs-With-ScrolledPageBook" src="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-other-tabs-with-scrolledpagebook.jpg?w=300&#038;h=203" alt="Another illustration of tabs implemented with a scrolled page book" width="300" height="203" /></a></p>
<p>The code is available in the archive below.</p>
<h2>Conclusion</h2>
<p>I hope these snippets (and screenshots) will help some of you.<br />
They also illustrate the use of the Scrolled Page Book class. Obviously, this could be used to create a custom and reusable widget (as an example shared in the <a href="http://eclipse.org/nebula/">Nebula project</a>). No need to say that it would be more simple with a HTML and CSS approach. <a href="http://www.eclipse.org/e4/">E4</a> may help in such an approach.</p>
<p>The complete source code for the snippets is available in <a title="The source code" href="http://www.mediafire.com/?s0arjgxybwwewj6">this archive</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vzurczak.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vzurczak.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vzurczak.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vzurczak.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vzurczak.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vzurczak.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vzurczak.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vzurczak.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vzurczak.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vzurczak.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vzurczak.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vzurczak.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vzurczak.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vzurczak.wordpress.com/312/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak.wordpress.com&amp;blog=10081016&amp;post=312&amp;subd=vzurczak&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/HNBPTv2h_YY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vzurczak.wordpress.com/2012/01/04/enhanced-tabs-thanks-to-scrolledpagebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-simple-scrolledpagebook.jpg?w=300" length="" type="" />
<enclosure url="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-tabs-with-scrolledpagebook.jpg?w=300" length="" type="" />
<enclosure url="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-ctabfolder.jpg?w=300" length="" type="" />
<enclosure url="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-tabfolder.jpg?w=300" length="" type="" />
<enclosure url="http://0.gravatar.com/avatar/45cf3bb2253fd4285acb0cfeba915a18?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
<enclosure url="http://vzurczak.files.wordpress.com/2012/01/enhanced-tabs-thanks-to-scrolledpagebook-other-tabs-with-scrolledpagebook.jpg?w=300" length="" type="" />
		<feedburner:origLink>http://vzurczak.wordpress.com/2012/01/04/enhanced-tabs-thanks-to-scrolledpagebook/</feedburner:origLink></item>
		<item>
		<title>Detecting New Images in the Clipboard</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/8ujdQJj6pA0/</link>
		<comments>http://vzurczak.wordpress.com/2011/12/20/detecting-new-images-in-the-clipboard/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 21:13:17 +0000</pubDate>
		<dc:creator>Vincent Zurczak</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[clipboard monitor]]></category>
		<category><![CDATA[clipboard poller]]></category>
		<category><![CDATA[clipboard watcher]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[Java tips]]></category>

		<guid isPermaLink="false">http://vzurczak.wordpress.com/?p=303</guid>
		<description><![CDATA[I have 2 applications that should work together. These applications are end-user applications. The link between them is in fact the system&#8217;s clipboard (this is a Windows 7&#8242;s use case, but it might be encountered on other platforms). Basically, the idea is that the user selects an image in the first application and copies it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak.wordpress.com&#38;blog=10081016&#38;post=303&#38;subd=vzurczak&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have 2 applications that should work together.<br />
These applications are end-user applications. The link between them is in fact the system&#8217;s clipboard (this is a Windows 7&#8242;s use case, but it might be encountered on other platforms). Basically, the idea is that the user selects an image in the first application and copies it in the clipboard. The second application should detect this new image and process it.</p>
<p>By browsing the web, I found out that there is no perfect solution. Sun did not provide a complete solution for this in Java because there were portability issues. One alternative was to use the <em>ava.awt.datatransfer.ClipboardOwner</em> class. A subclass instance acquires the ownership of the clipboard by putting something into it. When another application copies something into the clipboard, the previous owner is notified that it has lost the ownership. The implementation would be something like:</p>
<p><pre class="brush: java;">public class ClipboardWatcher implements ClipboardOwner {

	/**
	 * @see java.awt.datatransfer.ClipboardOwner
	 * #lostOwnership(java.awt.datatransfer.Clipboard, java.awt.datatransfer.Transferable)
	 */
	@Override
	public void lostOwnership( Clipboard clipboard, Transferable contents ) {
		// Get the clipboard's content and process it if required
		// ...

		// Acquire the ownership again by putting the same content
		// (Same content because otherwise, copy/paste does not work anymore for other applications)
		// ...
	}
}</pre></p>
<p>This is not very convenient.<br />
I also discovered it was not working very well when there are several running applications.<br />
So, I implemented a solution with a thread which polls the clipboard regularly. I put here a complete sample with an example of image processing.</p>
<p><pre class="brush: java;">import java.awt.Image;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

import javax.imageio.ImageIO;

/**
 * @author Vincent Zurczak
 */
public class ClipboardWatcher implements ClipboardOwner {
	
	static final File PREVIEW_DIRECTORY = new File( System.getProperty( &quot;java.io.tmpdir&quot; ), &quot;Image-Store&quot; );
	private final List&lt;PreviewFileListener&gt; listeners;
	private final SimpleDateFormat sdf;
	private final AtomicBoolean run;
	
	
	/**
	 * Constructor.
	 */
	public ClipboardWatcher() {
		 this.listeners = new ArrayList&lt;PreviewFileListener&gt; ();
		 this.sdf = new SimpleDateFormat( &quot;yy-MM-dd---HH-mm-ss&quot; );
		 this.run = new AtomicBoolean( true );
		 
		 if( ! PREVIEW_DIRECTORY.exists()
				 &amp;&amp; ! PREVIEW_DIRECTORY.mkdir()) {
			 // TODO: process this case in a better way
			 System.out.println( &quot;The preview directory could not be created.&quot; );
		 }
	}
	
	
	/**
	 * @param e
	 * @return
	 * @see java.util.List#add(java.lang.Object)
	 */
	public boolean addPreviewFileListener( PreviewFileListener e ) {
		synchronized( this.listeners ) {
			return this.listeners.add( e );
		}
	}


	/**
	 * @param o
	 * @return
	 * @see java.util.List#remove(java.lang.Object)
	 */
	public boolean removePreviewFileListener( PreviewFileListener o ) {
		synchronized( this.listeners ) {
			return this.listeners.remove( o );
		}
	}
	
	
	/**
	 * @see java.awt.datatransfer.ClipboardOwner
	 * #lostOwnership(java.awt.datatransfer.Clipboard, java.awt.datatransfer.Transferable)
	 */
	@Override
	public void lostOwnership( Clipboard clipboard, Transferable contents ) {
		// Acquire the ownership again is not working very well for a periodic check
	}
	
	
	/**
	 * Starts polling the clipboard.
	 */
	public void start() {
		
		// Define the polling delay
		final int pollDelay = 5000;
		
		// Create the runnable
		Runnable runnable = new Runnable() {
			@Override
			public void run() {
				
				Transferable contents = null;
				while( ClipboardWatcher.this.run.get()) {
					
					// Get the clipboard's content
					Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
					try {
						contents = clipboard.getContents( null );
						if ( contents == null 
								|| ! contents.isDataFlavorSupported( DataFlavor.imageFlavor ))
							continue;
						
						Image img = (Image) clipboard.getData( DataFlavor.imageFlavor );
						saveClipboardImage( img );
						clipboard.setContents( new StringSelection( &quot;The clipboard watcher was here!&quot; ), ClipboardWatcher.this );
						
					} catch( UnsupportedFlavorException ex ) {
						ex.printStackTrace();

					} catch( IOException ex ) {
						ex.printStackTrace();
						
					} catch( Exception e1 ) {
						// We get here if we could not get the clipboard's content
						continue;
					
					} finally {						
					
						try {
							Thread.sleep( pollDelay );
							
						} catch( InterruptedException e ) {
							e.printStackTrace();
						}
					}
				}
			}
		};
		
		// Run it in a thread
		Thread thread = new Thread( runnable );
		thread.start();
	}
	
	
	/**
	 * Stops listening.
	 */
	public void stop() {
		this.run.set( false );
	}
	

	/**
	 * Saves the image residing on the clip board.
	 */
	public void saveClipboardImage( Image img ) {

		if( img != null ) {	    	
			if( img instanceof BufferedImage ) {
				try {
					File file = new File( PREVIEW_DIRECTORY, this.sdf.format( new Date()) + &quot;.jpg&quot; );
					ImageIO.write((BufferedImage) img, &quot;jpg&quot;, file );
					for( PreviewFileListener listener : this.listeners )
						listener.newCreatedFile( file );

				} catch ( IOException e ) {
					e.printStackTrace();
				}

			} else {
				System.out.println( &quot;Unsupported image: &quot; + img.getClass());
			}	
		}
	}
	
	
	/**
	 * A interface to listen to image detection.
	 */
	public interface PreviewFileListener {

		/**
		 * Notifies this instance that an image file was created from the clip board.
		 * @param imageFile the image file that was saved on the disk
		 */
		void newCreatedFile( File imageFile );
	}
}</pre></p>
<p>There is another alternative for Windows platforms.<br />
However, it was only implemented for an OSGi context. Notice that it should not be too difficult to adapt it for standalone Java applications. I read and understood most of the code, but I was a little bit lazy on this one. Check <a href="http://philondev.blogspot.com/2010/02/osgi-clipboard-monitor-for-java-on.html">this blog entry</a> for more details. The code is hosted <a href="https://github.com/pke/clipboard.monitor">on GitHub</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vzurczak.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vzurczak.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vzurczak.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vzurczak.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vzurczak.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vzurczak.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vzurczak.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vzurczak.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vzurczak.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vzurczak.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vzurczak.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vzurczak.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vzurczak.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vzurczak.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak.wordpress.com&amp;blog=10081016&amp;post=303&amp;subd=vzurczak&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/8ujdQJj6pA0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vzurczak.wordpress.com/2011/12/20/detecting-new-images-in-the-clipboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://0.gravatar.com/avatar/45cf3bb2253fd4285acb0cfeba915a18?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
		<feedburner:origLink>http://vzurczak.wordpress.com/2011/12/20/detecting-new-images-in-the-clipboard/</feedburner:origLink></item>
		<item>
		<title>Poster sur WordPress depuis une Application Java</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/R3cvGL_mkUI/</link>
		<comments>http://vzurczak2.wordpress.com/2011/12/20/poster-sur-wordpress-depuis-une-application-java/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 15:02:11 +0000</pubDate>
		<dc:creator>Vincent Zurczak</dc:creator>
				<category><![CDATA[Vincent Zurczak]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress-Java]]></category>
		<category><![CDATA[XML-RPC]]></category>

		<guid isPermaLink="false">http://vzurczak2.wordpress.com/?p=170</guid>
		<description><![CDATA[Pour poster sur WordPress, tout le monde sait que l&#8217;on peut le faire en passant par le panneau d&#8217;administration de son blog. Vous connaissez peut-être aussi des programmes qui vous permettent de poster directement sur votre blog, sans avoir à lancer votre navigateur web. Une liste de tels programmes est disponbile sur le site de [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak2.wordpress.com&#38;blog=16811662&#38;post=170&#38;subd=vzurczak2&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Pour poster sur WordPress, tout le monde sait que l&#8217;on peut le faire en passant par <a href="http://codex.wordpress.org/Writing_Posts">le panneau d&#8217;administration</a> de son blog. Vous connaissez peut-être aussi des programmes qui vous permettent de poster directement sur votre blog, sans avoir à lancer votre navigateur web. Une liste de tels programmes est disponbile sur <a href="http://codex.wordpress.org/Weblog_Client">le site de WordPress</a>.</p>
<p>En fait, ces applications peuvent publier des billets et interagir avec votre blog grâce à un script particulier, intégré aux blogs WordPress. Ce script PHP s&#8217;appelle <a href="http://codex.wordpress.org/XML-RPC_Support"><tt>xmlrpc.php</tt></a> et permet de communiquer via HTTP en échangeant des structures JSON. Autrement dit, pour qu&#8217;une de vos applications puisse interagir avec votre blog, il suffit qu&#8217;elle communique avec ce fameux script.</p>
<p>Dans le cas d&#8217;une application Java, plusieurs options sont possibles.<br />
Personnellement, je n&#8217;avais pas envie de me prendre la tête pour décortiquer toutes les structures de données de l&#8217;API WordPress. Je me suis donc tourné vers une librairie Java qui fournit une API propre (et à peu près claire). Cette librairie, c&#8217;est <a href="http://code.google.com/p/wordpress-java/">WordPress-Java</a>.</p>
<p>Il y a quelques exemples disponibles sur le site.<br />
Je me permets ici d&#8217;en rajouter un de ma <em>composition</em>.</p>
<p><pre class="brush: java;">import java.net.MalformedURLException;

import net.bican.wordpress.Page;
import net.bican.wordpress.Wordpress;
import redstone.xmlrpc.XmlRpcArray;
import redstone.xmlrpc.XmlRpcFault;

/**
 * @author Vincent Zurczak
 */
public class WordpressDemo {	
	
	/**
	 * Publishes the given posts on the blog. 
	 */
	public static void publishOnBlog() {

		String username = &quot;mon-nom-d'utilisateur&quot;;
		String pwd = &quot;mon-mot-de-passe&quot;;
		String xmlRpcUrl = &quot;http://mon-adresse-de-blog/xmlrpc.php&quot;;

		try {
			Page newPost = new Page();

			newPost.setTitle( &quot;Le titre de mon post&quot; );
			newPost.setExcerpt( &quot;Un résumé de mon billet&quot; );
			newPost.setMt_keywords( &quot;mot clé 1, mot clé 2&quot; ); // Tags
			newPost.setMt_allow_comments( 1 ); // Allow comments
			newPost.setMt_allow_pings( 0 ); // No ping
			newPost.setDescription( &quot;Le contenu de mon post, avec des liens, etc.&quot; );

			XmlRpcArray cats = new XmlRpcArray();
			cats.add( &quot;Technique&quot; );
			newPost.setCategories( cats ); // Post categories

			Wordpress wp = new Wordpress( username, pwd, xmlRpcUrl );
			wp.newPost( newPost, true );

		} catch( MalformedURLException e ) {
			e.printStackTrace();

		} catch( XmlRpcFault e ) {
			e.printStackTrace();
		}
	}
}</pre></p>
<p>Après, vous pouvez faire des trucs plus avancés.<br />
Mais les tags, les catégories et les éléments utilisés ici sont les plus courants.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vzurczak2.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vzurczak2.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vzurczak2.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vzurczak2.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vzurczak2.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vzurczak2.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vzurczak2.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vzurczak2.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vzurczak2.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vzurczak2.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vzurczak2.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vzurczak2.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vzurczak2.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vzurczak2.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak2.wordpress.com&amp;blog=16811662&amp;post=170&amp;subd=vzurczak2&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/R3cvGL_mkUI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vzurczak2.wordpress.com/2011/12/20/poster-sur-wordpress-depuis-une-application-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://0.gravatar.com/avatar/45cf3bb2253fd4285acb0cfeba915a18?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
		<feedburner:origLink>http://vzurczak2.wordpress.com/2011/12/20/poster-sur-wordpress-depuis-une-application-java/</feedburner:origLink></item>
		<item>
		<title>Simple HeartBeat Manager with Play</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/mudVUolBckI/</link>
		<comments>http://chamerling.org/2011/12/16/simple-heartbeat-manager-with-play/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 09:52:57 +0000</pubDate>
		<dc:creator>Christophe Hamerling</dc:creator>
				<category><![CDATA[Christophe Hamerling]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[petalslink]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[heartbeat]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[playframework]]></category>

		<guid isPermaLink="false">http://chamerling.org/?p=1433</guid>
		<description><![CDATA[One more time, one more tiny (and maybe useful in some cases&#8230;) application with Play!. WTF, my server is dead again!? This app is a simple heartbeat manager looking at remote HTTP services and notifying you by email when something becomes unreachable. It uses the background Job feature of the Play framework and just does &#8230; <a href="http://chamerling.org/2011/12/16/simple-heartbeat-manager-with-play/">Lire la suite <span>&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.org&#38;blog=3069558&#38;post=1433&#38;subd=chamerling&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One more time, one more tiny (and maybe useful in some cases&#8230;) application with Play!.</p>
<blockquote><p>WTF, my server is dead again!?</p></blockquote>
<p>This app is a simple heartbeat manager looking at remote HTTP services and notifying you by email when something becomes unreachable. It uses the background Job feature of the Play framework and just does HTTP GETs on the specified list. That&#8217;s all, that&#8217;s simple, but that&#8217;s can be useful sometimes&#8230;</p>
<p><img class="aligncenter size-full wp-image-1434" title="hb-manager" src="http://chamerling.files.wordpress.com/2011/12/hb-manager.png?w=510" alt=""   /></p>
<p>The code is located at <a href="https://github.com/chamerling/heartbeat-manager" >https://github.com/chamerling/heartbeat-manager</a></p>
<br />Classé dans:<a href='http://chamerling.org/category/java/'>Java</a> Tagged: <a href='http://chamerling.org/tag/github/'>GitHub</a>, <a href='http://chamerling.org/tag/heartbeat/'>heartbeat</a>, <a href='http://chamerling.org/tag/http/'>HTTP</a>, <a href='http://chamerling.org/tag/java/'>Java</a>, <a href='http://chamerling.org/tag/petalslink/'>petalslink</a>, <a href='http://chamerling.org/tag/playframework/'>playframework</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/1433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/1433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/1433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/1433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chamerling.wordpress.com/1433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chamerling.wordpress.com/1433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chamerling.wordpress.com/1433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chamerling.wordpress.com/1433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/1433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/1433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/1433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/1433/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/1433/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/1433/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.org&amp;blog=3069558&amp;post=1433&amp;subd=chamerling&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/mudVUolBckI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.org/2011/12/16/simple-heartbeat-manager-with-play/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://chamerling.files.wordpress.com/2011/12/hb-manager.png" length="" type="" />
<enclosure url="http://1.gravatar.com/avatar/b6c497af6bc43da74f94095683908ca7?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
		<feedburner:origLink>http://chamerling.org/2011/12/16/simple-heartbeat-manager-with-play/</feedburner:origLink></item>
		<item>
		<title>OAuth and Desktop Apps</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/YmaNWvo7iZA/</link>
		<comments>http://chamerling.org/2011/12/12/oauth-and-desktop-apps/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 11:39:23 +0000</pubDate>
		<dc:creator>Christophe Hamerling</dc:creator>
				<category><![CDATA[Christophe Hamerling]]></category>
		<category><![CDATA[petalslink]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[Application programming interface]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Hypertext Transfer Protocol]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[QuickHub]]></category>
		<category><![CDATA[Uniform Resource Locator]]></category>

		<guid isPermaLink="false">http://chamerling.org/?p=1411</guid>
		<description><![CDATA[I started to develop QuickHub some weeks ago by focusing on features and without taking into account security issues such as this critical information which are login and password credentials&#8230; As mentioned in the GitHub developer pages, I started to use Basic Auth for all the requests QuickHub does to get retrieve data from GitHub. &#8230; <a href="http://chamerling.org/2011/12/12/oauth-and-desktop-apps/">Lire la suite <span>&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.org&#38;blog=3069558&#38;post=1411&#38;subd=chamerling&#38;ref=&#38;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I started to develop <a href="http://quickhubapp.com" >QuickHub</a> some weeks ago by focusing on features and without taking into account security issues such as this critical information which are login and password credentials&#8230; As mentioned in the <a class="zem_slink" title="GitHub" href="http://github.com" rel="homepage">GitHub</a> developer pages, I started to use Basic Auth for all the requests QuickHub does to get retrieve data from GitHub. I started to think about moving to <a class="zem_slink" title="OAuth" href="http://oauth.net" rel="homepage">OAuth</a> when a user said me that he bought QuickHub but that he did not use it because of Basic Auth. He was afraid that I can rob its credentials and so have a look to its repositories and more. I totally understand this argument and so I started to think that it limits QuickHub adoption by developers and that I should do something.</p>
<p>So, I discussed with GitHub guys through their support channel (Here I want to say that I am really impressed on how fast and professional is the GitHub support team!). Of course, they also told me that they will never use QuickHub if OAuth is not provided. After discussions with the guys, I started to implement a workaround to provide OAuth support in QuickHub by using the OAuth Web flow and adding some stuff to QuickHub.</p>
<p>Let&#8217;s see how we can do that in a generic way so that you can use it in your app if needed since every serious Internet service also provide OAuth support&#8230; Note that I will not give many details about OAuth itself but I will use some terms, so have a look to OAuth documentation for more details.</p>
<h2>Register a Web application</h2>
<p>The first step is to register your application to the developer portal. Here you need to provide some information such as the app name and its callback URL. Even if we are developing a desktop app and not a Web one, we need to be able to provide this HTTP based callback URL. We will see in the next section what is inside this application. By registering our application, the service will generate and give us some keys to be used in the next steps, mostly to recognize us when calling the service.</p>
<h2>Create a Web application</h2>
<p>We need a Web application to handle callback calls from the service we want to use OAuth. This application will only be used at authorization time and just have to be able to receive the service call, get the code sent by the service, then call the service again with the code and our application keys (there is a secret one to be used here). As a result, the service will send you back your OAuth token to be used in all the future service calls. This token is used to authenticate your service calls, no more password stuff inside! Here is a quick sequence diagram showing all the exchanges between actors&#8230;</p>
<p><img class="aligncenter size-full wp-image-1424" title="Sequence" src="http://chamerling.files.wordpress.com/2011/12/photo-4.jpg?w=510" alt=""   /></p>
<p>On the QuickHub side, I chose to create this Web application by using the <a class="zem_slink" title="Play Framework" href="http://www.playframework.org" rel="homepage">Play Framework</a> I already mentioned several times in this blog. I used the <a class="zem_slink" title="Heroku" href="http://www.heroku.com/" rel="homepage">Heroku</a> paas to provide the Web application publicly.</p>
<p>As showed in this Gist (<a href="https://gist.github.com/1466592" >https://gist.github.com/1466592</a>), the callback method is really simple (as usual with Play!): just get the code and call GitHub with it and your application keys. When all lis done, just display a result page with a specific URL. Here it starts with &#8216;quickhubapp://oauth?&#8217;. Let&#8217;s see what it means in the next section&#8230;</p>
<h2>Add custom URL handlers to your desktop app</h2>
<p>Once the desktop application is authorized, our Web application redirects the user to a Web page which embeds a button targeting an URL starting by &#8216;quickhubapp://oauth?&#8217;. Here you already understand that by clicking on such a link must drive you to something special. The cocoa framework allows developers to register specific URL handlers for their applications. So we need to register QuickHub handlers so that OS X knows that every link  with the quickhubapp scheme must me routed to QuickHub. This is as easy as showed in this Gist <a href="https://gist.github.com/1466628" >https://gist.github.com/1466628</a>.</p>
<p>This code snippet just tells QuickHub to invoke the getUrl method when it receives a quickhubapp event. Up to the getUrl method to handle things. In QuickHub, I just extract the OAuth token in order to persist it locally for future use.</p>
<h2>Done!</h2>
<p>So now we are able to use OAuth Web flows for desktop applications. In the best of the worlds, every service provider may provide a real desktop flow to be used without the need to create this additional web application. In the real world, it is not the case but as you see it can be bypassed quite easily.</p>
<p>I will provide more technical details on the second section &#8216;Create a Web application&#8217; with real sample and code in the next weeks.</p>
<br />Classé dans:<a href='http://chamerling.org/category/quickhub/'>QuickHub</a>, <a href='http://chamerling.org/category/webservice/'>WebService</a> Tagged: <a href='http://chamerling.org/tag/application-programming-interface/'>Application programming interface</a>, <a href='http://chamerling.org/tag/github/'>GitHub</a>, <a href='http://chamerling.org/tag/hypertext-transfer-protocol/'>Hypertext Transfer Protocol</a>, <a href='http://chamerling.org/tag/oauth/'>OAuth</a>, <a href='http://chamerling.org/tag/petalslink/'>petalslink</a>, <a href='http://chamerling.org/tag/quickhub-2/'>quickhub</a>, <a href='http://chamerling.org/tag/uniform-resource-locator/'>Uniform Resource Locator</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/1411/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/1411/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/1411/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/1411/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chamerling.wordpress.com/1411/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chamerling.wordpress.com/1411/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chamerling.wordpress.com/1411/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chamerling.wordpress.com/1411/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/1411/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/1411/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/1411/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/1411/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/1411/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/1411/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.org&amp;blog=3069558&amp;post=1411&amp;subd=chamerling&amp;ref=&amp;feed=1" width="1" height="1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/YmaNWvo7iZA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.org/2011/12/12/oauth-and-desktop-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://1.gravatar.com/avatar/b6c497af6bc43da74f94095683908ca7?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
<enclosure url="http://chamerling.files.wordpress.com/2011/12/photo-4.jpg" length="" type="" />
		<feedburner:origLink>http://chamerling.org/2011/12/12/oauth-and-desktop-apps/</feedburner:origLink></item>
	</channel>
</rss>

