Xzajo's Weblog

All | Java | nbxdoclet | NetBeans | Personal | Project Extensions | Sun | Testing
« NetBeans JavaHelp... | Main | NBXdoclet cooperates... »
20060411 Tuesday April 11, 2006

Project Extensions (natures) Wizard for NetBeans 5.0

Project Extensions plugin is implementation of project natures for NetBeans 5.0. Project natures extends functionality of NetBeans projects. Currently it consists of these features:

I've already blogged about few Project Extensions ( Test NG, Java HelpSet validation, Emma code coverage). All these extensions were created with Project Extension Wizard.

To create new project extension is very simple with Project Extension Wizard. It will be demonstrated on creating RMI project extension for J2SE project. The Java RMI (Remote Method Invocation) system allows an object running in one Java Virtual Machine (VM) to invoke methods on an object running in another Java VM. It is necessary to generate stub and skeleton classes using rmic compiler to establish connection between client and server parts. The rmic compiler must to be run on compiled class of implementation of RMI object.

At first we create simple J2SE project with modified build script. We add two new ant's tasks to main build script (build.xml in root folder of project) :

  <target name  = "-post-compile" depends  = "rmi-post-compile"/> 
    
     <target name  = "rmi-post-compile" depends  = "-do-compile"> 
         <property name  = "remote.impl.filter" value  = "**/*RemoteImpl.class"/> 
         <rmic base  = "${build.classes.dir}" includes  = "${remote.impl.filter}"/> 
     </target> 
   
    

The -post-compile ant task is empty because the project extension wizard doesn't copy the standard project ant tasks to the project extension template. We can to create implementation of a RMI service and test it now. We expect that everything is alright.

Now it's time start to create a project extension using project extension wizard:

In the second Panel select the project with modified build script and clicked to Next button. After clicking to Next button Customize Project Extension Panel is shown.

The wizard automatically parses the modified build script and shows all new targets. The -post-compile is not added to table with available ant tasks because more project extensions cannot override the same target. Only dependencies between targets are stored to dependencies table.

If we assign to ant target display name the target will be represented by action in popup of project extension node in Project Extensions window. There is not necessary to change dependencies between targets. It will be usefull for example when dependencies between different Project extensions are defined. Click to next button you can specify classpath for the project extension. The libraries are got from Library manager.

RMI doesn't need extra library on the classpath. Click to Next button to show the last panel of wizard. There can be specified the name, display name, icon, post create action and customizer. The post create action is invoked after adding project extension to project. It is useful for example when it is necessary to initialize some properties. The customizer panel is shown in JDialog when is performed Properties action from project extension node.

After clicking to "Finish" button the Project extension template will be generated.

rmiext.xml - descriptor

 <featuredefs> 
     <featuredef  name =  "RMICompiler"customizerClassRef = "rmiext-RmiextCustomizer.instance"> 
         <title>RMICompiler</title> 
         <icon>rmiext/rmi.png</icon> 
         <project> 
             <type>org.netbeans.modules.java.j2seproject</type> 
         </project> 
         <actions> 
             <anttask> 
                 <name>rmi-post-compile</name> 
                 <title>RMI Compiler</title> 
             </anttask> 
         </actions> 
         <dependsOn> 
             <anttask>rmi-post-compile</anttask> 
             <featureName>org.netbeans.modules.java.j2seproject</featureName> 
             <anttaskInFeature>-do-compile</anttaskInFeature> 
         </dependsOn> 
         <dependsFrom> 
             <anttask>rmi-post-compile</anttask> 
             <featureName>org.netbeans.modules.java.j2seproject</featureName> 
             <anttaskInFeature>-post-compile</anttaskInFeature> 
         </dependsFrom> 
         <usedtargets> 
             <usedtarget>rmi-post-compile</usedtarget> 
         </usedtargets> 
         <velocityTemplate vmFile = "Rmiext.vm"/> 
     </featuredef> 
 </featuredefs> 

rmiext.vm - velocity template
<target name="rmi-post-compile">
  <property name="remote.impl.filter" value="**/*RemoteImpl.class"/>
  <rmic base="${build.classes.dir}" includes="${remote.impl.filter}"/>
</target>
And references are added to layer.xml
<filesystem> 
     <folder name = "velocity"> 
         <folder name = "build"> 
             <file name = "Rmiext.xml"url = "Rmiext.xml"/> 
         </folder > 
         <folder name = "customizers"> 
             <file name = "rmiext-RmiextCustomizer.instance"/> 
         </folder > 
         <folder name = "templates"> 
             <file name = "Rmiext.vm" url = "Rmiext.vm"/> 
         </folder> 
     </folder> 
 </filesystem>

The project extension was created. No line of of code was written. So we can try to run the module. And Test the nature. The Nature can be added to project from popup in Project Extensions window.

The project extension node is shown bellow.

The RMIC compile is not run either on project building or from RMI Project extension popup.

This wizard is available in NBXdoclet Modules Development plugin. The plugin available on my update center. The NBXdoclet Modules Development plugin depends on NetBeans Module Development Environment U1.

