DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Power BI Embedded Analytics — Part 3: Power BI Embedded Demo
  • DGS GraphQL and Spring Boot
  • Auto-Instrumentation in Azure Application Insights With AKS
  • Deploying a Scala Play Application to Heroku: A Step-by-Step Guide

Trending

  • Kullback–Leibler Divergence: Theory, Applications, and Implications
  • Simplifying Multi-LLM Integration With KubeMQ
  • Optimizing Integration Workflows With Spark Structured Streaming and Cloud Services
  • Next-Gen IoT Performance Depends on Advanced Power Management ICs
  1. DZone
  2. Coding
  3. Tools
  4. How to Create a Custom Project Type in a Mavenized NetBeans Platform Application

How to Create a Custom Project Type in a Mavenized NetBeans Platform Application

By 
Geertjan Wielenga user avatar
Geertjan Wielenga
·
Sep. 24, 10 · News
Likes (0)
Comment
Save
Tweet
Share
15.2K Views

Join the DZone community and get the full member experience.

Join For Free

Let's take the NetBeans Project Type Module Tutorial and port it to a Maven-based NetBeans Platform application. In contrast to the Hello World Maven NetBeans RCP article, we'll now use the NetBeans IDE's tooling, since the aforementioned article has laid the foundation that we need for using the NetBeans IDE's Maven tooling intelligently.

Take the following steps:

  1. Create the project as follows:






  2. Right-click on the node with the orange icon ("NetBeans Platform based application"), which is the application node, and choose "Build with Dependencies".

  3. Right-click the application node and choose Run. Here's your application:


  4. Copy the three Java classes from the "NetBeans Project Type Module Tutorial" into "TextAnalyzerProjectType NetBeans Module", which is the functionality module. Specifically, put them into the main package within "Source Packages", which is "com.text.analyzer". Copy the two icons into "Other Sources", specifically into "src/main/resources/com.text.analyzer". Make sure that you change the location of the icons in the two Java classes where they are used, otherwise they will not be found when you run the application.

  5. In the POM file of the functionality module, define the "dependencies" section as follows:
         <dependencies>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-openide-util</artifactId>
                <version>${netbeans.version}</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-netbeans-modules-projectuiapi</artifactId>
                <version>RELEASE691</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-openide-util-lookup</artifactId>
                <version>RELEASE691</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-netbeans-modules-projectapi</artifactId>
                <version>RELEASE691</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-openide-filesystems</artifactId>
                <version>RELEASE691</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-openide-loaders</artifactId>
                <version>RELEASE691</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-openide-nodes</artifactId>
                <version>RELEASE691</version>
            </dependency>
        </dependencies>
  6. In the POM file of the application node, add this dependency:
            <dependency> 
               <groupId>org.netbeans.modules</groupId>
                <artifactId>org-netbeans-modules-projectui</artifactId>
                <version>RELEASE691</version>
            </dependency>
    The above is needed because we're depending on the Project UI API (see step 5 above). In that particular API, the "OpenIDE-Module-Needs" key is used in the manifest to specify that "ActionsFactory", "OpenProjectsTrampoline", and "ProjectChooserFactory" are needed by this module. Therefore, a module that implements and provides those classes is required, which is the Project UI module, which implements Project UI API. To ensure that that module will be available at runtime, you specify the dependency above as described, in the POM file of the application node. For details, go here.

  7. Repeat steps 2 and 3 above. Then open the Favorites window and browse to a folder that has a subfolder named "texts". Right-click on the folder that has a subfolder named "texts" and then click "Open Project". Here's your application, with the project opened:

 

Congrats, you've now ported the sample to a Maven based NetBeans Platform application.

application NetBeans

Opinions expressed by DZone contributors are their own.

Related

  • Power BI Embedded Analytics — Part 3: Power BI Embedded Demo
  • DGS GraphQL and Spring Boot
  • Auto-Instrumentation in Azure Application Insights With AKS
  • Deploying a Scala Play Application to Heroku: A Step-by-Step Guide

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!