library

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Natural Language Processing
51.Net
52.Parser
53.PDF
54.Portal
55.Profiler
56.Project Management
57.Report
58.RSS RDF
59.Rule Engine
60.Science
61.Scripting
62.Search Engine
63.Security
64.Sevlet Container
65.Source Control
66.Swing Library
67.Template Engine
68.Test Coverage
69.Testing
70.UML
71.Web Crawler
72.Web Framework
73.Web Mail
74.Web Server
75.Web Services
76.Web Services apache cxf 2.2.6
77.Web Services AXIS2
78.Wiki Engine
79.Workflow Engines
80.XML
81.XML UI
Java Source Code / Java Documentation  » IDE Netbeans » library 
License:
URL:
Description:
Package NameComment
abc.xyz
demo
foo.bar.baz
foo.bar.baz_unshared
foo.bar_invisible
foo_shared
gui.javahelp
gui.propertyeditors
gui.propertyeditors.data
gui.propertyeditors.utilities
gui.windowsystem
ims
org.apache.jmeter.module
org.apache.jmeter.module.actions
org.apache.jmeter.module.cookies
org.apache.jmeter.module.exceptions
org.apache.jmeter.module.integration
org.apache.jmeter.module.loadgenerator.spi.impl
org.apache.jmeter.module.nodes
org.apache.jmeter.module.wizards
org.apache.tools.ant.module
org.apache.tools.ant.module.api Examination and execution of Ant build scripts. Few modules outside of the Ant module suite will need to use this package.
org.apache.tools.ant.module.api.support Utilities for examining and running Ant scripts. {@link org.apache.tools.ant.module.api.support.ActionUtils} is primarily of interest to project type providers which need to run Ant targets to implement project actions. {@link org.apache.tools.ant.module.api.support.TargetLister} is not likely to be useful outside the Ant module suite.
org.apache.tools.ant.module.bridge
org.apache.tools.ant.module.bridge.impl
org.apache.tools.ant.module.loader
org.apache.tools.ant.module.nodes
org.apache.tools.ant.module.run
org.apache.tools.ant.module.spi Ways of influencing how Ant is run inside NetBeans.

{@link org.apache.tools.ant.module.spi.AutomaticExtraClasspathProvider} will be useful to modules which bundle libraries that may be needed for some optional tasks shipped with Ant.

{@link org.apache.tools.ant.module.spi.AntLogger}, together with the auxiliary interfaces {@link org.apache.tools.ant.module.spi.AntSession}, {@link org.apache.tools.ant.module.spi.AntEvent}, and {@link org.apache.tools.ant.module.spi.TaskStructure}, provides a powerful way of controlling the appearance of Ant process output.

Registering Tasks and Types

The Ant module provides a way for other modules to register custom Ant tasks and types that will automatically be available to any scripts running inside NetBeans.

  1. Do consider this facility for tasks which would only make sense running inside the NetBeans VM, typically making direct Java method calls to internal NetBeans objects.

  2. Do not consider this facility for tasks which would be useful in any context. You may bundle up such task JARs in ant/extra/*.jar in the NetBeans distribution and recommend users use them via <taskdef> with a <classpath>, as they would any other third-party task libraries.

Examples of likely tasks: opening the GUI-configured web browser on a URL, reloading a NetBeans test module, attaching the NetBeans debugger to a running application, etc. You could consider these things IDE scripting using Ant.

Registration is simple. (Assume for sake of illustration that the code name base of the host module is org.netbeans.modules.foo; in the following text, replace this package sequence with the actual code name base of your module, using whatever separator character is indicated.) Create a JAR file containing the task class(es), named org-netbeans-modules-foo.jar. Create an entry in that JAR org/netbeans/modules/foo/antlib.xml listing tasks (or types, macrodefs, etc.) you wish to define, in the standard Antlib format. For example:

<?xml version="1.0" encoding="UTF-8"?>
<antlib>
    <taskdef name="mytask1" classname="org.netbeans.modules.foo.MyTask1"/>
    <taskdef name="mytask2" classname="org.netbeans.modules.foo.MyTask2"/>
</antlib>

(Note that when using Ant 1.5, only <taskdef> and <typedef> elements are supported, and only using the name and classname attributes.)

Place the JAR file in the ant/nblib/ directory of the NetBeans distribution, i.e. bundle it in your NBM as netbeans/ant/nblib/org-netbeans-modules-foo.jar. NetBeans will automatically load your task/type definitions and make them available to build scripts.

The task classes will be loaded in a special class loader, not the one usually used for your module's classes. This loader will have access to:

  1. The JRE and JDK libraries.
  2. The installed copy of Ant, including any user-configured Ant classpath.
  3. Your module, including any extension JARs and anything your module can directly refer to, such as other modules it depends on.

Do not include copies of your task or type definitions in the module JAR. They must reside only in ant/nblib/*.jar.

Now whenever your module is enabled, Ant projects run inside NetBeans will have access to the definitions you provided. When running Ant 1.5, the definitions will be available with no namespace qualification, e.g.:

<project default="all">
    <target name="all">
        <mytask1 arg="val"/>
    </target>
</project>

When running Ant 1.6, the definitions will still be available with no namespace qualification. However it is recommended in 1.6 to namespace-qualify everything; so the antlib is loaded in the namespace you would expect, ensuring that there is no possibility of name clashes with unrelated tasks:

<project default="all"
         xmlns="antlib:org.apache.tools.ant"
         xmlns:foo="antlib:org.netbeans.modules.foo">
    <target name="all">
        <foo:mytask1 arg="val"/>
    </target>
</project>

Complete working example of task registration: ant/browsetask module

org.apache.tools.ant.module.wizards.shortcut
org.apache.tools.ant.module.xml
org.bar
org.fakepkg
org.foo
org.foo.impl
org.jruby.ast
org.jruby.lexer.yacc
org.jruby.libraries
org.jruby.parser
org.jruby.runtime
org.mozilla.javascript
org.mozilla.javascript.regexp
org.netbeans
org.netbeans.beaninfo
org.netbeans.beaninfo.editors
org.netbeans.core
org.netbeans.core.actions
org.netbeans.core.filesystems
org.netbeans.core.lookup
org.netbeans.core.modules
org.netbeans.core.projects
org.netbeans.core.ui
org.netbeans.core.validation
org.netbeans.core.xml
org.netbeans.insane.impl
org.netbeans.insane.live
org.netbeans.insane.model
org.netbeans.insane.scanner
org.netbeans.license
org.netbeans.nbexec
org.netbeans.perftest
org.netbeans.swing.dirchooser
org.netbeans.swing.plaf
org.netbeans.swing.plaf.aqua
org.netbeans.swing.plaf.gtk
org.netbeans.swing.plaf.metal
org.netbeans.swing.plaf.util
org.netbeans.swing.plaf.winclassic
org.netbeans.swing.plaf.winvista
org.netbeans.swing.plaf.winxp
org.netbeans.swing.popupswitcher
org.netbeans.swing.tabcontrol
org.netbeans.swing.tabcontrol.demo
org.netbeans.swing.tabcontrol.event
org.netbeans.swing.tabcontrol.plaf
org.netbeans.upgrade
org.netbeans.upgrade.launcher
org.netbeans.upgrade.systemoptions
org.netbeans.util
org.openide
org.openide.util
org.openidex.search
sampleproject
sfs_attr_test
test1
test2
w___w__w.j__ava_2__s__.c_o__m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.