Registration of various objects, files and hints into layer is pretty central to the way NetBeans based applications handle communication between modules. This page summarizes the list of such extension points defined by modules with API.
To get your API listed here, use
<api type='export' group='layer' ... />
in
your module arch.xml document.
Context menu actions are read from the layer folder
Loaders/text/x-ant+xml/Actions
.
"Projects/org-netbeans-modules-maven/Archetypes" folder contains fileobjects
that represent archetypes. The archetypes are defined by the following file attributes:
groupId mandatory
artifactId mandatory
version mandatory
repository optional url of the archetype's repository
nameBundleKey optional key in bundle file that holds localized name
descriptionBundleKey optional key in bundle file that holds localized description
"Projects/org-netbeans-modules-gradle/Customizer" folder's content is used to construct the project's customizer.
It's content is expected to be ProjectCustomizer.CompositeCategoryProvider
instances.
The lookup passed to the panels contains an instance of Project
.
"Projects/org-netbeans-modules-gradle/Nodes" folder's content is used to construct the project's child nodes.
It's content is expected to be NodeFactory
instances.
"Projects/org-netbeans-modules-gradle/Lookup" folder's content is used to construct the project's additional lookup.
It's content is expected to be
"Projects/org-netbeans-modules-gradle/Plugins/<plugin-name>/Lookup" folder content is also used to contribute into
the project lookup, based on the Gradle plugin ids, like "java-base".
LookupProvider
instances. Gradle project provides LookupMerger
s
for Sources
, PrivilegedTemplates
, RecommendedTemplates
and other classes.
Implementations added by 3rd parties will be merged into a single instance in the project's lookup.
"Projects/org-netbeans-modules-gradle/Actions" folder'' content is used to
add item's to the main project node popup.
It's content is expected to be Action
instances.
"Projects/org-netbeans-modules-java-j2seproject/Customizer" folder's content is used to construct the project's customizer.
It's content is expected to be ProjectCustomizer.CompositeCategoryProvider
instances.
The lookup passed to the panels contains an instance of Project
and org.netbeans.modules.java.j2seproject.ui.customizer.J2SEProjectProperties
Please note that the latter is not part of any public APIs and you need implementation dependency to make use of it.
"Projects/org-netbeans-modules-java-j2seproject/Nodes" folder's content is used to construct the project's child nodes.
It's content is expected to be NodeFactory
instances.
"Projects/org-netbeans-modules-java-j2seproject/Lookup" folder's content is used to construct the project's additional lookup.
It's content is expected to be LookupProvider
instances. J2SE project provides LookupMerger
s
for Sources
, PrivilegedTemplates
and RecommendedTemplates
. Implementations added by 3rd parties
will be merged into a single instance in the project's lookup.
"Projects/org-netbeans-modules-maven/Customizer" folder's content is used to construct the project's customizer.
It's content is expected to be ProjectCustomizer.CompositeCategoryProvider
instances.
The lookup passed to the panels contains an instance of Project
and org.netbeans.modules.maven.api.customizer.ModelHandle
Please note that the latter is not part of any public APIs and you need friend dependency to make use of it.
"Projects/org-netbeans-modules-maven/Nodes" folder's content is used to construct the project's child nodes.
It's content is expected to be NodeFactory
instances.
"Projects/org-netbeans-modules-maven/Lookup" folder's content is used to construct the project's additional lookup.
It's content is expected to be LookupProvider
instances. Maven project provides LookupMerger
s
for Sources
, PrivilegedTemplates
, RecommendedTemplates
and other classes. Implementations added by 3rd parties
will be merged into a single instance in the project's lookup.
Projects/org-netbeans-modules-maven/<packaging-type>/Lookup
is added to the project's additional Lookup. The content is expected
to contain packaing-specific services and processors, for example,
PrerequisitesCheckers.
In addition, Projects/org-netbeans-modules-maven/_any/Lookup
defines services that act after the packaging-specific ones.
Technology-related services can be registered so they activate in a project that has configured a specific Maven plugin. Such services should
be placed in Projects/org-netbeans-modules-maven/<plugin-id>/Lookup
folder. Maven core module will plug these providers in
as soon as the plugin-id appears in the POM model, and will remove them from project's Lookup when the plugin is no longer part of the project's model.
See
NbMavenProject javadoc for details/examples.
"Projects/org-netbeans-modules-maven/ProjectActions",
"Projects/org-netbeans-modules-maven/DependenciesActions" and
"Projects/org-netbeans-modules-maven/DependencyActions" folders' content is used to
add item's to node popup. To main project node, Dependencies node and node for single dependency.
It's content is expected to be Action
instances.
A module can disable warning for a custom lifecycle participant by creating a folder in
Projects/org-netbeans-modules-maven/LifecycleParticipant
. Currently single boolean attribute,
ignoreOnModelLoad
is supported, which suppresses project problem and warning about
the custom participant. The participant's code does not run after project load.
"Projects/org-netbeans-modules-maven/Archetypes" folder contains fileobjects
that represent archetypes. The archetypes are defined by the following file attributes:
groupId mandatory
artifactId mandatory
version mandatory
repository optional url of the archetype's repository
nameBundleKey optional key in bundle file that holds localized name
descriptionBundleKey optional key in bundle file that holds localized description
<folder name="OptionsExport">
<!-- category -->
<folder name="MyCategory">
<!-- category display name -->
<attr name="displayName"
bundlevalue="org.netbeans.modules.mymodule.options.Bundle#Category_Display_Name"/>
<!-- item -->
<file name="MyItem1">
<attr name="displayName" bundlevalue="org.netbeans.modules.mymodule.options.Bundle#Item1_Display_Name"/>
<!-- include regex pattern rooted to userdir -->
<attr name="include" stringvalue="config/Preferences/org/netbeans/modules/mymodule/.*|config/mymodule/.*"/>
<!-- exclude regex pattern rooted to userdir -->
<attr name="exclude" stringvalue="config/mymodule/obsolete/.*"/>
</file>
<!-- item -->
<file name="MyItem2">
<attr name="displayName" bundlevalue="org.netbeans.modules.mymodule.options.Bundle#Item2_Display_Name"/>
<!-- include pattern with properties constrain -->
<attr name="include" stringvalue="config/mymodule[.]properties#key[1-9].*|keyA.*#|config/mymodule[.]xml"/>
<!-- exclude pattern with properties constrain -->
<attr name="exclude" stringvalue="config/obsolete[.]properties#key5"/>
</file>
</folder>
</folder>
Include/exclude patterns may contain either a regular expression defining
files relatively to userdir (see MyItem1) or a compound pattern defining
files and property keys (see MyItem2). A compound pattern consists of
file regex pattern followed by hash delimiter (#) then property key
regex pattern followed by another hash delimiter. Hash delimiter can be
ommited at the end of compound pattern. For example, a compound pattern
can have the following structure
filePattern1#keyPattern1#|filePattern2|filePattern3#keyPattern3
.
Actions for the Projects tab root context menu are taken from
the layer folder ProjectsTabActions
. Foreign modules ought
to place entries below sep-below-main-actions.instance
.
Several project related actions are registered in the Actions folder in the layer.
Product branding is intended to use those actions to build main menu, toolbars and shortcuts.
New (or import) project wizards can be registered in a special folder
Templates/Projects/
.
Providers of generic project actions can register Action
and JSeparator
instances in a special folder Projects/Actions/
. So if any module wishes
to extend, hide or reorder some of them it can just register its actions there. Example:
<folder name="Projects" >
<folder name="Actions" >
<file name="org-mymodule-MyAction.instance" >
<attr name="instanceCreate" stringvalue="org.mymodule.MyAction" />
</file>
</folder>
</folder>
File templates can be registered with various attributes, some specific to
the project system.
Under Templates/Licenses
folder should be registered various license headers
that can be imported by templates using scripting. The recommended format of filename is
license-[licensename].txt
e.g. license-cddl.txt
.
Several project related actions are registered in the Actions folder in the layer.
Product branding is intended to use those actions to build main menu, toolbars and shortcuts.
Services/ProjectConvertors/
)
and requiredFiles
and delegate
attributes.
New (or import) project wizards can be registered in a special folder
Templates/Projects/
.
Providers of generic project actions can register Action
and JSeparator
instances in a special folder Projects/Actions/
. So if any module wishes
to extend, hide or reorder some of them it can just register its actions there. Example:
<folder name="Projects" >
<folder name="Actions" >
<file name="org-mymodule-MyAction.instance" >
<attr name="instanceCreate" stringvalue="org.mymodule.MyAction" />
</file>
</folder>
</folder>
File templates can be registered with various attributes, some specific to
the project system.
Under Templates/Licenses
folder should be registered various license headers
that can be imported by templates using scripting. The recommended format of filename is
license-[licensename].txt
e.g. license-cddl.txt
.
Servers/Actions
you
can extend the list of popup actions on Servers node in
Services tab.
Cloud/Actions
you
can extend the list of popup actions on Cloud node in
Services tab.
By adding additional attributes to files in
By adding
By adding
In all of these cases, the action receives command
These attribute based APIs shall be seen as temporary and subject
to replacement. Please notify us as soon as you start to use them.
Servers/Actions
or Cloud/Actions
folder you can influence behaviour of the Servers
and Cloud
node.
property-something
attribute you identify
an action that will be called as soon as the node is expanded and
System.getProperty("something")
is non-null.
config-something
attribute you identify
an action that will be called as soon as the node is expanded and
FileUtil.getConfigFile("something")
is non-null.
noui
,
to know that it shall only enable given functionality, but there
is no need to show user anything.
There's a private XML file for user settings for each palette model.
Task List framework defines the following folders in XML layer:
/TaskList/Scanners - register your instances of task scanners here
/TaskList/ScanningScopes - here you can add additional scanning
scopes
/TaskList/Groups - here you can define additional task groups, for example:
<folder name="TaskList">
<folder name="Groups">
<file name="mygroup.instance">
<attr name="instanceCreate" methodvalue="org.netbeans.spi.tasklist.Task.createGroup"/>
<attr name="localizingBundle" stringvalue="org.mymodule.resources.Bundle"/>
<attr name="groupName" stringvalue="my-unique-group-name"/>
<attr name="diplayNameKey" stringvalue="LBL_my_group"/>
<attr name="descriptionKey" stringvalue="HINT_my_group"/>
<attr name="iconKey" stringvalue="ICON_my_group"/>
</file>
</folder>
</folder>
Tasks are organized into groups according
to their importance (error/warning/todo etc). The task group is specified when the Task is created.
Each group is identified by its unique name. The Task List framework provides the following groups:
Additional task groups can be specified in xml layers, see above.
"nb-tasklist-error" - for error-type tasks
"nb-tasklist-warning" - for warning-type tasks
UI/ToolActions
folder to make them known
to
ToolsAction.
setAttribute
is supported by the filesystem, the
getAttribute
can behave like
XMLFileSystem's
methodvalue
and newvalue
attributes:
getAttribute
with raw:
prefix to evaluate the attribute without instantiating it
(e.g. get
Method or
Class values from
methodvalue
and newvalue
attributes. This API
is not intended for public use at present and can change in future.
Loaders/folder/any/Actions
so if any module wishes
to extend, hide or reorder some of them it can just register its actions there.
Loaders/text/xml/Actions
Loaders/content/unknown/Actions
Loaders/application/x-nbsettings/Actions
Loaders/folder/any/Actions
so if any module wishes
to extend, hide or reorder some of them it can just register its actions there.
Loaders/text/xml/Actions
Loaders/content/unknown/Actions
Loaders/application/x-nbsettings/Actions
Loaders/mime/type/Factories
.
The main menu of the application is composed by reading
Since version 7.44 one can attach Menu/
folder in the layer. A sub folder is treated as a sub menu.
Instances of individual files (usually .instance
or .shadow
) may then represent
Action
or
JMenuItem
or
JSeparator.
property-prefix
attribute
to every folder. Then all the file attributes are scanned and if some
of them start with the specified prefix they are placed a
client
properties on the
JMenu
instance (after stripping the prefix off).
Editors/TabActions
.