Cancellable Tasks in Netbeans Platform

I was trying to implement cancellable tasks in Netbeans Platform using this blog post as reference.

However I never managed to make it work. The tasks’s thread would never get interrupted even after the confirmation dialog, the task would just keep running.

After some digging on the Netbeans Platform and IDE source code, I think I managed to find a way to properly and easily implement cancellable tasks.

netbeans platform

Recursive Python AWS Lambda Functions

There are times where some processing task cannot be completed under the AWS Lambda timeout limit (a maximum of 5 minutes as of this writing). A possible solution for these kind of situations is to implement a recursive approach to perform the processing task.

Basically, if you are able to separate the task into multiple chunks or batches, then you could make each batch to be processed by a different Lambda function. The amount of Lambda functions necessary to finish the task will scale accordingly.

aws lambda python serverless

Displaying Images in Netbeans Platform Node Tooltips

Netbeans Platform allows you to display HTML inside a node’s tooltip text. Naturally this means you can display images. For example, project nodes in the Netbeans IDE display icons related to errors (if there are any) and version control:

Netbeans Node Tooltip Images

Achieving this is not very straight forward, since the documentation doesn’t really say much on how to load this image. Fortunately it is very simple.

netbeans platform

Troubleshooting Strange AWS Issues

We’ve all been there. The same things working fine one time but failing other times without any idea why.

This post is a list of troubleshooting strange issues I’ve encountered when using AWS.

ElasticBeanstalk Failing to Create RDS Security Group

I was having an issue where I couldn’t create and attach an RDS database to an ElasticBeanstalk environment because an RDS security group was failing at being created. All this was being done using the AWS console.

aws

Loosely Coupled Node Actions in Netbeans Platform

Nodes in Netbeans Platform can possess actions that can be executed with the node object as context. For example, the Project, Package, and Class nodes in the Netbeans IDE have a set of actions which can be seen by right clicking on the nodes:

Netbeans IDE Node Actions

In the Netbeans Platform tutorials I found a tutorial that explains how to add these actions to nodes. The problem is that in that tutorial the action class was created as an inner class of the node class. Making the action tightly coupled with the node.

I managed to implement a more modular and loosely coupled approach, which is what I will explain in this post.

Our loosely coupled approach will basically allow us to:

  1. Keep the domain logic (Java Beans and POJOs) in its own domain module.
  2. Keep the view logic (nodes that represent beans) in another module.
  3. Keep the node actions logic in yet another module. This allows us to plug and unplug different action’s that belong to separate modules. Making our application’s node actions very modular.

Let’s begin!

netbeans platform
← Newer Posts Older Posts →