Posted by xzajo ( Apr 11 2006, 11:09:16 AM CEST ) Permalink Comments [19]

Comments:

Nice ! - but of course with Java 1.5 you do not need rmic anymore since the stubs are generated dynamically. Thanx anyhow it shows the idea. B-)

Posted by bernd on April 18, 2006 at 07:24 AM CEST #

北京婚庆 北京婚庆公司 瑜伽 北京瑜伽

Posted by 传奇私服 on April 11, 2007 at 08:26 AM CEST #

进销存 erp软件 生产管理软件 风柜

Posted by 传奇私服 on April 11, 2007 at 08:26 AM CEST #

安全工程师 造价工程师 房地产估价师 进销存软件

Posted by 传奇私服 on April 11, 2007 at 08:27 AM CEST #

4d影院 动感影院 厨房设备 油烟净化器

Posted by 传奇私服 on April 11, 2007 at 08:28 AM CEST #

租赁发电机 康明斯 出租发电机 空气过滤器

Posted by 传奇私服 on April 11, 2007 at 08:28 AM CEST #

发电机组 发电机出租 发电设备 发电机租赁

Posted by 传奇私服 on April 11, 2007 at 08:29 AM CEST #

上海猎头 北京猎头 猎头公司 发电机

Posted by 传奇私服 on April 11, 2007 at 08:29 AM CEST #

猎头 猎头公司 猎头顾问 广州猎头

Posted by 传奇私服 on April 11, 2007 at 08:29 AM CEST #

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

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

Project Extensions plugin is implementation of project natures

Posted by runescape money on November 10, 2007 at 09:23 AM CET #

The best of luck! Best wishes! Best regards!
http://www.bjseek.com.cn
http://www.bjxlzx.cn
http://www.sense.com.cn
http://jglsx.blog.sohu.com/
http://blog.china.alibaba.com/blog/jglsx.html
http://jglsx.blog.hexun.com/
http://tw.netsh.com/eden/blog/ctl_eden_blog.php?iBlogID=2610970
http://tw.netsh.com/eden/blog/ctl_eden_blog.php?iBlogID=2632783
http://blog.soufun.com/blog_12178456.html
http://blog.china-pub.com/blog.asp?name=jlb148140960
http://www.phpchina.com/38743
http://hexun.com/jglsx/default.html
http://www.xiongcaocao.com/?sid=116
http://jlb999.blog.163.com/
http://jjllbb.eomoo.com/user18/jlb148140960/index.shtml
http://hexun.com/xicao1/default.html
http://hexun.com/xicao3/default.html
http://hexun.com/xicao6/default.html
http://hexun.com/xicao9/default.html
http://hexun.com/xicao2/default.html
http://hexun.com/xicao7/default.html
http://hexun.com/xicao4/default.html
http://hexun.com/xicao5/default.html
http://hexun.com/xicao8/default.html
http://hexun.com/zwwsl/default.html
http://xicao6.blog.hexun.com/
http://xicao7.blog.hexun.com/
http://xicao8.blog.hexun.com/
http://xicao9.blog.hexun.com/
http://zwwsl.blog.hexun.com/
http://xicao1.blog.hexun.com/
http://xicao2.blog.hexun.com/
http://xicao3.blog.hexun.com/
http://xicao4.blog.hexun.com
http://xicao5.blog.hexun.com
http://tzgoogle.blog.hexun.com
http://hexun.com/tzgoogle/default.html
http://blog.ccidnet.com/blog-htm-uid-71265.html
http://hexun.com/baom/default.html
http://baom.blog.hexun.com
http://www.0576w.cn/
http://www.0576w.cn/catalog.asp?cate=1
http://www.0576w.cn/catalog.asp?cate=2
http://www.0576w.cn/catalog.asp?cate=3
http://www.0576w.cn/catalog.asp?cate=5
http://www.0576w.cn/catalog.asp?cate=6
http://www.0576w.cn/post/google.html

Posted by 数据恢复 on February 14, 2008 at 01:48 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:16 PM CET #

We will always support the good things:
<A href="http://www.storeingame.com">wow gold</A>
<A href="http://www.storeingame.com/aoc-gold.htm">aoc gold</A>
<A href="http://www.storeingame3.cn/Machine.htm">Printing Machine</A>
<A href="http://www.storeingame3.cn/">Printing Machine</A>

Posted by lvbugai on July 09, 2008 at 09:01 AM CEST #

We will always support the good things
[URL=http://www.storeingame.com]wow gold[/URL]
[URL=http://www.storeingame.com/aoc-gold.htm]aoc gold[/URL]
[URL=http://www.storeingame3.cn]Printing Machine[/URL]
[URL=http://www.storeingame3.cn/Machine.htm]Printing Machine[/URL]

Posted by lvbugai on July 09, 2008 at 09:02 AM CEST #

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

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

Post a Comment:

Comments are closed for this entry.

Calendar

RSS Feeds

Search

Links

Navigation

Referers