diff --git a/modules/ROOT/images/tutorials/maven-crud_27_pic1.png b/modules/ROOT/images/tutorials/maven-crud_27_pic1.png
new file mode 100644
index 00000000..a4f633cc
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-crud_27_pic1.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic01.png b/modules/ROOT/images/tutorials/maven-suite_27_pic01.png
new file mode 100644
index 00000000..fee023ea
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic01.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic02.png b/modules/ROOT/images/tutorials/maven-suite_27_pic02.png
new file mode 100644
index 00000000..aaaafaa7
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic02.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic03.png b/modules/ROOT/images/tutorials/maven-suite_27_pic03.png
new file mode 100644
index 00000000..23876dd3
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic03.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic04.png b/modules/ROOT/images/tutorials/maven-suite_27_pic04.png
new file mode 100644
index 00000000..518628d3
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic04.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic05.png b/modules/ROOT/images/tutorials/maven-suite_27_pic05.png
new file mode 100644
index 00000000..204bab68
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic05.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic06.png b/modules/ROOT/images/tutorials/maven-suite_27_pic06.png
new file mode 100644
index 00000000..6a9bd45f
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic06.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic07.png b/modules/ROOT/images/tutorials/maven-suite_27_pic07.png
new file mode 100644
index 00000000..f971514d
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic07.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic08.png b/modules/ROOT/images/tutorials/maven-suite_27_pic08.png
new file mode 100644
index 00000000..384a25d9
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic08.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic09.png b/modules/ROOT/images/tutorials/maven-suite_27_pic09.png
new file mode 100644
index 00000000..a5347621
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic09.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic10.png b/modules/ROOT/images/tutorials/maven-suite_27_pic10.png
new file mode 100644
index 00000000..32b8489e
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic10.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic11.png b/modules/ROOT/images/tutorials/maven-suite_27_pic11.png
new file mode 100644
index 00000000..11b62fbb
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic11.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic12.png b/modules/ROOT/images/tutorials/maven-suite_27_pic12.png
new file mode 100644
index 00000000..0990e128
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic12.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic13.png b/modules/ROOT/images/tutorials/maven-suite_27_pic13.png
new file mode 100644
index 00000000..62fbb897
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic13.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic2.png b/modules/ROOT/images/tutorials/maven-suite_27_pic2.png
new file mode 100644
index 00000000..beab4367
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic2.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic3.png b/modules/ROOT/images/tutorials/maven-suite_27_pic3.png
new file mode 100644
index 00000000..42f59ce7
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic3.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic4.png b/modules/ROOT/images/tutorials/maven-suite_27_pic4.png
new file mode 100644
index 00000000..e4f876f8
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic4.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic5.png b/modules/ROOT/images/tutorials/maven-suite_27_pic5.png
new file mode 100644
index 00000000..56508f7e
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic5.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic6.png b/modules/ROOT/images/tutorials/maven-suite_27_pic6.png
new file mode 100644
index 00000000..dd774198
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic6.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic7.png b/modules/ROOT/images/tutorials/maven-suite_27_pic7.png
new file mode 100644
index 00000000..397d213f
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic7.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic8.png b/modules/ROOT/images/tutorials/maven-suite_27_pic8.png
new file mode 100644
index 00000000..d716b5c6
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic8.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_27_pic9.png b/modules/ROOT/images/tutorials/maven-suite_27_pic9.png
new file mode 100644
index 00000000..44c6d795
Binary files /dev/null and b/modules/ROOT/images/tutorials/maven-suite_27_pic9.png differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic01.png b/modules/ROOT/images/tutorials/maven-suite_72_pic01.png
deleted file mode 100644
index a639daeb..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic01.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic02.png b/modules/ROOT/images/tutorials/maven-suite_72_pic02.png
deleted file mode 100644
index 21fe924c..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic02.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic03.png b/modules/ROOT/images/tutorials/maven-suite_72_pic03.png
deleted file mode 100644
index 211a57e0..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic03.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic04.png b/modules/ROOT/images/tutorials/maven-suite_72_pic04.png
deleted file mode 100644
index 54f490cf..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic04.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic05.png b/modules/ROOT/images/tutorials/maven-suite_72_pic05.png
deleted file mode 100644
index 4a4fc8a9..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic05.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic06.png b/modules/ROOT/images/tutorials/maven-suite_72_pic06.png
deleted file mode 100644
index 23ae571e..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic06.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic07.png b/modules/ROOT/images/tutorials/maven-suite_72_pic07.png
deleted file mode 100644
index 41c77fcb..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic07.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic08.png b/modules/ROOT/images/tutorials/maven-suite_72_pic08.png
deleted file mode 100644
index 8378d7fa..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic08.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic09.png b/modules/ROOT/images/tutorials/maven-suite_72_pic09.png
deleted file mode 100644
index 53e6a127..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic09.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic10.png b/modules/ROOT/images/tutorials/maven-suite_72_pic10.png
deleted file mode 100644
index 73dc7d78..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic10.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic11.png b/modules/ROOT/images/tutorials/maven-suite_72_pic11.png
deleted file mode 100644
index 15c0dcc5..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic11.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic13.png b/modules/ROOT/images/tutorials/maven-suite_72_pic13.png
deleted file mode 100644
index cad8f8a7..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic13.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic2.png b/modules/ROOT/images/tutorials/maven-suite_72_pic2.png
deleted file mode 100644
index 90ff63ba..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic2.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic3.png b/modules/ROOT/images/tutorials/maven-suite_72_pic3.png
deleted file mode 100644
index dcffff2b..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic3.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic4.png b/modules/ROOT/images/tutorials/maven-suite_72_pic4.png
deleted file mode 100644
index 007a1f3b..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic4.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic5.png b/modules/ROOT/images/tutorials/maven-suite_72_pic5.png
deleted file mode 100644
index ea4daaf7..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic5.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic6.png b/modules/ROOT/images/tutorials/maven-suite_72_pic6.png
deleted file mode 100644
index 622691cc..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic6.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic7.png b/modules/ROOT/images/tutorials/maven-suite_72_pic7.png
deleted file mode 100644
index 85d88c83..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic7.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic8.png b/modules/ROOT/images/tutorials/maven-suite_72_pic8.png
deleted file mode 100644
index ec460773..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic8.png and /dev/null differ
diff --git a/modules/ROOT/images/tutorials/maven-suite_72_pic9.png b/modules/ROOT/images/tutorials/maven-suite_72_pic9.png
deleted file mode 100644
index 872b98c6..00000000
Binary files a/modules/ROOT/images/tutorials/maven-suite_72_pic9.png and /dev/null differ
diff --git a/modules/ROOT/pages/tutorials/nbm-maven-modulesuite.adoc b/modules/ROOT/pages/tutorials/nbm-maven-modulesuite.adoc
index 2e6f1247..2dfd750e 100644
--- a/modules/ROOT/pages/tutorials/nbm-maven-modulesuite.adoc
+++ b/modules/ROOT/pages/tutorials/nbm-maven-modulesuite.adoc
@@ -29,24 +29,30 @@
:experimental:
:description: NetBeans Platform Selection Tutorial Using Maven - Apache NetBeans
:keywords: Apache NetBeans Platform, Platform Tutorials, NetBeans Platform Selection Tutorial Using Maven
+:page-reviewed: 2025-10-28
ifdef::env-github[]
:imagesdir: ../../images
endif::[]
-This document demonstrates how to create a NetBeans Platform Module Suite from Maven archetypes and build and install the suite in your installation of the IDE. In this tutorial you will create a Maven module suite project that contains three NetBeans modules as sub-projects. The Maven project that contains the sub-projects is a simple POM project that declares how the suite is compiled and the installation target.
+This document demonstrates how to create a NetBeans Platform project from Maven archetypes and build and install the
+project in your installation of the IDE. In this tutorial you will create a Maven project that contains three NetBeans
+modules as sub-projects. The Maven project that contains the sub-projects is a simple POM project that declares how the
+suite is compiled and the installation target.
-This document is based on the Ant-based xref:tutorials/nbm-selection-1.adoc[NetBeans Selection Management Tutorial] and illustrates some of the differences between using Ant and Maven to develop NetBeans Platform module suites. After you understand some of the differences, you can easily proceed through other tutorials on the the xref:kb/docs/platform.adoc[NetBeans Platform Learning Trail].
+This document is based on the Ant-based xref:tutorials/nbm-selection-1.adoc[NetBeans Selection Management Tutorial] and
+illustrates some of the differences between using Ant and Maven to develop NetBeans Platform application. After you
+understand some of the differences, you can easily proceed through other tutorials on the the
+xref:kb/docs/platform.adoc[NetBeans Platform Learning Trail].
+NOTE: You do not need to download Maven because it is bundled with the IDE. Optionally, use your own download of Maven,
+in which case use the Options window to configure your Maven settings.
-
-
-NOTE: You do not need to download Maven because it is bundled with the IDE. Optionally, use your own download of Maven, in which case use the Options window to configure your Maven settings.
-
-NOTE: This is [.underline]#not# a beginners tutorial. Before starting this tutorial, it is important that you familiarize yourself with the following introductory Maven documentation:
+NOTE: This is [.underline]#not# a beginners tutorial. Before starting this tutorial, it is important that you
+familiarize yourself with the following introductory Maven documentation:
* xref:wiki::wiki/MavenBestPractices.adoc[Best Practices for Maven in NetBeans IDE]
* link:http://www.sonatype.com/books/maven-book/reference/introduction.html[Chapter 1. Introducing Apache Maven] (from link:http://www.sonatype.com/books/maven-book/reference/public-book.html[Maven: The Definitive Guide])
@@ -56,62 +62,54 @@ NOTE: This is [.underline]#not# a beginners tutorial. Before starting this tuto
== Creating the NetBeans Platform Application
-In this section you use the New Project wizard to create a NetBeans Platform Module Suite from a Maven archetype. The wizard will create a POM project that will contain the module projects. In the wizard you will also create a module as a sub-project of the suite.
+In this section you use the New Project wizard to create a NetBeans Platform Application from a Maven archetype. The
+wizard will create a POM project that will contain the module projects. In the wizard you will also create a module as a
+sub-project of the suite.
-[start=1]
1. Open the New Project wizard and select NetBeans Application in the Maven category:
++
+image::tutorials/maven-crud_27_pic1.png[title="New Project window"]
-image::tutorials/maven-crud_72_pic1.png[title="Screenshot of Projects window"]
-
-Click Next.
-
-
-[start=2]
-1. Type *MavenSelectionSuite* for the Project Name:
-
-
-image::tutorials/maven-suite_72_pic2.png[title="Screenshot of Projects window"]
-
-Click Next.
-
-
-[start=3]
-1. Choose the NetBeans API version you want to use. Select Create Module Project and type *MyAPI* for the module name:
-
+2. Use *MavenSelectionSuite* for the Project Name:
++
+image::tutorials/maven-suite_27_pic2.png[title="New Netbeans Application options 1/2"]
-image::tutorials/maven-suite_72_pic3.png[title="Screenshot of Projects window"]
-Click Finish.
-
-When you click Finish, the IDE creates a Maven reactor project, together with subprojects for branding, NetBeans Platform application actions, and the API module:
-
-
-image::tutorials/maven-suite_72_pic4.png[title="Screenshot of Projects window"]
-
-*MavenSelectionSuite-parent* is a reactor project which is a container for sub-projects, in this case NetBeans Module projects. The reactor project does not contain any source files. As you can see from the screenshot above, the reactor provides a list of the modules that will be included when you build the project. You can see that the MyAPI project is listed as one of these modules.
+3. Choose the NetBeans API version you want to use. Check _Create Module Project_ and type *MyAPI* for the module name:
++
+image::tutorials/maven-suite_27_pic3.png[title="New Netbeans Application options 2/2"]
++
+When you click Finish, the IDE creates a Maven reactor project, together with subprojects for branding, NetBeans
+Platform application actions, and the API module:
++
+image::tutorials/maven-suite_27_pic4.png[title="Screenshot of Projects window"]
++
+*MavenSelectionSuite-parent* is a reactor project which is a container for sub-projects, in this case NetBeans Module
+projects. The reactor project does not contain any source files. As you can see from the screenshot above, the reactor
+provides a list of the modules that will be included when you build the project. You can see that the MyAPI project is
+listed as one of these modules.
== Creating an API
-You created the *MyAPI* module when you created the module suite, but now you need to create a class in the module and expose the class to other modules.
+You created the *MyAPI* module when you created the application, but now you need to create a class in the module and
+expose the class to other modules.
=== Creating a Class in the MyAPI Module
-In this exercise you will create a simple class named ``Event`` . Each instance of ``Event`` will be unique because the field ``index`` is incremented by 1 each time a new instance of ``Event`` is created.
+In this exercise you will create a simple class named ``Event`` . Each instance of ``Event`` will be unique because
+the field ``index`` is incremented by 1 each time a new instance of ``Event`` is created.
-[start=1]
1. In the ``com.mycompany.mavenselectionsuite`` package, create a new Java class named *Event*.
-[start=2]
-1. Modify the class to declare the following fields and getters:
-
+2. Modify the class to declare the following fields and getters:
++
[source,java]
----
-
package com.mycompany.mavenselectionsuite;
import java.util.Date;
@@ -137,217 +135,189 @@ public final class Event {
public String toString() {
return index + " - " + date;
}
-
}
----
-=== Exposing the Package
+=== Exporting the Package
-In this tutorial you will create additional modules that will need to access the ``Event`` class. In this exercise, you will make the contents of the package that contains the ``Event`` class public so that other modules can access it. To declare the ``com.mycompany.mavenselectionsuite`` package as public, you will modify the ``configuration`` element of ``nbm-maven-plugin`` in the POM to specify the packages that are exported as public. You can make the changes to the POM in the editor or by selecting the packages to make public in the project's Properties window.
+In this tutorial you will create additional modules that will need to access the ``Event`` class. In this exercise,
+you will make the contents of the package that contains the ``Event`` class public so that other modules can access
+it. To declare the ``com.mycompany.mavenselectionsuite`` package as public, you will modify the ``configuration``
+element of ``nbm-maven-plugin`` in the POM to specify the packages that are exported as public. You can make the
+changes to the POM in the editor or by selecting the packages to make public in the project's Properties window.
-[start=1]
1. Right-click the MyAPI project node and choose Properties to open the Properties window.
-[start=2]
-1.
-Select the *com.mycompany.mavenselectionsuite* package in the *Public Packages* category:
-
-
-image::tutorials/maven-suite_72_pic5.png[title="screenshot"]
-
-Click OK.
+2. Select the *com.mycompany.mavenselectionsuite* package in the *Public Packages* category:
++
+image::tutorials/maven-suite_27_pic5.png[title="Public packages selection"]
++
When you select a package to export, the IDE modifies the ``nbm-maven-plugin`` element in the *MyAPI* module's POM to specify the package:
-
-
++
[source,xml]
----
-
org.codehaus.mojo
nbm-maven-plugin
true
- *com.mycompany.mavenselectionsuite*
+ com.mycompany.mavenselectionsuite
----
-[start=3]
-1. Right-click the project and choose Build. When you build the project, the ``nbm-maven-plugin`` will generate a manifest header in the ``MANIFEST.MF`` of the JAR, to specify the public package:
-
-
+3. Right-click the project and choose Build. When you build the project, the ``nbm-maven-plugin`` will generate a
+manifest header in the ``MANIFEST.MF`` of the JAR, to specify the public package:
++
[source,java]
----
-
Manifest-Version: 1.0
-Archiver-Version: Plexus Archiver
-Created-By: Apache Maven
-Built-By: geertjan
-Build-Jdk: 1.7.0
OpenIDE-Module-Localizing-Bundle: com/mycompany/mavenselectionsuite/Bu
ndle.properties
OpenIDE-Module-Specification-Version: 1.0
-OpenIDE-Module-Implementation-Version: 1.0-20111222
-OpenIDE-Module-Build-Version: 201112221054
+OpenIDE-Module-Implementation-Version: 1.0-20251013
+OpenIDE-Module-Build-Version: 202510130007
OpenIDE-Module: com.mycompany.MyAPI
-*OpenIDE-Module-Public-Packages: com.mycompany.mavenselectionsuite.**
+OpenIDE-Module-Public-Packages: com.mycompany.mavenselectionsuite.*
OpenIDE-Module-Requires: org.openide.modules.ModuleFormat1
OpenIDE-Module-Display-Category: com.mycompany
OpenIDE-Module-Name: MyAPI
OpenIDE-Module-Short-Description:
OpenIDE-Module-Long-Description:
OpenIDE-Module-Module-Dependencies: org.netbeans.api.annotations.commo
- n/1 > 1.10.1
+ n/1 > 1.57
----
-For more information, see the link:http://bits.netbeans.org/mavenutilities/nbm-maven-plugin/manifest-mojo.html#publicPackages[nbm-maven-plugin manifest documentation].
+For more information, see the
+link:http://bits.netbeans.org/mavenutilities/nbm-maven-plugin/manifest-mojo.html#publicPackages[nbm-maven-plugin manifest documentation].
== Listening to the Selection
-In this section you will create a new module named MyViewer and add a window component and two text fields. The component will implement `` link:https://bits.netbeans.org/dev/javadoc/org-openide-util-lookup/org/openide/util/LookupListener.html[LookupListener]`` to listen for changes to the selection.
+In this section you will create a new module named MyViewer and add a window component and two text fields. The
+component will implement `` link:https://bits.netbeans.org/dev/javadoc/org-openide-util-lookup/org/openide/util/LookupListener.html[LookupListener]`` to listen for changes to the selection.
=== Creating the Module
-In this exercise you will create the MyViewer NetBeans module in the ``MavenSelectionSuite`` directory.
-
-
-[start=1]
-1. Choose File > New Project from the main menu (Ctrl-Shift-N). Select NetBeans Module from the Maven category:
-
-
-image::tutorials/maven-suite_72_pic6.png[title="screenshot"]
-
-Click Next.
-
-
-[start=2]
-1. Type *MyViewer* as the Project Name. Make sure to set the Project Location to the ``MavenSelectionSuite`` directory:
-
-
-image::tutorials/maven-suite_72_pic7.png[title="screenshot"]
-
-
-[start=3]
-1. Click Next. Select the NetBeans API version you'd like to use:
-
-
-image::tutorials/maven-suite_72_pic8.png[title="screenshot"]
-
-Click Finish.
-
-
-[start=4]
-1. The new module is created within the *parent* project, which is a Maven reactor. Therefore, it becomes part of the reactor build. However, the new module is not yet part of the *app* project. Right-click the Dependencies node in the *app* project and choose Add Dependency:
-
+In this exercise you will create the MyViewer NetBeans module in the ``MavenSelectionSuite`` directory. Open the parent
+project, right click *Modules* and choose *Create New Module*; that starts the process to create a module that is a
+maven child project, so it is easier to integrate in the appication.
-image::tutorials/maven-suite_72_pic02.png[title="screenshot"]
+image::tutorials/maven-suite_27_pic12.png[title="Creating a new module"]
-[start=5]
-1. Select the *MyViewer* module in the Open Projects tab:
-
-
-image::tutorials/maven-suite_72_pic03.png[title="screenshot"]
-
+1. Choose File > New Project from the main menu (Ctrl-Shift-N). Select NetBeans Module from the Maven category:
++
+image::tutorials/maven-suite_27_pic6.png[title="Selecting Netbeans Module as project type"]
-[start=6]
-1. When you click Add above, the IDE adds the *MyViewer* module to the list of dependencies of the *app* project. You can see the new dependency in the POM of the *app* project module and displayed as a new node under the Dependencies node of the *app* project:
+2. Type *MyViewer* as the Project Name. Make sure to set the Project Location to the ``MavenSelectionSuite``
+directory:
++
+image::tutorials/maven-suite_27_pic7.png[title="New Module parameters 1/2"]
-image::tutorials/maven-suite_72_pic04.png[title="screenshot"]
+3. Click Next. Select the NetBeans API version you'd like to use:
++
+image::tutorials/maven-suite_27_pic8.png[title="New Module parameters 2/2"]
-[start=7]
-1. The module is going to use the API module, therefore we need to set a dependency in the viewer module on the API module. Right-click the Dependencies node in the *MyViewer* project and choose Add Dependency:
+4. The new module is created within the *parent* project, which is a Maven reactor. Therefore, it becomes part of the
+reactor build. However, the new module is not yet part of the *app* project. Right-click the Dependencies node in the
+*app* project and choose Add Dependency:
++
+image::tutorials/maven-suite_27_pic02.png[title="Adding Module to the application"]
-image::tutorials/maven-suite_72_pic9.png[title="screenshot"]
+5. Select the *MyViewer* module in the Open Projects tab:
++
+image::tutorials/maven-suite_27_pic03.png[title="Finding new module in Open Projects"]
-[start=8]
-1. Select the *MyAPI* module in the Open Projects tab:
+6. When you click Add above, the IDE adds the *MyViewer* module to the list of dependencies of the *app* project. You
+can see the new dependency in the POM of the *app* project module and displayed as a new node under the Dependencies
+node of the *app* project:
++
+image::tutorials/maven-suite_27_pic04.png[title="Result of adding the dependency"]
-image::tutorials/maven-suite_72_pic10.png[title="screenshot"]
+7. The module is going to use the API module, therefore we need to set a dependency in the viewer module on the API
+module. Right-click the Dependencies node in the *MyViewer* project and choose Add Dependency:
++
+image::tutorials/maven-suite_27_pic9.png[title="Adding MyAPI dependency"]
-[start=9]
-1. When you click Add above, the IDE adds the API module to the list of dependencies of the MyViewer module. You can see the new dependency in the POM of the MyViewer module and displayed as a new node under the Dependencies node of the MyViewer module:
+8. Select the *MyAPI* module in the Open Projects tab:
++
+image::tutorials/maven-suite_27_pic10.png[title="Finding MyAPI in Open Projects"]
-image::tutorials/maven-suite_72_pic01.png[title="screenshot"]
-You've now learned how to create a new module in your application and you've also learned how to set dependencies between your modules. Once a dependency has been set, a module can use the publicly exposed classes of the modules it depends on.
+9. When you click Add above, the IDE adds the API module to the list of dependencies of the MyViewer module. You can see
+the new dependency in the POM of the MyViewer module and displayed as a new node under the Dependencies node of the
+MyViewer module:
++
+image::tutorials/maven-suite_27_pic01.png[title="Result of adding the dependency"]
++
+You've now learned how to create a new module in your application and you've also learned how to set dependencies
+between your modules. Once a dependency has been set, a module can use the publicly exposed classes of the modules it
+depends on.
=== Creating the Viewer Window
-In this exercise you will create a GUI component in your viewer module. The data displayed in the GUI component will be retrieved from the Lookup. That means you will learn how to listen to the selection and how to update your GUI component whenever an object of interest is published into the Lookup.
-
-
-[start=1]
-1. Right-click the MyViewer project and choose New > Window. Select *explorer* and select Open on Application Start:
-
-
-image::tutorials/maven-suite_72_pic05.png[title="screenshot"]
-
-Click Next.
-
-
-[start=2]
-1. Type *MyViewer* as the Class Name Prefix:
-
+In this exercise you will create a GUI component in your viewer module. The data displayed in the GUI component will
+be retrieved from the Lookup. That means you will learn how to listen to the selection and how to update your GUI
+component whenever an object of interest is published into the Lookup.
-image::tutorials/maven-suite_72_pic06.png[title="screenshot"]
-Click Finish. You should see you have a new NetBeans Platform window component ready to be designed within the Matisse GUI Builder:
+1. Right-click the MyViewer project and choose _New > Window_. Select *explorer* and check _Open on Application Start_:
++
+image::tutorials/maven-suite_27_pic05.png[title="New Window creation"]
-image::tutorials/maven-suite_72_pic07.png[title="screenshot"]
+2. Type *MyViewer* as the Class Name Prefix:
++
+image::tutorials/maven-suite_27_pic06.png[title="New Window parameters"]
++
+When you click Finish, you should see you have a new NetBeans Platform window component ready to be designed within the Matisse GUI Builder:
++
+image::tutorials/maven-suite_27_pic07.png[title="Window class in source tree"]
-[start=3]
-1. Drag two Labels from the Palette into the window component:
+3. Drag two Labels from the Palette into the window component:
++
+image::tutorials/maven-suite_27_pic08.png[title="Adding labels to the window"]
-image::tutorials/maven-suite_72_pic08.png[title="screenshot"]
-
-
-[start=4]
-1. You are now going to listen to the global context, provided by the xref:wiki::wiki/index.adoc#_lookup[NetBeans Lookup], for Event objects. Right now, no Event objects will be present in the global context. However, in the next section, we will create a new module that will publish Event objects.
-
+4. You are now going to listen to the global context, provided by the xref:wiki::wiki/index.adoc#_lookup[NetBeans Lookup],
+for Event objects. Right now, no Event objects will be present in the global context. However, in the next section, we
+will create a new module that will publish Event objects.
++
Click the Source tab and modify the class signature to implement ``LookupListener`` :
-
-
++
[source,java]
----
-
-public class MyViewerTopComponent extends TopComponent *implements LookupListener* {
+public class MyViewerTopComponent extends TopComponent implements LookupListener {
----
-
++
Add the following ``private`` field ``result`` and set the initial value to null.
-
-
++
[source,java]
----
-
private Lookup.Result result = null;
----
-
++
Implement the LookupListener's "resultChanged" method as follows:
-
-
++
[source,java]
----
-
@Override
public void resultChanged(LookupEvent le) {
if (!result.allInstances().isEmpty()) {
@@ -361,77 +331,73 @@ public void resultChanged(LookupEvent le) {
}
}
----
-
++
Make the following additions to the ``componentOpened()`` and ``componentClosed()`` methods that have already been created in the class by the New Window wizard:
-
-
++
[source,java]
----
-
@Override
public void componentOpened() {
- *result = Utilities.actionsGlobalContext().lookupResult(Event.class);
- result.addLookupListener(this);*
+ result = Utilities.actionsGlobalContext().lookupResult(Event.class);
+ result.addLookupListener(this);
}
@Override
public void componentClosed() {
- *result.removeLookupListener (this);*
+ result.removeLookupListener (this);
}
----
-
-*Note.* By using `` link:https://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/Utilities.html#actionsGlobalContext%28%29[Utilities.actionsGlobalContext()]`` , each time the window is opened, the window listens to the global context for Event objects. Whenever a new Event is published into the global context, the ``resultChanged`` method is automatically triggered to handle the event.
-
++
+*Note.* By using `` link:https://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/Utilities.html#actionsGlobalContext%28%29[Utilities.actionsGlobalContext()]`` , each time the window is opened, the window listens to the global context for Event
+objects. Whenever a new Event is published into the global context, the ``resultChanged`` method is automatically
+triggered to handle the event.
++
Make sure to import the correct ``Event`` class, that is, ``com.mycompany.mavenselectionsuite.Event`` .
== Publishing a Selected Object
-In this section you will create a new module called MyEditor. The module will contain a `` link:https://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.html[TopComponent]`` that will publish instances of the ``Event`` object into the Lookup of the TopComponent. When the user selects the TopComponent, the objects in its Lookup will be available globally. Once published globally, the viewer window created in the previous section, which is listening for Events in the global Lookup, will automatically update itself.
+In this section you will create a new module called MyEditor. The module will contain a `` link:https://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.html[TopComponent]`` that will publish instances of the ``Event`` object into the Lookup of the TopComponent. When the user
+selects the TopComponent, the objects in its Lookup will be available globally. Once published globally, the viewer
+window created in the previous section, which is listening for Events in the global Lookup, will automatically update
+itself.
=== Creating the Module
-In this exercise you will create a NetBeans module in the ``MavenSelectionSuite`` directory and add a dependency on the MyAPI module.
+In this exercise you will create a NetBeans module in the ``MavenSelectionSuite`` directory and add a dependency on
+the MyAPI module.
-[start=1]
1. As you did in the previous section, create a new module in the *parent* folder. Type *MyEditor* as the Project Name.
-[start=2]
-1. As you did in the previous section, you need to add the *MyEditor* module as a dependency of the *app* project, so that it will be deployed when you run the application.
-
-
-[start=3]
-1. As you did in the previous section, you need to add a dependency on the API module, so that you can use its public packages.
-
+2. As you did in the previous section, you need to add the *MyEditor* module as a dependency of the *app* project, so
+that it will be deployed when you run the application.
-[start=4]
-1. As you did in the previous section, create a new window in the *MyEditor* module. Set its position to "editor". Type *MyEditor* as the Class Name Prefix.
+3. As you did in the previous section, you need to add a dependency on the API module, so that you can use its
+public packages.
-[start=5]
-1. Check that the result of the steps you have taken so far match the screenshot below:
+4. As you did in the previous section, create a new window in the *MyEditor* module. Set its position to "editor".
+Type *MyEditor* as the Class Name Prefix.
-image::tutorials/maven-suite_72_pic09.png[title="screenshot"]
+5. Check that the result of the steps you have taken so far match the screenshot below:
++
+image::tutorials/maven-suite_27_pic09.png[title="Source tree with new Window class"]
-[start=6]
-1. Use the Palette to drag and drop a Text Field onto the window:
-
-image::tutorials/maven-suite_72_pic11.png[title="screenshot"]
-
-
-[start=7]
-1. Switch to the Source tab. At the end of the constructor in the window, include the following code:
+6. Use the Palette to drag and drop a Text Field onto the window:
++
+image::tutorials/maven-suite_27_pic11.png[title="Adding a text field to the window"]
+7. Switch to the Source tab. At the end of the constructor in the window, include the following code:
++
[source,java]
----
-
Event obj = new Event();
associateLookup(Lookups.singleton(obj));
@@ -439,23 +405,25 @@ jTextField1.setText("Event #" + obj.getIndex() + " created at " + obj.getDate())
setDisplayName("MyEditor " + obj.getIndex());
----
-
-NOTE: The ``associateLookup(Lookups.singleton(obj));`` line in the constructor will add a new instance of ``Event`` to the ``Lookup`` of the ``TopComponent`` . When the ``TopComponent`` is selected, its ``Lookup`` is passed into the global context. For more details, see xref:wiki::wiki/index.adoc#_lookup[NetBeans Lookup].
-
++
+NOTE: The ``associateLookup(Lookups.singleton(obj));`` line in the constructor will add a new instance of ``Event``
+to the ``Lookup`` of the ``TopComponent`` . When the ``TopComponent`` is selected, its ``Lookup`` is passed into
+the global context. For more details, see xref:wiki::wiki/index.adoc#_lookup[NetBeans Lookup].
++
Make sure to import the correct ``Event`` class, that is, ``com.mycompany.mavenselectionsuite.Event`` .
-[start=8]
-1. Change the ``@TopComponent.OpenActionRegistration`` so that no ``preferredId`` is defined, as shown below, which means that a new Editor window will open whenever you choose Window | Editor in the menubar:
-
-
+8. Change the ``@TopComponent.OpenActionRegistration`` so that no ``preferredId`` is defined, as shown below, which
+means that a new Editor window will open whenever you choose Window | Editor in the menubar:
++
[source,java]
----
-
@TopComponent.OpenActionRegistration(displayName = "#CTL_MyEditorAction")
----
-
-The text field in the component only displays the index value and date from the ``Event`` . This will enable you to see that each MyEditor component is unique and that MyViewer is displaying the details of the MyEditor component that has the focus.
++
+The text field in the component only displays the index value and date from the ``Event`` . This will enable you to
+see that each MyEditor component is unique and that MyViewer is displaying the details of the MyEditor component that
+has the focus.
=== Building and Running the Application
@@ -463,17 +431,22 @@ The text field in the component only displays the index value and date from the
Now that the target installation of the IDE is specified, you can use the Run command on the *app* project.
-[start=1]
-1. Right-click *app* project and choose Run. The application starts up, consisting of the NetBeans Platform, together with the custom modules you created.
-
+1. Right-click *app* project and choose Run. The application starts up, consisting of the NetBeans Platform, together
+with the custom modules you created.
-[start=2]
-1. The MyViewer window opens when the application starts and displays the two labels. You can now choose MyEditor from the Window menu, multiple times, to open multiple MyEditor components in the editor area. The MyViewer window will display the details of the currently selected MyEditor component.
+2. The MyViewer window opens when the application starts and displays the two labels. You can now choose MyEditor from
+the Window menu, multiple times, to open multiple MyEditor components in the editor area. The MyViewer window will
+display the details of the currently selected MyEditor component.
++
+image::tutorials/maven-suite_27_pic13.png[title="Final result: running the application"]
-image::tutorials/maven-suite_72_pic13.png[title="screenshot"]
-This tutorial demonstrated how to create and run a NetBeans Platform application that you create from a Maven archetype. You saw how applications are structured and how you configure a modules POM to specify public packages. Most important of all, you learned how to publish objects into the selection and how to listen for them and update other parts of the application accordingly. For more examples on how to build NetBeans Platform applications, see the tutorials listed in the xref:kb/docs/platform.adoc[NetBeans Platform Learning Trail].
+This tutorial demonstrated how to create and run a NetBeans Platform application that you create from a Maven
+archetype. You saw how applications are structured and how you configure a modules POM to specify public packages.
+Most important of all, you learned how to publish objects into the selection and how to listen for them and update
+other parts of the application accordingly. For more examples on how to build NetBeans Platform applications, see the
+tutorials listed in the xref:kb/docs/platform.adoc[NetBeans Platform Learning Trail].
xref:front::community/mailing-lists.adoc[ Send Us Your Feedback]
@@ -488,5 +461,6 @@ For more information about creating and developing on the NetBeans Platform, see
* xref:wiki::wiki/index.adoc[NetBeans Developer FAQ]
* link:https://bits.netbeans.org/dev/javadoc/[NetBeans API Javadoc]
-If you have any questions about the NetBeans Platform, feel free to write to the mailing list, dev@platform.netbeans.org, or view the link:https://mail-archives.apache.org/mod_mbox/netbeans-dev/[NetBeans Platform mailing list archive].
+If you have any questions about the NetBeans Platform, feel free to write to the mailing list,
+dev@platform.netbeans.org, or view the link:https://mail-archives.apache.org/mod_mbox/netbeans-dev/[NetBeans Platform mailing list archive].