Xzajo's Weblog

All | Java | nbxdoclet | NetBeans | Personal | Project Extensions | Sun | Testing
« GWT - revolution in... | Main | P2P programming »
20060615 Thursday June 15, 2006

Netbeans met GWT and more GWT components

I wrote about my first experience with GWT in my last blog. Yesterday I experimented with GWT application in NetBeans. The new GWT plugin contains GWT project type. It is now easy build, run and debug GWT projects in NetBeans. The code completion with javadoc is also available. Tomas will publish his plugin early, I hope.

On http://gwt.components.googlepages.com/ are more GWT components. My favorite is Auto-Completion Textbox. It allows to add Code completion to Texbox on web page. The AutoCompleteTextBox component extends TextBox class. It adds to TextBox one new useful method:

public void setCompletionItems(CompletionItems items)
The CoompletionItems type is code completion provider:
public interface CompletionItems {
        /**
         * Returns an array of all completion items matching
         * @param match The user-entered text all compleition items have to match
         * @return      Array of strings
         */
        public String[] getCompletionItems(String match);
}
I wrote a simple application with AutoCompleteTextBox. The class with GWT EntryPoint is below. It shows code completion for names.
public class Main implements EntryPoint {
    
    class NameCompletionItem implements CompletionItems {
        public String[] getCompletionItems(String match) {
            ArrayList list = new ArrayList();
            
            String values[] =  new String[]{"roumen","radim","xzajo","geertjan","lukas"}; 
            
            String lowerMatch = match.toLowerCase();
            for (int i = 0 ; i < values.length ; i++) {
                String value = values[i];
                if (value.startsWith(lowerMatch)) {
                    list.add(value);
                }
            }
            String retVals [] = new String[list.size()];
            
            for (int i = 0 ; i < list.size() ; i++) {
               retVals[i] = (String) list.get(i); 
            }
            return retVals;
        }
        
        
    }
    public void onModuleLoad() {
        AutoCompletionTexBox textBox = new AutoCompletionTexBox();
        textBox.setCompletionItems(new NameCompletionItem());
        RootPanel.get().add(textBox);
    }
    
}

Conversion between ArrayList and array of Strings doesn't work on client side of GWT (Collection.toArray(Object[] array). The gwt compiler shows an error. Therefore I used the for loop. Screenshot with code completion in browser is below.


Posted by xzajo ( Jun 15 2006, 12:50:07 AM CEST ) Permalink Comments [12]

Comments:

I've added the template of NetBeans project for Google Web Toolkit application into the NetBeans CVS under the contrib/gwttemplate. You can use this module to create, run and debug a GWT application from the NetBeans IDE.

Posted by Tomas Zezula on June 15, 2006 at 10:16 AM CEST #

Excellent! Just excellent!

Posted by Surya on June 15, 2006 at 07:52 PM CEST #

nice

Posted by 84.105.213.110 on June 15, 2006 at 10:10 PM CEST #

excelent job.

Posted by any on June 17, 2006 at 02:48 PM CEST #

Great Work. Can this template add an ant target to create a war file?

Posted by Darren on September 01, 2006 at 08:10 PM CEST #

Can anyone help with information on exactly how to setup the GWT Project template. 1. Where do I get the files 2. WHere in the netbeans directory tree do I deposit them. Particularly the Info.xml file. Thanks in advance for your help. Melody

Posted by Melody Pedzisai on September 08, 2006 at 05:09 PM CEST #

wow power leveling wow power leveling wow powerleveling wow powerleveling 搬家公司

Posted by 水无痕 on July 21, 2007 at 05:25 AM CEST #

I'm really surprised

Posted by powerleveling on November 09, 2007 at 02:48 PM CET #

<a href="http://www.power-leveling.us">cheap world of warcraft power leveling </a>power-leveling.us provides <a href="http://www.power-leveling.us"> wow power leveling</a> and <a href="http://www.power-leveling.us">world of warcraft power leveling </a> service.
<a href="http://www.wowpowerleveling.info">cheap world of warcraft power leveling </a> - We provide the lastest information for <a href="http://www.wowpowerleveling.info">MMO games and device</a>.

Posted by kevin on November 14, 2007 at 07:57 AM CET #

http://www.wowgolds.co.uk wow gold http://www.wowgolds.co.uk cheap wow gold http://www.wowgolds.co.uk buy wow gold http://www.wowgolds.co.uk world of warcraft gold http://www.wowgolds.co.uk wow http://www.wowgolds.co.uk world of warcraft http://www.wowgolds.co.uk/wow-gold.html wow gold http://www.wowgolds.co.uk/warrior.html WoW Warrior http://www.wowgolds.co.uk/hunter.html WoW Hunter http://www.wowgolds.co.uk/rogue.html WoW Rogue http://www.wowgolds.co.uk/paladin.html WoW Paladin http://www.wowgolds.co.uk/shaman.html WoW Shaman http://www.wowgolds.co.uk/priest.html WoW Priest http://www.wowgolds.co.uk/mage.html WoW Mage http://www.wowgolds.co.uk/druid.html WoW Druid http://www.wowgolds.co.uk/warlock.html WoW Warlock http://www.powerleveling2.cn power leveling http://www.powerleveling2.cn powerleveling http://www.wowpowerleveling2.cn wow power leveling http://www.wowpowerleveling2.cn wow powerleveling http://www.wowpro.cn wow guides http://www.wowmmo.cn wow tips http://ggtop.nbatop.com google排名 http://ggtop.nbatop.com google左侧排名 http://ggtop.nbatop.com google排名服务 http://www.baidupaiming.net 百度推广 http://www.baidupaiming.net 百度排名 http://www.fzqsnet.cn 网站推广 http://www.thebiz8.com 商业吧 http://www.thebiz8.com/jichuang.html 机床 http://www.thebiz8.com/leddeng.html LED灯 http://www.thebiz8.com/dianchi.html 电池 http://www.thebiz8.com/suliao.html 塑料 http://www.thebiz8.com/shexiangji.html 摄像机 http://www.thebiz8.com/yimin.html 移民 http://www.thebiz8.com/jiachun.html 甲醇 http://www.thebiz8.com/ranliao.html 染料 http://www.0591qs.cn 福州热线 http://www.sportblog.org.cn 体育博客 http://www.stockblog.org.cn 股票博客 http://www.gameblog.org.cn 游戏博客 http://www.cheap-wow-gold.org.cn 魔兽博客 http://www.excamtest.cn 考试博客 http://www.carblog.org.cn 汽车博客 http://www.houseblog.org.cn 房产博客 http://www.pcblog.org.cn 电脑博客 http://powerlin518.iblog.com powerlin518 http://www.xcelwebdesign.com logo design http://www.xcelwebdesign.com website design http://www.xcelwebdesign.com web design http://www.shangbiaodesign.cn 商标设计

Posted by power leveling on March 20, 2008 at 04:33 PM CET #

http://sunnyren.weblog.com/
this blog introduces jewelry products and fashion jewelry

Posted by fashion jewelry on October 31, 2008 at 06:47 AM CET #

Post a Comment:

Comments are closed for this entry.

Calendar

RSS Feeds

Search

Links

Navigation

Referers