Adding More Power to Menus in NetBeans IDE 4.1

One things I've missed in standard projects is that you can't create contextual menus and attach Ant targets to them. This is possible for free-form projects. The difference is, I guess, because the philosophy behind these projects is different. When working with a standard project, you don't have your own Ant scripts and so the IDE provides them for you. The assumption is that you have no intention of extending these IDE-given Ant scripts too much, otherwise you'd be using a free-form project. However, there's more flexibility in standard projects than I thought. It's all documented in the build.xml template: "There exist several targets which are by default empty and which can be used for execution of your tasks. These targets are usually executed before and after some main targets."

Here is a complete list of these targets:

-pre-init:                 called before initialization of project propertie
-post-init:                called after initialization of project properties
-pre-compile:              called before javac compilation
-post-compile:             called after javac compilation
-pre-compile-single:       called before javac compilation of single file
-post-compile-single:      called after javac compilation of single file
-pre-compile-test:         called before javac compilation of JUnit tests
-post-compile-test:        called after javac compilation of JUnit tests
-pre-compile-test-single:  called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar:                  called before JAR building
-post-jar:                 called after JAR building
-post-clean:               called after cleaning build products

The one I've found most useful so far is -post-jar. In so many situations, such as when developing NetBeans Modules, one needs a JAR file before going any further. And for these situations this target is really useful. You can just refer to any of your own targets in this target, and it will be executed after the JAR is created, which happens when the Build Project menu is used. This means that you've actually added your own targets to the Build Project menu. For example, this is how I build NetBeans Modules:

<target name="-post-jar" depends="create-xml-file-for-module,create-nbm,reload" />

So, the revelation for me was that even though standard projects are limited in that they don't allow for customized contextual menus, the existing contextual menus can be extended, to the extent that my not being able to create my own contextual menus for standard projects doesn't make much difference.

Comments:

im unable to use webservice which is made by netbean ide in .Net

Posted by guest on October 10, 2005 at 11:25 PM PDT #

im unable to use webservice which is made by netbean ide in .Net

Posted by shilpa on October 10, 2005 at 11:25 PM PDT #

how to make a web service in netbean ide to be used by .Net client help me

Posted by shilpa pawar on October 10, 2005 at 11:30 PM PDT #

how to make a web service in netbean ide to be used by .Net client help me

Posted by shilpa pawar on October 10, 2005 at 11:32 PM PDT #

Sure, please specify exactly what you did and where things went wrong. I'll try to help.

Posted by Geertjan on October 17, 2005 at 03:44 AM PDT #

fgnjgy

Posted by seeta on March 01, 2006 at 04:18 PM PST #

lhjgkjyhgh

Posted by lalalala on April 25, 2006 at 01:55 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today