<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><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" version="2.0">

<channel>
	<title>GWT Brasil</title>
	
	<link>http://www.gwt.com.br</link>
	<description>Grupo de usuários do GWT no Brasil</description>
	<pubDate>Tue, 16 Dec 2008 11:44:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/GwtBrasil" type="application/rss+xml" /><item>
		<title>Algumas Notícias</title>
		<link>http://www.gwt.com.br/2008/12/16/algumas-noticias/</link>
		<comments>http://www.gwt.com.br/2008/12/16/algumas-noticias/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 11:44:31 +0000</pubDate>
		<dc:creator>carlos</dc:creator>
		
		<category><![CDATA[Notí­cias]]></category>

		<guid isPermaLink="false">http://www.gwt.com.br/?p=91</guid>
		<description><![CDATA[Opa pessoal,
   Depois de muito tempo, algumas notícias para tirar o pó do site.
   * Foi lançado, a um certo tempo é verdade, uma nova api java script, a SmartClient , e também seu suporte a GWT, o SmartGWT. O responsável é o mesmo que trabalhava no Ext, Sanjiv Jivan, que [...]]]></description>
			<content:encoded><![CDATA[<p>Opa pessoal,<br />
   Depois de muito tempo, algumas notícias para tirar o pó do site.<br />
   * Foi lançado, a um certo tempo é verdade, uma nova api java script, a <a href="http://www.smartclient.com">SmartClient </a>, e também seu suporte a GWT, o <a href="http://code.google.com/p/smartgwt/">SmartGWT</a>. O responsável é o mesmo que trabalhava no Ext, <a href="http://www.jroller.com/sjivan/entry/smartgwt_1_0_released">Sanjiv Jivan</a>, que saiu do projeto por não concordar com a nova licensa. Assim o SmartGWT já nasce o propósito de ser free. Vale a pena dar uma olhada. Existe vários componentes existentes. Um demo do SmartGWT pode ser visto <a href="http://www.smartclient.com/smartgwt/showcase/">aqui</a>.</p>
<p>   * Recentemente foi liberado uma versão da API de <a href="https://beansbinding.dev.java.net/">Beans Binding (JSR 295)</a> para GWT. O projeto <a href="http://code.google.com/p/gwt-beans-binding/">gwt-beans-binding</a> ainda está bastante no início, mas já possui uma boa cobertura da API de Beans Binding. É um projeto que vai trazer muitas melhorias ao GWT, mas que não seja como sua irmã mais velha, que está parada a muito tempo sem atualização.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwt.com.br/2008/12/16/algumas-noticias/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Comunicação Cliente-Servidor utilizando o RPC</title>
		<link>http://www.gwt.com.br/2008/11/04/comunicacao-cliente-servidor-utilizando-o-rpc/</link>
		<comments>http://www.gwt.com.br/2008/11/04/comunicacao-cliente-servidor-utilizando-o-rpc/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 11:57:34 +0000</pubDate>
		<dc:creator>Marcelo Emanoel</dc:creator>
		
		<category><![CDATA[Básico]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[gwt]]></category>

		<category><![CDATA[http]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[rpc]]></category>

		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://www.gwt.com.br/?p=69</guid>
		<description><![CDATA[Este post descreve como funciona o mecanismo de comunicação rpc do gwt.]]></description>
			<content:encoded><![CDATA[<p>É comum para alguém que esteja começando a programar com o GWT ter um pouco de dificuldade com a comunicação entre cliente e servidor através do mecanismo padrão do GWT, o RPC. Após receber alguns emails sobre como fazer isso resolvi escrever este post mostrando de uma forma simplificada e rápida os passos necessários para a execução dessa tarefa simples e extremamente comum em aplicações ajax.<br />
<span id="more-69"></span><br />
Para começar é interessante saber como funciona esse mecanismo. De forma resumida o que acontece é o seguinte: Ao receber o seu objeto java, o compilador gwt vai transformá-lo em uma String então o serializa e em seguida envia ao servidor por meio de uma conexão HTTP normal. Ao receber esse objeto serializado o servidor(Servlet gwt) então deserializa o objeto executando o caminho inverso, transformando a String em um objeto java e então este segue o seu ciclo de vida normal. Da mesma maneira, o inverso também é verdade. Assim, a comunicação pode ser efetuada em ambos os sentidos. Para conseguir executar toda essa tarefa é necessário que o objeto a ser enviado obedeça a algumas regras, a seguir:</p>
<ol>
<li>Ser de um tipo básico/primitivo (String, Integer/int, Double/double, Long/long, Boolean/boolean ).</li>
<li>Implementar a interface Serializable ou IsSerializable(gwt < 1.4). </li>
</li>
<li>Todos os campos do objeto devem obedecer à(s) regra(s) 1 e/ou 2.</li>
</ol>
<p>O uso de coleções e mapas é permitido desde que se use generics e os tipos que elas encapsulem obedeçam às regras citadas anteriormente. Assim é possível se ter por exemplo uma List&lt;String&gt; trafegando entre o cliente e o servidor.</p>
<p>Abaixo você encontra o diagrama de implementação de um serviço rpc do gwt.<br />
<div class="wp-caption aligncenter" style="width: 510px"><img alt="Diagrama de Implementação de um Serviço RPC" src="http://google-web-toolkit-doc-1-5.googlecode.com/svn/wiki/AnatomyOfServices.gif" title="Diagrama de Implementação de um Serviço RPC" width="500" height="433" /><p class="wp-caption-text">Diagrama de Implementação de um Serviço RPC</p></div></p>
<p>O que essa coisa toda realmente significa é bastante simples:</p>
<ul>
<li>2 interfaces</li>
<li>1 servlet</li>
</ul>
<p>As duas interfaces servem para a definir o que o serviço irá realizar, por exemplo: Verificar se um usuário possui acesso a um determinado recurso, efetuar login no sistema... etc. Uma dessas interfaces é chamada de síncrona e a outra de assíncrona. O servlet define o como esse serviço será implementado e por isso ele deve implementar a interface síncrona do serviço. </p>
<p>Utilizando a versão 1.5 do gwt temos o seguinte:</p>
<p>Interface Síncrona:</p>
<div class="igBar"><span id="ljava-1"><a href="#" onclick="javascript:showCodeTxt('java-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-1">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package br.<span style="color: #006600;">com</span>.<span style="color: #006600;">gwt</span>.<span style="color: #006600;">rpc</span>.<span style="color: #006600;">client</span>.<span style="color: #006600;">servico</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@RemoteServiceRelativePath<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"/servico"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> Servico <span style="color: #000000; font-weight: bold;">extends</span> Service<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3ABoolean+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Boolean</span></a> autoriza<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> loginToken, <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> recurso<span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> login<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> login, <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> senha<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?q=allinurl%3AException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> logout<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> loginToken<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Interface Assíncrona:</p>
<div class="igBar"><span id="ljava-2"><a href="#" onclick="javascript:showCodeTxt('java-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-2">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package br.<span style="color: #006600;">com</span>.<span style="color: #006600;">gwt</span>.<span style="color: #006600;">rpc</span>.<span style="color: #006600;">client</span>.<span style="color: #006600;">servico</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> ServicoAsync <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> autoriza<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> loginToken, <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> recurso, AsyncCallback&amp;gt;Boolean&amp;lt;callback<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> login<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> login, <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> senha, AsyncCallback&amp;gt;String&amp;lt;callback<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> logout<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> loginToken, AsyncCallback&amp;gt;Void&amp;lt;callback<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Reparem que na interface Assíncrona os métodos não retornam objetos e os parâmetros dos métodos são os mesmos da interface síncrona com o acréscimo de um AsyncCallback. Entrarei em detalhes logo abaixo.</p>
<p>Agora, restam somente dois passos para a criação do serviço. Implementar o servlet e registrá-lo no arquivo do módulo. </p>
<div class="igBar"><span id="ljava-3"><a href="#" onclick="javascript:showCodeTxt('java-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-3">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package br.<span style="color: #006600;">com</span>.<span style="color: #006600;">gwt</span>.<span style="color: #006600;">rpc</span>.<span style="color: #006600;">server</span>.<span style="color: #006600;">servico</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ServicoImpl <span style="color: #000000; font-weight: bold;">extends</span> RemoteServiceServlet <span style="color: #000000; font-weight: bold;">implements</span> Servico <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3ABoolean+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Boolean</span></a> autoriza<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> loginToken, <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> recurso<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*implementação da autorização;*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> login<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> login, <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> senha<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?q=allinurl%3AException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*implementação do login*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> logout<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> loginToken<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*implementação do logout*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Abaixo o arquivo de configuração do módulo gwt.</p>
<div class="igBar"><span id="lxml-4"><a href="#" onclick="javascript:showCodeTxt('xml-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-4">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;module<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;servlet</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">"/servico"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"br.com.gwt.rpc.client.servico.ServicoImpl"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/module<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A partir daí o serviço está pronto para ser usado. Repare que o path no módulo de configuração é o mesmo definido logo no início da interface síncrona. Feito isso enquanto estiver utilizando em hosted mode, não é necessário nenhuma outra configuração adicional. Para a utilização em web mode é necessária uma última configuração. Registrar o servlet no web.xml. Esta última tarefa não será coberta neste post por se tratar de uma atividade comum em uma aplicação JEE. </p>
<p>Para fazer uma chamada ao serviço o compilador do gwt deve ser invocado através da seguinte chamada:</p>
<div class="igBar"><span id="ljava-5"><a href="#" onclick="javascript:showCodeTxt('java-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-5">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ServicoAsync servico = GWT.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span>Servico.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>As chamadas são sempre assíncronas, isso significa que é criada uma conexão HTTP com o servidor, essa chamada é executada e em algum momento ela irá retornar e então executará o código que faz parte do AsyncCallback que criamos. A seguir um exemplo de chamada ao método de login:</p>
<div class="igBar"><span id="ljava-6"><a href="#" onclick="javascript:showCodeTxt('java-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-6">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #006600;">servico</span>.<span style="color: #006600;">login</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"login"</span>, <span style="color: #ff0000;">"1234"</span>, <span style="color: #000000; font-weight: bold;">new</span> AsyncCallback&lt;string&gt; callback<span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> onSuccess<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> result<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;loginToken = result;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.google.com/search?q=allinurl%3AWindow+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Window</span></a>.<span style="color: #006600;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Login efetuado com sucesso!"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> onFailure<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AThrowable+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Throwable</span></a> cause<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.google.com/search?q=allinurl%3AWindow+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Window</span></a>.<span style="color: #006600;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Ocorreu uma falha no processo de login. Causa: <span style="color: #000099; font-weight: bold;">\n</span>"</span>+cause.<span style="color: #006600;">getMessage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Abraços e até o próximo post <img src='http://www.gwt.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </string></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwt.com.br/2008/11/04/comunicacao-cliente-servidor-utilizando-o-rpc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Material sobre GWT</title>
		<link>http://www.gwt.com.br/2008/09/26/material-sobre-gwt/</link>
		<comments>http://www.gwt.com.br/2008/09/26/material-sobre-gwt/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 13:46:50 +0000</pubDate>
		<dc:creator>carlos</dc:creator>
		
		<category><![CDATA[curtas]]></category>

		<guid isPermaLink="false">http://www.gwt.com.br/2008/09/26/material-sobre-gwt/</guid>
		<description><![CDATA[Hoje pela manhã foi publicado um post no JavaLobby reunindo uma série de oito artigos sobre GWT. A maioria deles retirados do livro GWT in Practice. Os post falam de diversor pontos no desenvolvimento de aplicações usando o GWT. Vale a pena a lida deles.
]]></description>
			<content:encoded><![CDATA[<p>Hoje pela manhã foi publicado um <a href="http://java.dzone.com/news/the-great-gwt-roundup">post</a> no JavaLobby reunindo uma série de oito artigos sobre GWT. A maioria deles retirados do livro <a href="http://www.manning.com/cooper/">GWT in Practice</a>. Os post falam de diversor pontos no desenvolvimento de aplicações usando o GWT. Vale a pena a lida deles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwt.com.br/2008/09/26/material-sobre-gwt/feed/</wfw:commentRss>
		</item>
		<item>
		<title>API’s Google para o GWT</title>
		<link>http://www.gwt.com.br/2008/09/26/apis-google-para-o-gwt/</link>
		<comments>http://www.gwt.com.br/2008/09/26/apis-google-para-o-gwt/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 13:31:21 +0000</pubDate>
		<dc:creator>carlos</dc:creator>
		
		<category><![CDATA[curtas]]></category>

		<guid isPermaLink="false">http://www.gwt.com.br/2008/09/26/apis-google-para-o-gwt/</guid>
		<description><![CDATA[O Google lançou recentemente o projeto Google API Libraries for Google Web Toolkit. O projeto ainda é RC (Realese Candidate). Agora os desenvolvedores GWT poderão usar as APIs do Google dentro das suas aplicações. Por enquanto estão disponíveis as Apis do Google Gears, Google Gadgets, Google Search e Google Maps.
O interessante no Google Maps é [...]]]></description>
			<content:encoded><![CDATA[<p>O Google lançou recentemente o projeto <a href="http://code.google.com/p/gwt-google-apis/">Google API Libraries for Google Web Toolkit</a>. O projeto ainda é RC (Realese Candidate). Agora os desenvolvedores GWT poderão usar as APIs do Google dentro das suas aplicações. Por enquanto estão disponíveis as Apis do <a href="http://code.google.com/apis/gears/">Google Gears</a>, <a href="http://code.google.com/apis/gadgets/">Google Gadgets</a>, <a href="http://code.google.com/apis/ajaxsearch/">Google Search</a> e <a href="http://code.google.com/apis/maps/">Google Maps</a>.<br />
O interessante no Google Maps é que além do desenvolvedor poder disponibilizar mapas dentro das suas aplicações, também pode colocar widgets do GWT dentros desses mapas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwt.com.br/2008/09/26/apis-google-para-o-gwt/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introdução ao GWT</title>
		<link>http://www.gwt.com.br/2008/09/11/introducao-ao-gwt/</link>
		<comments>http://www.gwt.com.br/2008/09/11/introducao-ao-gwt/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 15:02:54 +0000</pubDate>
		<dc:creator>bruno.catao</dc:creator>
		
		<category><![CDATA[Básico]]></category>

		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.gwt.com.br/2008/09/11/introducao-ao-gwt/</guid>
		<description><![CDATA[Hoje dou início a uma série de artigos introdutórios sobre GWT, com os quais pretendo mostrar melhor as características da tecnologia ao mesmo tempo que com o decorrer desta série iremos construindo um aplicativo web completo.
Neste primeiro artigo irei escrever basicamente sobre o que é GWT, o porquê esta tecnologia é uma opção para o desenvolvimento de aplicações web e, por fim, [...]]]></description>
			<content:encoded><![CDATA[<p>Hoje dou início a uma série<span class="Apple-converted-space"> </span>de artigos<span class="Apple-converted-space"> </span>introdutórios sobre<span class="Apple-converted-space"> </span>GWT, com os quais pretendo mostrar melhor as características da tecnologia ao mesmo tempo que com o decorrer desta série iremos construindo um aplicativo web completo.</p>
<p class="MsoNormal" style="margin: 0px">Neste primeiro artigo irei escrever basicamente sobre o que é<span class="Apple-converted-space"> </span>GWT, o<span class="Apple-converted-space"> </span>porquê esta tecnologia é uma<span class="Apple-converted-space"> </span>opção para o desenvolvimento de aplicações<span class="Apple-converted-space"> </span>web<span class="Apple-converted-space"> </span>e, por fim, irei mostrar algumas de suas características<span class="Apple-converted-space"> </span>básicas.</p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong>O que é<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>?</strong></p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px">Basicamente<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>(Google<span class="Apple-converted-space"> </span>Web<span class="Apple-converted-space"> </span>Toolkit) é um conjunto de ferramentas de desenvolvimento, uma API e um conjunto de componentes visuais projetadas para o desenvolvimento de aplicações<span class="Apple-converted-space"> </span>Web. A principal<span class="Apple-converted-space"> </span>diferença entre<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>e outros<span class="Apple-converted-space"> </span>frameworks<span class="Apple-converted-space"> </span>é que o código que é executado no<span class="Apple-converted-space"> </span>browser<span class="Apple-converted-space"> </span>é feito em Java ao<span class="Apple-converted-space"> </span>invés de<span class="Apple-converted-space"> </span>Javascript. Por mais que<span class="Apple-converted-space"> </span>Javascript<span class="Apple-converted-space"> </span>seja uma linguagem de programação com muitos defensores, utilizar Java para implementar a camada de apresentação possui várias vantagens tais como: a linguagem de programação Java é fortemente<span class="Apple-converted-space"> </span>tipada<span class="Apple-converted-space"> </span>e o seu código é compilado, assim, muitos erros são encontrados em tempo de compilação; existem muitas<span class="Apple-converted-space"> </span>IDEs<span class="Apple-converted-space"> </span>(excelentes, conhecidas e gratuitas) para o desenvolvimento em Java; por fim, a quantidade de programadores Java é muito maior do que a quantidade de programadores<span class="Apple-converted-space"> </span>Javascript.</p>
<p class="MsoNormal" style="margin: 0px">Além das<span class="Apple-converted-space"> </span>razões<span class="Apple-converted-space"> </span>citadas acima, o código produzido por<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>é<span class="Apple-converted-space"> </span>compatível<span class="Apple-converted-space"> </span>com os<span class="Apple-converted-space"> </span>browsers<span class="Apple-converted-space"> </span>mais utilizados e desenvolver código<span class="Apple-converted-space"> </span>HTML+CSS+Javascript<span class="Apple-converted-space"> </span>que funcione bem em todos os<span class="Apple-converted-space"> </span>browsers<span class="Apple-converted-space"> </span>não é uma tarefa das mais triviais (quem já tentou isso sabe do que eu estou falando). <span id="more-66"></span></p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong>Por<span class="Apple-converted-space"> </span>quê<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>?</strong></p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px">Fazer um sistema de informação em Java envolve muito mais tarefas do que simplesmente a codificação do sistema. Atualmente<span class="Apple-converted-space"> </span>até mesmo a tarefa de escolher as tecnologias que serão utilizadas em cada camada da aplicação não é das mais simples.<span class="Apple-converted-space"> </span>GWT, por exemplo, é só mais um<span class="Apple-converted-space"> </span>framework<span class="Apple-converted-space"> </span>para a camada de apresentação de uma aplicação, existem muitos outros bons<span class="Apple-converted-space"> </span>frameworks<span class="Apple-converted-space"> </span>para a mesma finalidade (ex:<span class="Apple-converted-space"> </span>Struts,<span class="Apple-converted-space"> </span>JSF,<span class="Apple-converted-space"> </span>Flex,<span class="Apple-converted-space"> </span>Silverlight,<span class="Apple-converted-space"> </span>Wicket, etc).</p>
<p class="MsoNormal" style="margin: 0px">Com os novos<span class="Apple-converted-space"> </span>frameworks<span class="Apple-converted-space"> </span>(principalmente Adobe<span class="Apple-converted-space"> </span>Flex, Microsoft<span class="Apple-converted-space"> </span>Silverlight<span class="Apple-converted-space"> </span>e Java<span class="Apple-converted-space"> </span>FX) a<span class="Apple-converted-space"> </span>questão mais<span class="Apple-converted-space"> </span>difícil<span class="Apple-converted-space"> </span>de responder é<span class="Apple-converted-space"> </span>HTML<span class="Apple-converted-space"> </span>ou não<span class="Apple-converted-space"> </span>HTML<span class="Apple-converted-space"> </span>? A grande<span class="Apple-converted-space"> </span>diferença destas novas<span class="Apple-converted-space"> </span>opções<span class="Apple-converted-space"> </span>é que o seu resultado é muito mais bonito do<span class="Apple-converted-space"> </span>quê uma página<span class="Apple-converted-space"> </span>HTML<span class="Apple-converted-space"> </span>tradicional (e isto é obtido com muito menos<span class="Apple-converted-space"> </span>esforço). Porém, o bom e velho<span class="Apple-converted-space"> </span>HTML<span class="Apple-converted-space"> </span>ainda é (e será por muito tempo) útil, pois seja em<span class="Apple-converted-space"> </span>desktops<span class="Apple-converted-space"> </span>quanto em dispositivos móveis, qualquer coisa que tem<span class="Apple-converted-space"> </span>conexão com a<span class="Apple-converted-space"> </span>web<span class="Apple-converted-space"> </span>possui automaticamente alguma forma de mostrar conteúdo<span class="Apple-converted-space"> </span>HTML<span class="Apple-converted-space"> </span>(e<span class="Apple-converted-space"> </span>Javascript). Por fim,<span class="Apple-converted-space"> </span>através do seu<span class="Apple-converted-space"> </span>hosted<span class="Apple-converted-space"> </span>mode,<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>permite que os desenvolvedores fazer<span class="Apple-converted-space"> </span>debug<span class="Apple-converted-space"> </span>à camada de apresentação das suas aplicações<span class="Apple-converted-space"> </span>Web<span class="Apple-converted-space"> </span>! Além de<span class="Apple-converted-space"> </span>também ser<span class="Apple-converted-space"> </span>possível<span class="Apple-converted-space"> </span>construir testes de unidade (com o<span class="Apple-converted-space"> </span>JUnit<span class="Apple-converted-space"> </span>por exemplo).</p>
<p class="MsoNormal" style="margin: 0px">Sendo<span class="Apple-converted-space"> </span>assim,<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>é a<span class="Apple-converted-space"> </span>opção para quem quer publicar suas aplicações<span class="Apple-converted-space"> </span>Web<span class="Apple-converted-space"> </span>em<span class="Apple-converted-space"> </span>HTML, porém prefere codificar em Java do<span class="Apple-converted-space"> </span>quê em<span class="Apple-converted-space"> </span>Javascript.</p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong>Características<span class="Apple-converted-space"> </span>do<span class="Apple-converted-space"> </span>GWT</strong></p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong><em>Compilador de<span class="Apple-converted-space"> </span>Javascript:</em></strong></p>
<p class="MsoNormal" style="margin: 0px">A característica<span class="Apple-converted-space"> </span>mais interessante do<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>é o seu compilador de Java para<span class="Apple-converted-space"> </span>Javascript.<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>converte um subconjunto (bastante grande) da linguagem de programação Java para<span class="Apple-converted-space"> </span>Javascript. Basicamente toda a sintaxe da linguagem Java é suportada (inclusive a sintaxe Java 5, suportada a partir do<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>1.5) com algumas poucas<span class="Apple-converted-space"> </span>exceções:</p>
<ul>
<li>nem todas as classes da biblioteca<span class="Apple-converted-space"> </span>padrão de Java são emuladas, ex:<span class="Apple-converted-space"> </span>LinkedList,<span class="Apple-converted-space"> </span>StringTokenizer,<span class="Apple-converted-space"> </span>Logging<span class="Apple-converted-space"> </span>e<span class="Apple-converted-space"> </span>BigNumber<span class="Apple-converted-space"> </span>são algumas das classes que<span class="Apple-converted-space"> </span>estão faltando. Uma lista completa destas classes pode ser vista em <a href="http://code.google.com/%20%20webtoolkit/documentation/jre.html" title="http://code.google.com/  webtoolkit/documentation/jre.html" target="_blank">http://code.google.com/</a></li>
</ul>
<p class="MsoNormal" style="margin: 0px"><a href="http://code.google.com/%20%20webtoolkit/documentation/jre.html" title="http://code.google.com/  webtoolkit/documentation/jre.html" target="_blank">webtoolkit/documentation/jre.html<span class="Apple-converted-space"></span></a>;</p>
<ul>
<li>existem algumas outras<span class="Apple-converted-space"> </span>restrições<span class="Apple-converted-space"> </span>como por exemplo a falta de reflexão,<span class="Apple-converted-space"> </span>multithreading, sincronização,<span class="Apple-converted-space"> </span>Throwable.getStackTrace() e<span class="Apple-converted-space"> </span>asserções. Esta lista completa<span class="Apple-converted-space"> </span>está no site <a href="http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.%20%20DeveloperGuide.Fundamentals.html#LanguageSupport" title="http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.  DeveloperGuide.Fundamentals.html#LanguageSupport" target="_blank">http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.</a></li>
</ul>
<p class="MsoNormal" style="margin: 0px"><a href="http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.%20%20DeveloperGuide.Fundamentals.html#LanguageSupport" title="http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.  DeveloperGuide.Fundamentals.html#LanguageSupport" target="_blank">DeveloperGuide.Fundamentals.html#LanguageSupport</a></p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong><em>Economida<span class="Apple-converted-space"> </span>de<span class="Apple-converted-space"> </span>espaço:</em></strong></p>
<p class="MsoNormal" style="margin: 0px">Além disto uma preocupação constante da equipe do google enquanto desenvolvem o<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>é em<span class="Apple-converted-space"> </span>torná-lo eficiente, produzindo código<span class="Apple-converted-space"> </span>Javascript<span class="Apple-converted-space"> </span>rápido<span class="Apple-converted-space"> </span>e o menor<span class="Apple-converted-space"> </span>possível. Para isto, uma das medidas tomada para otimizar o<span class="Apple-converted-space"> </span>espaço ocupado pelo<span class="Apple-converted-space"> </span>javascript<span class="Apple-converted-space"> </span>gerado é produzir apenas o código que é utilizado, para isto, todo o código produzido é<span class="Apple-converted-space"> </span>analizado<span class="Apple-converted-space"> </span>para determinar se existe alguma parte que nunca é executada, qualquer trecho que não for executado é automaticamente removido do<span class="Apple-converted-space"> </span>javascript<span class="Apple-converted-space"> </span>gerado. Além disto, só são<span class="Apple-converted-space"> </span>incluídas as<span class="Apple-converted-space"> </span>funções<span class="Apple-converted-space"> </span>da biblioteca que são utilizadas.</p>
<p class="MsoNormal" style="margin: 0px">Outra característica<span class="Apple-converted-space"> </span>que poucos programadores conhecem a respeito do comportamento dos<span class="Apple-converted-space"> </span>browsers<span class="Apple-converted-space"> </span>é que estes abrem normalmente uma ou duas<span class="Apple-converted-space"> </span>conexões<span class="Apple-converted-space"> </span>para fazer o download dos arquivos<span class="Apple-converted-space"> </span>Javascript<span class="Apple-converted-space"> </span>incluídos em uma página. Este download é feito de forma sequencial. Ou seja, há um<span class="Apple-converted-space"> </span>tradeoff<span class="Apple-converted-space"> </span>para os programadores<span class="Apple-converted-space"> </span>Javascript<span class="Apple-converted-space"> </span>tradicionais entre modularidade e velocidade. No caso do<span class="Apple-converted-space"> </span>GWT, todas as<span class="Apple-converted-space"> </span>funções<span class="Apple-converted-space"> </span>Javascript<span class="Apple-converted-space"> </span>são agrupadas em um único arquivo de modo a tornar mais ágil<span class="Apple-converted-space"> </span>este processo de download. Por fim, todo o código gerado é ofuscado e compactado (utilizando um filtro<span class="Apple-converted-space"> </span>gzip<span class="Apple-converted-space"> </span>no servidor<span class="Apple-converted-space"> </span>web), deixando o tamanho final dos artefatos muito menor do<span class="Apple-converted-space"> </span>quê provavelmente um programador conseguiria fazer manualmente.</p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong><em>Múltiplos<span class="Apple-converted-space"> </span>browsers:</em></strong></p>
<p class="MsoNormal" style="margin: 0px">Quem já precisou desenvolver algum código em<span class="Apple-converted-space"> </span>Javascript<span class="Apple-converted-space"> </span>para múltiplos<span class="Apple-converted-space"> </span>browsers<span class="Apple-converted-space"> </span>ou mesmo teve a oportunidade der ler algum código feito para este fim, provavelmente<span class="Apple-converted-space"> </span>deparou-se<span class="Apple-converted-space"> </span>com uma infinidade de "ifs" que tentam determinar qual o<span class="Apple-converted-space"> </span>browser<span class="Apple-converted-space"> </span>que<span class="Apple-converted-space"> </span>está acessando a página<span class="Apple-converted-space"> </span>para realizar a mesma tarefa com pequenas modificações. Os desenvolvedores do<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>além de isolar os programadores deste tipo de problema ainda tiveram uma idéia bastante interessante, o compilador de<span class="Apple-converted-space"> </span>Javascript<span class="Apple-converted-space"> </span>gera uma<span class="Apple-converted-space"> </span>versão da aplicação para cada tipo de<span class="Apple-converted-space"> </span>browser<span class="Apple-converted-space"> </span>diferente e o servidor<span class="Apple-converted-space"> </span>web<span class="Apple-converted-space"> </span>fornece para cada cliente apenas a<span class="Apple-converted-space"> </span>versão adequada ao seu<span class="Apple-converted-space"> </span>browser.</p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong><em>Múltiplos<span class="Apple-converted-space"> </span>idiomas:</em></strong></p>
<p class="MsoNormal" style="margin: 0px">Da mesma forma que o<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>gera uma<span class="Apple-converted-space"> </span>versão diferente da aplicação para cada<span class="Apple-converted-space"> </span>browser, a mesma<span class="Apple-converted-space"> </span>estratégia é utilizada caso<span class="Apple-converted-space"> </span>você utilize internacionalização em sua aplicação. Desta forma, o compilador<span class="Apple-converted-space"> </span>Javascript<span class="Apple-converted-space"> </span>gera a combinação de todos os idiomas com todos os<span class="Apple-converted-space"> </span>browsers<span class="Apple-converted-space"> </span>possíveis, assim, cada cliente recebe apenas a<span class="Apple-converted-space"> </span>versão da aplicação para o seu<span class="Apple-converted-space"> </span>browser<span class="Apple-converted-space"> </span>e para o seu idioma.</p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong><em>Image<span class="Apple-converted-space"> </span>bundle:</em></strong></p>
<p class="MsoNormal" style="margin: 0px">Um último<span class="Apple-converted-space"> </span>recurso bastante interessante e novo (pois foi adicionado ao<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>apenas na<span class="Apple-converted-space"> </span>versão 1.5) é o<span class="Apple-converted-space"> </span>image<span class="Apple-converted-space"> </span>bundle. Com ele é<span class="Apple-converted-space"> </span>possível<span class="Apple-converted-space"> </span>agrupar várias imagens em apenas um arquivo (normalmente faz sentido agrupar as mesmas imagens de uma página). Assim ao<span class="Apple-converted-space"> </span>invés do<span class="Apple-converted-space"> </span>browser<span class="Apple-converted-space"> </span>abrir várias<span class="Apple-converted-space"> </span>conexões<span class="Apple-converted-space"> </span>TCP<span class="Apple-converted-space"> </span>para fazer o download das imagens, só é<span class="Apple-converted-space"> </span>necessário abrir uma<span class="Apple-converted-space"> </span>conexão e, o código<span class="Apple-converted-space"> </span>HTML+CSS<span class="Apple-converted-space"> </span>gerado, automaticamente "quebra" as imagens e as exibe individualmente.</p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px"><strong>Conclusão</strong></p>
<p class="MsoNormal" style="margin: 0px">&nbsp;</p>
<p class="MsoNormal" style="margin: 0px">Neste artigo escrevi uma breve<span class="Apple-converted-space"> </span>introdução à tecnologia<span class="Apple-converted-space"> </span>GWT<span class="Apple-converted-space"> </span>e às suas principais características. Espero ter mostrado que este é um conjunto de ferramentas bem interessante e que deve ser levado bastante a sério como alternativa para a<span class="Apple-converted-space"> </span>construção dos seus<span class="Apple-converted-space"> </span>próximos<span class="Apple-converted-space"> </span>projetos. Além disto, eu gostaria de ressaltar que este é um projeto em forte desenvolvimento e que tanto os programadores do Google quanto à comunidade de<span class="Apple-converted-space"> </span>usuários é bastante solícita e ajuda bastante nos<span class="Apple-converted-space"> </span>forums<span class="Apple-converted-space"> </span>oficiais (http://groups.google.com/group/Google-Web-Toolkit). Por fim, este é apenas o primeiro artigo de uma série, onde mostrarei os principais conceitos e faremos iterativamente uma aplicação<span class="Apple-converted-space"> </span>web<span class="Apple-converted-space"> </span>do começo ao fim, utilizando, é claro,<span class="Apple-converted-space"> </span>GWT.</p>
<p><br class="Apple-interchange-newline" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwt.com.br/2008/09/11/introducao-ao-gwt/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Concurso “The Biggest Ever GWT Giveaway Contest!”</title>
		<link>http://www.gwt.com.br/2008/09/10/concurso-the-biggest-ever-gwt-giveaway-contest/</link>
		<comments>http://www.gwt.com.br/2008/09/10/concurso-the-biggest-ever-gwt-giveaway-contest/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 10:55:44 +0000</pubDate>
		<dc:creator>Marcelo Emanoel</dc:creator>
		
		<category><![CDATA[Notí­cias]]></category>

		<category><![CDATA[concurso]]></category>

		<category><![CDATA[gwt]]></category>

		<category><![CDATA[livro]]></category>

		<category><![CDATA[prêmio]]></category>

		<guid isPermaLink="false">http://www.gwt.com.br/2008/09/10/concurso-the-biggest-ever-gwt-giveaway-contest/</guid>
		<description><![CDATA[O GWT Site está fazendo um concurso de aplicações, opiniões e projetos sobre gwt. O site é em inglês, bem como serão as participações no concurso.  As premiações são um caso a parte. 
* 5 Licensas do Ext GWT Developer
* 3 Licencas de 1 ano do GWT Designer
* 2 Cópias do livro Google Web [...]]]></description>
			<content:encoded><![CDATA[<p>O <a href="http://www.gwtsite.com">GWT Site</a> está fazendo um concurso de aplicações, opiniões e projetos sobre gwt. O site é em inglês, bem como serão as participações no concurso.  As premiações são um caso a parte. </p>
<p>* 5 Licensas do Ext GWT Developer<br />
* 3 Licencas de 1 ano do GWT Designer<br />
* 2 Cópias do livro Google Web Toolkit Applications escrito por Ryan Dewsbury<br />
* 3 Cópias do livro GWT in Practice escrito por Robert Cooper e Charlie Collins<br />
* 3 Cópias do livro Pro Web 2.0 Development With GWT escrito por Jeff Dwyer</p>
<p>Para participar existem 4 opções:<br />
<span id="more-65"></span></p>
<ol>
<li>Se inscrever no RSS do GWT Site via email, corresponde a 1 cupom.</li>
<p>Escrever um comentário no post correspondente do blog deles com alguma das opções abaixo. Todas valem 4 cupons.</p>
<li> Para os novatos em GWT, efetuar o download da release 1.5 e brincar um pouco com ela. Após algum tempo, escrever para eles dando a sua opinião, comparando o framework com as tecnologias que você usa atualmente e comentando se você pretende continuar usando gwt ou não e por que.</li>
<li>         Enviar um projeto em GWT que você esteja desenvolvendo, open source ou como hobby. Enviar um link para o projeto.
</li>
<li>Escrever uma review da sua biblioteca e/ou ferramenta e/ou livro favoritos bem como uma aplicação baseada em GWT.</li>
</ol>
<p>O concurso no total oferece 16 prêmios e o número máximo de cupons por participante é de 5. Então corra e participe!</p>
<p>Link para o Concurso: <a href="http://www.gwtsite.com/the-biggest-ever-gwt-giveaway-contest/">http://www.gwtsite.com/the-biggest-ever-gwt-giveaway-contest/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwt.com.br/2008/09/10/concurso-the-biggest-ever-gwt-giveaway-contest/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Evento: Aniversário do CEJUG</title>
		<link>http://www.gwt.com.br/2008/09/09/evento-aniversario-do-cejug/</link>
		<comments>http://www.gwt.com.br/2008/09/09/evento-aniversario-do-cejug/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 23:02:25 +0000</pubDate>
		<dc:creator>Marcelo Emanoel</dc:creator>
		
		<category><![CDATA[Notí­cias]]></category>

		<category><![CDATA[curtas]]></category>

		<category><![CDATA[CEJUG]]></category>

		<category><![CDATA[Eventos]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[SUN]]></category>

		<guid isPermaLink="false">http://www.gwt.com.br/2008/09/09/evento-aniversario-do-cejug/</guid>
		<description><![CDATA[O Ceará Java User Group está completando 6 anos no dia 16 de setembro e para comemorar vai trazer a Fortaleza, com o apoio da Sun Microsystems e do SouJava, Kohsuke Kawaguchi e Maurício Leal. Para completar essa grande festa, o CEJUG trará Bruno Pereira, da Concrete Solutions e Globo.com!
Aos que puderem participar será um [...]]]></description>
			<content:encoded><![CDATA[<p>O Ceará Java User Group está completando 6 anos no dia 16 de setembro e para comemorar vai trazer a Fortaleza, com o apoio da Sun Microsystems e do SouJava, Kohsuke Kawaguchi e Maurício Leal. Para completar essa grande festa, o CEJUG trará Bruno Pereira, da Concrete Solutions e Globo.com!<br />
Aos que puderem participar será um evento bastante interessante. Compareçam! Estarei lá também participando. </p>
<p><a href="http://www.cejug.org/pages/viewpage.action?pageId=30900360"><br />
<img src="http://silveiraneto.net/wp-content/uploads/2008/09/aniversario_cejug_banner1.gif"/><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gwt.com.br/2008/09/09/evento-aniversario-do-cejug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Utilizando um ImageBundle</title>
		<link>http://www.gwt.com.br/2008/09/08/utilizando-um-imagebundle/</link>
		<comments>http://www.gwt.com.br/2008/09/08/utilizando-um-imagebundle/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 00:28:35 +0000</pubDate>
		<dc:creator>Marcelo Emanoel</dc:creator>
		
		<category><![CDATA[Básico]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Deferred Binding]]></category>

		<category><![CDATA[gwt]]></category>

		<category><![CDATA[ImageBundle]]></category>

		<guid isPermaLink="false">http://www.gwt.com.br/2008/09/08/utilizando-um-imagebundle/</guid>
		<description><![CDATA[Se algum dia você já se deparou com a seguinte situação: criar uma aplicação em web que possua diversas imagens estáticas (por exemplo ícones) e você utilizou css para selecionar e carregar as imagens... você já deve ter percebido que para cada imagem da aplicação uma nova conexão é aberta só para buscar essa imagem... [...]]]></description>
			<content:encoded><![CDATA[<p>Se algum dia você já se deparou com a seguinte situação: criar uma aplicação em web que possua diversas imagens estáticas (por exemplo ícones) e você utilizou css para selecionar e carregar as imagens... você já deve ter percebido que para cada imagem da aplicação uma nova conexão é aberta só para buscar essa imagem... e as demais só serão carregadas uma após a outra... pois é... para essa situação nada melhor que um ImageBundle! Para aqueles que ainda não conhecem essa funcionalidade vou dar uma pequena e rápida introdução. Confiram após o break <img src='http://www.gwt.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-61"></span></p>
<p>Um ImageBundle é um objeto que automaticamente pega todos os ícones mensionados anteriormente e os une em uma única imagem fazendo com que n requests ao servidor sejam condensadas em UMA ÚNICA!!! Além disso as imagens são "recortadas" depois tornando transparente ao usuário que se trata de uma mesma imagem. O procedimento de "recortar" novamente a figura depois de carregada é conhecido como "clipping" e é implementado através de CSS. </p>
<p>Parece complicado não é? Pois é... pode até parecer... mas utilizando GWT isso fica fácil fácil... e com algumas linhas de código tudo isso é rapidamente desenvolvido sem dores de cabeça e de maneira transparente ao programador!!!!! Isso é possível graças ao mecanismo batizado de Deferred Binding do GWT que fornece pontos de extensão ao framework. Em um próximo tópico explicarei como o Deferred Binding funciona e o que você pode fazer com essa funcionalidade. </p>
<p>Voltando ao ImageBundle....</p>
<p>Tudo que você precisará para a utlização de um ImageBundle é implementar uma interface que extende ImageBundle e criar métodos que retornam um object <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/AbstractImagePrototype.html">AbstractImagePrototype</a> esse método deve conter anotações especificando quais recursos (leia-se imagens) devem ser carregados pelo compilador. O objeto AbstractImagePrototype possui um método muito útil que é o createImage() que retorna nada mais nada menos que a imagem que precisamos! Dito isso chega de conversa fiada e vamos ao código <img src='http://www.gwt.com.br/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Para exemplificar a técnica vamos construir um componente bastante usado em aplicações desktop, uma ToolBar. Como se sabe em uma ToolBar é muito comum o uso de ícones representando ferramentas ou funcionalidades do software. É nesse momento que o ImageBundle entra em cena. Para a criação do exemplo vou ilustrar uma ToolBar com e sem ImageBundle. Para verificar o número de conexões geradas para buscar a imagem utilizaremos o firebug, extensão do firefox que facilita e muito a vida dos desenvolvedores web. </p>
<p>As imagens utilizadas no exemplo bem como o código fonte estão disponíveis no final do post em arquivos zip.</p>
<p>Inicialmente a classe que representa o componente ToolBar:</p>
<div class="igBar"><span id="ljava-10"><a href="#" onclick="javascript:showCodeTxt('java-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-10">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package br.<span style="color: #006600;">com</span>.<span style="color: #006600;">gwt</span>.<span style="color: #006600;">client</span>.<span style="color: #006600;">toolbar</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.Composite;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.FlexTable;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.ButtonBase;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.SimplePanel;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * Uma ToolBar nada mais é senão um painel com botões que representam ações ou </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * funcionalidades de um sistema. Geralmente os botões da toolbar utilizam ícones </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * em vez de textos, entretanto esse detalhe não será tratado nessa classe.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @author Marcelo Emanoel</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ToolBar <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=allinurl%3AComposite+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Composite</span></a> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> FlexTable toolbarTable;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">int</span> buttonCount;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> ToolBar<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; setupStyles<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Inicializações</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">void</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; toolbarTable = <span style="color: #000000; font-weight: bold;">new</span> FlexTable<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; buttonCount = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; SimplePanel panel = <span style="color: #000000; font-weight: bold;">new</span> SimplePanel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; panel.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>toolbarTable<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; initWidget<span style="color: #66cc66;">&#40;</span>panel<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Adiciona um botão à ToolBar.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @param button</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> addButton<span style="color: #66cc66;">&#40;</span>ButtonBase button<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; toolbarTable.<span style="color: #006600;">setWidget</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>, buttonCount++, button<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Seta os estilos dos componentes internos e da ToolBar.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">void</span> setupStyles<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; setStylePrimaryName<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"br_com_gwt_ToolBar"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; toolbarTable.<span style="color: #006600;">setStylePrimaryName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"br_com_gwt_ToolBar"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Retorna o número de botões existentes na ToolBar.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @return</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">int</span> getButtonCount<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> buttonCount;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Até aqui acredito que não temos muitas surpresas. A ToolBar é composta por uma FlexTable e botões adicionados a ela. Além disso é possível contar quantos botões foram inseridos. </p>
<p>Agora vamos verificar como foi feito o ImageBundle.</p>
<div class="igBar"><span id="ljava-11"><a href="#" onclick="javascript:showCodeTxt('java-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-11">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package br.<span style="color: #006600;">com</span>.<span style="color: #006600;">gwt</span>.<span style="color: #006600;">client</span>.<span style="color: #006600;">toolbar</span>.<span style="color: #006600;">imagebundle</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.AbstractImagePrototype;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.ImageBundle;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * BlogBundle contém imagens relacionadas à atividades de um blog. Adicionar, </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * remover, inserir videos bem como configurar alguma coisa no blog.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * As imagens foram retiradas do &lt;a href=&quot;http://www.iconspedia.com/&quot;&gt;IconsPedia&lt;/a&gt;. Todos os direitos reservados.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @author Marcelo Emanoel</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> BlogBundle <span style="color: #000000; font-weight: bold;">extends</span> ImageBundle <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Imagem de adicão.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @return</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; @Resource<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"br/com/gwt/resources/add.png"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> AbstractImagePrototype add<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Imagem de remoção.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @return</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; @Resource<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"br/com/gwt/resources/remove.png"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> AbstractImagePrototype remove<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Imagem de video.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @return</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; @Resource<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"br/com/gwt/resources/video.png"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> AbstractImagePrototype video<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Imagem de configuração.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @return</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; @Resource<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"br/com/gwt/resources/settings.png"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> AbstractImagePrototype settings<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Imagem de ok.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @return</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; @Resource<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"br/com/gwt/resources/check.png"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> AbstractImagePrototype check<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Finalmente como utilizar o ImageBundle e a ToolBar juntos.</p>
<div class="igBar"><span id="ljava-12"><a href="#" onclick="javascript:showCodeTxt('java-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-12">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package br.<span style="color: #006600;">com</span>.<span style="color: #006600;">gwt</span>.<span style="color: #006600;">client</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import br.com.gwt.client.toolbar.ToolBar;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import br.com.gwt.client.toolbar.imagebundle.BlogBundle;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.core.client.EntryPoint;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.core.client.GWT;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.Window;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.Button;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.ClickListener;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.DockPanel;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.HTML;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.Image;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.PushButton;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.RootPanel;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import com.google.gwt.user.client.ui.Widget;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * Entry point classes define &lt;code&gt;onModuleLoad()&lt;/code&gt;.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ImageBundleTest <span style="color: #000000; font-weight: bold;">implements</span> EntryPoint <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * This is the entry point method.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Instancia duas ToolBars uma com as imagens adquiridas via ImageBundle e a </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * outra criada com imagens extraídas por css.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; *&nbsp; O intuito é verificar o número de conexões extras causadas pela ausência</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; *&nbsp; do ImageBundle. </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> onModuleLoad<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Instancia-se o ImageBundle via Deferred Binding.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; BlogBundle blogBundle = GWT.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span>BlogBundle.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ToolBar blogTools = <span style="color: #000000; font-weight: bold;">new</span> ToolBar<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ToolBar dbTools = <span style="color: #000000; font-weight: bold;">new</span> ToolBar<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; DockPanel dock = <span style="color: #000000; font-weight: bold;">new</span> DockPanel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; RootPanel.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>dock<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dock.<span style="color: #006600;">setStylePrimaryName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"dock"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AHTML+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">HTML</span></a> center = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AHTML+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">HTML</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dock.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>center, DockPanel.<span style="color: #006600;">CENTER</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dock.<span style="color: #006600;">setCellHeight</span><span style="color: #66cc66;">&#40;</span>center, <span style="color: #ff0000;">"100%"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Instancia todas as imagens do ToolBar que usa ImageBundle.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AImage+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Image</span></a> addImg = blogBundle.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">createImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AImage+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Image</span></a> removeImg = blogBundle.<span style="color: #006600;">remove</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">createImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AImage+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Image</span></a> checkImg = blogBundle.<span style="color: #006600;">check</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">createImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AImage+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Image</span></a> settingsImg = blogBundle.<span style="color: #006600;">settings</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">createImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; blogTools.<span style="color: #006600;">addButton</span><span style="color: #66cc66;">&#40;</span>createButton<span style="color: #66cc66;">&#40;</span>addImg, blogTools.<span style="color: #006600;">getButtonCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; blogTools.<span style="color: #006600;">addButton</span><span style="color: #66cc66;">&#40;</span>createButton<span style="color: #66cc66;">&#40;</span>removeImg, blogTools.<span style="color: #006600;">getButtonCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; blogTools.<span style="color: #006600;">addButton</span><span style="color: #66cc66;">&#40;</span>createButton<span style="color: #66cc66;">&#40;</span>checkImg, blogTools.<span style="color: #006600;">getButtonCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; blogTools.<span style="color: #006600;">addButton</span><span style="color: #66cc66;">&#40;</span>createButton<span style="color: #66cc66;">&#40;</span>settingsImg, blogTools.<span style="color: #006600;">getButtonCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dbTools.<span style="color: #006600;">addButton</span><span style="color: #66cc66;">&#40;</span>createEmptyButton<span style="color: #66cc66;">&#40;</span>dbTools.<span style="color: #006600;">getButtonCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #ff0000;">"feather"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dbTools.<span style="color: #006600;">addButton</span><span style="color: #66cc66;">&#40;</span>createEmptyButton<span style="color: #66cc66;">&#40;</span>dbTools.<span style="color: #006600;">getButtonCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">"db"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dock.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>blogTools, DockPanel.<span style="color: #006600;">NORTH</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dock.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>dbTools, DockPanel.<span style="color: #006600;">SOUTH</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Método de fábrica. Cria botões a partir de uma posição e o nome do estilo</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * que deverá ser atribuído ao botão.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @param pos</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @param id</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * @return</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AButton+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Button</span></a> createEmptyButton<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> pos, <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> id<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AButton+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Button</span></a> simpleButton = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AButton+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Button</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; simpleButton.<span style="color: #006600;">setTitle</span><span style="color: #66cc66;">&#40;</span>pos+<span style="color: #ff0000;">""</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; simpleButton.<span style="color: #006600;">setStylePrimaryName</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; simpleButton.<span style="color: #006600;">addClickListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ClickListener<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> onClick<span style="color: #66cc66;">&#40;</span>Widget sender<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AWindow+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Window</span></a>.<span style="color: #006600;">alert</span><span style="color: #66cc66;">&#40;</span>sender.<span style="color: #006600;">getTitle</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> simpleButton;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: norm