Download NetBeans!

20081031 Friday October 31, 2008

In Praise Of... Russell Brand

One of my favorite columnists from my favorite newspaper, the Guardian, is in "a spot of bother". (He made an "inappropriate" prank call on his BBC 2 radio program.) I have been an admirer of Russell Brand for several years. His weekend sports column, focusing primarily on his love for West Ham, the football club of which he is an ardent fan (and which turned out to be a dank little corner of London when I ended up near there accidentally about a year ago), is simply brilliant. His sentences are colorful, lively, warm, amazing. And completely original. His metaphors are incredible. He makes reading about sport a literary endeavor. Read these articles to get an impression of his style:

I'd never have thought I'd use this word to describe someone's way of speaking, but I saw his language referred to recently as "baroque", which is exactly right.

To see his true & 100% original brilliance, a David Letterman piece should serve well:

Other things I've seen of him on YouTube are a lot less good than the above (though his appearance on the Craig Ferguson show was also pretty brilliant). Anyway, I never knew that he had a show on BBC 2 and, now that I know, I'm very surprised at that. They don't deserve him and never did. Good for him for having resigned. And I'm looking forward to his next column already (one of the highlights of my weekend).

Oct 31 2008, 03:33:52 AM PDT Permalink

Download NetBeans!

20081030 Thursday October 30, 2008

5 Minute Video: How Grails Does AJAX

Brief introduction, which should be fleshed out a bit at some point, but provides an introduction:

Read more about it, with related links, here on NetBeans.tv.

In other news. The sound quality of the screencast above is much better than previously. Why? Because I found the "Remove Noise" button in Camtasia. Seriously, is that something that I should have to explicitly invoke? Why would I want to KEEP the noise?!

Oct 30 2008, 12:48:27 AM PDT Permalink

Download NetBeans!

20081029 Wednesday October 29, 2008

Understanding the NetBeans Platform in Two Pictures

The pics below sum up everything you need to know to conceptually understand the NetBeans Platform, an application framework for large distributed Swing applications:

The above is Toni Epple, from Eppleton, an independent Java consulting and project out sourcing company in Munich, Germany, presenting the NetBeans Platform in Gdansk, Poland. Several other pics available here and also here, with probably more coming in the next few days, from the NetBeans Days that took place in Poland over the past weekend.

Oct 29 2008, 06:39:13 AM PDT Permalink

Download NetBeans!

20081028 Tuesday October 28, 2008

6 Minute Video: Groovy Makes Code Generation Simple

My screencast skills aren't perfect yet, but getting there. I've now learned how 'call outs' work. Some of the timing is still slightly off and the screencast ends quite abruptly. Aside from that, the basic point of the screencast comes across well enough. Have a look (6:22 mins):

The text right at the end, which disappears as soon as you see it, says: "That's all folks. Have fun with Groovy! Clearly it makes code generation a piece of cake, not just for files, but even for complete source structures!"

Go here to download the screencast for off-line viewing.

The basic principles outlined above have several implications that I don't I go into in the screencast, but will do so next time. However, I'm sure there's more than enough in there to give anyone a couple of interesting ideas.

Oct 28 2008, 08:11:48 AM PDT Permalink

Download NetBeans!

20081026 Sunday October 26, 2008

Poznan & Gdansk: NetBeans Day, Poland

I've spent the weekend with Karol Harezlak, Toni Epple, and Adam Bien in Poland—specifically in Poznan and Gdansk, because these two cities constituted the locations of NetBeans Day, Poland. It was a pretty excellent time. Both days had a very strong focus on the NetBeans Platform, which was pretty cool. The trip to these places was pretty long (Karol drove the whole way), with me being the GPS, together with Karol's iPhone. Parts of the time the whole map disappeared (thanks Steve Jobs) and I had to try and keep a green dot on a purple line without knowing anything about where we were (the green dot was the car and the purple line was the route from the office in Prague to the hotel in Poznan and then a day later from Poznan to a hotel in Gdansk). The drive from Poznan to Gdansk with Adam and Toni in the back seat was especially memorable.

The time spent at the two events was really good. Toni's presentation on 'Porting a Swing Application to the NetBeans Platform' was excellent—a good follow up to my 'Creating an Application on the NetBeans Platform'. Toni's real life experiences in this context are great—much better if someone 'out there' (i.e., unaffiliated to Sun) says nice things about the NetBeans Platform than when I do so. Then there was Adam Kędziora in Poznan who talked about the NetBeans Platform too, in the context of his Innovator Grant project. He even discussed the Lookup API in some detail, which was pretty cool. Adam Bien was excellent with all his EJB-oriented demos and his very interactive presentation style. Jacek Laskowski from the NetBeans Dream Team did a presentation on a more advanced level to Adam's (they'd decided that beforehand and, on some points, during Adam's presentation). It was the 1st time for me to meet Jacek, who was great. (Hope to meet again soon, maybe in Warszawa?) Also, Adam Dudczak did a great presentation on VisualVM, including—an introduction to its APIs, as well as a demo of a plugin he made for VisualVM using those APIs. In addition, there were several other presentations too, all in Polish (apart from Toni, Adam, and me), such as the ones by Karol on Java ME development. As a sidenote, I started remembering more and more of my Polish (from several years ago when I studied it for no reason).

Ubuntu completely failed me both days and fortunately I had my presentation on a USB stick, so was able to deliver it on Karol's Mac. Unfortunately I couldn't do some of my demos though and I wasn't overly familiar with the Mac, which didn't make everything as smooth as it should have been. Honestly, despite everything else, I'm very close to giving up on Ubuntu completely. Aside from the continuing projector cable problems, it also refused to start up at some point, with very odd and scary messages. Then it suddenly started working again. Very erratic behavior. I suspect that there's a script that detects whether a projector cable is plugged in and, if "yes", a massive internal error is intentionally thrown just to give you stress for no reason. That's the only logical explanation I can think of.

There's one very interesting thing (even, dare I say it, revolutionary) I worked on in the breaks in between the sessions, something that I'll be creating a screencast about as soon as we find our way back to Prague (long way from Gdansk to Prague and the road will be purple and the dot will be green). Clue about that screencast—it's about Groovy and it's also about the NetBeans Platform. Watch this space for the details.

Finally, thanks to everyone who we met along the way, especially Adam and Kasia (what a great way to start our time in Poland that was) in Poznan and Kuba in Gdansk, as well as, of course, all the speakers, and Toni and Adam for flying to join us from Munich. I'm looking forward to the many photos and movies that were made and taken the last few days! Watch this space for those too.

Oct 26 2008, 10:49:38 AM PDT Permalink

Download NetBeans!

20081023 Thursday October 23, 2008

2 Minute Video: Groovy Makes Java Better

The first of several screencasts I am planning in relation to Groovy:

PS: When I said "on our dialog", I should have said "on our Groovy class".

Oct 23 2008, 11:32:01 AM PDT Permalink

Download NetBeans!

20081022 Wednesday October 22, 2008

NetBeans Platform Training Taking Off

A cool blog entry I found today by John, head of the Docs team:

Oct 22 2008, 12:26:33 PM PDT Permalink

Download NetBeans!

20081021 Tuesday October 21, 2008

"Developing Rich Client Applications Using Swing"

A new and interesting article at "AjaxWorld Magazine". Click the image below to jump straight to the article:

I'm hoping the article will continue by describing and comparing the various Swing application frameworks available—Spring RCP, JSR 296, NetBeans Platform, Griffon, as well as the docking frameworks, like MyDoggy and others. I would be very interested to see the author's take on all those.

Oct 21 2008, 01:28:02 PM PDT Permalink

Download NetBeans!

20081020 Monday October 20, 2008

NetBeans Platform APIs: Top 10 Runners Up

If yesterday's list of NetBeans APIs are to be seen as the NetBeans Platform's "Top 10 Greatest Hits" (the 10th place is still open to suggestions), then those that follow are its "Top 10 Runners Up". In other words, though the following don't belong to the central set of NetBeans APIs, they are important nonetheless and, in each case, are APIs that you need to have in your mental toolbox next time you start thinking about the infrastructure of your Swing application:

  1. Dialogs API. Enables you to provide user notifications, dialogs, and wizards that integrate well with the rest of the NetBeans Platform. In the NetBeans sources, see package "org.openide".

  2. Options Dialog and SPI. Enables you to integrate with the NetBeans Platform's Options window so that you can let the user customize the application. In the NetBeans sources, see package "org.netbeans.api.options/org.netbeans.spi.options".

  3. UI Utilities API. Enables you to provide a range of smaller visual items in your NetBeans Platform application—particular favorites are HTML browser integration, the Undo/Redo Manager, and status bar interaction. (Also have a look at the DropDownButtonFactory and TabbedPaneFactory, both of which I blogged about some time ago.) In the NetBeans sources, see package "org.openide.awt".

  4. MultiView Windows. Enables you create two views over the same file, typically a source view and a visual design view. In the NetBeans sources, see package "org.netbeans.core.api.multiview/org.netbeans.core.spi.multiview".

  5. Auto Update Services. Enables you to programmatically install/uninstall and enable/disable modules. In the NetBeans sources, see package "org.netbeans.api.autoupdate/org.netbeans.spi.autoupdate".

  6. I/O APIs. Enables you to write to the NetBeans Platform's Output window, including writing hyperlinks there, such as error messages which the user can then click on to jump to a relevant place in the source code or, possibly, somewhere on-line. In the NetBeans sources, see package "org.openide.windows".

  7. Progress API. Enables you to integrate with the NetBeans Platform's progress bar, to indicate to the user that they need to wait a bit longer during long running tasks. In the NetBeans sources, see package "org.netbeans.api.progress".

  8. Command Line Parsing API. Enables you to parse the command line from within a NetBeans Platform application. In the NetBeans sources, see package "org.netbeans.api.sendopts/org.netbeans.spi.sendopts".

The final two runners up (below, 9 and 10) are not actually APIs. They are, like the above, of course, provided in the form of a NetBeans module. However, in these cases, you can't program against these modules. I.e., for example, you need to do a bit of Java coding to work with the Command Line Parsing API. These two, however, require no coding. Simply include them in your NetBeans Platform application and you've immediately integrated them:

  1. Favorites. Provides the Favorites window, which functions as a file browser. You can brand it quite easily, replacing the strings with your own.

  2. JavaHelp Integration. Provides the infrastructure for JavaHelp help sets.

That's it. I believe that the above 10, and the previous 10, together make up the top 20 modules that the NetBeans Platform makes available. The remainder are mostly support modules for the above or low-level infrastructural modules that could be addressed in a future blog entry.

You might be wondering: "Where are all the editor-related APIs?" Well, those APIs are not part of the NetBeans Platform. They are made available by NetBeans IDE, which is just one of many applications on top of the NetBeans Platform. Those can also be looked at in a future blog entry, but have nothing to do with the modules that the NetBeans Platform makes available. From these two lists, therefore, you should be able to see that the NetBeans Platform isn't concerned with editor applications, necessarily. It provides the basis for any kind of Swing application (small or large) that needs the above services.

Oct 20 2008, 12:00:00 AM PDT Permalink

Download NetBeans!

20081019 Sunday October 19, 2008

NetBeans Platform APIs: Top 10 Greatest Hits

In the first place, the NetBeans Platform is a runtime container for desktop applications, comparable to an application server for web applications. Both handle common concerns, such as lifecycle management, for their target application type. However, secondly, the NetBeans Platform is a set of libraries.

In my (humble) opinion, these are the top 10 libraries offered by the NetBeans Platform APIs:

  1. Module System API. Enables the modular structure of NetBeans Platform applications. In the NetBeans sources, see package "org.openide.modules". Start reading about it here.

  2. Window System API. Enables you to create an application with advanced logical window functionality, such as drag/drop, dock/undock, maximize/minimize. In the NetBeans sources, package "org.openide.windows". Start reading about it here.

  3. Lookup API. Enables communication between modules similarly to the ServiceLoader class in JDK 6, as well as the context sensitivity of windows, nodes, and data objects in the application. This API can also be used outside the NetBeans Platform. In the NetBeans sources, package "org.openide.util.lookup". Start reading about it here.

  4. File System API. Enables the modules in an application to communicate by means of a virtual file system which is, by default, a hierarchical structure of folders and files defined in XML documents. In the NetBeans sources, package "org.openide.filesystems". Start reading about it here.

  5. Nodes API. Enables you to provide visual representations of underlying objects, i.e., these are NetBeans Platform JavaBeans. This API can also be used outside the NetBeans Platform. In the NetBeans sources, package "org.openide.nodes". Start reading about it here.

  6. Explorer & Property Sheet API. Enables you to render nodes in one of several NetBeans Platform Swing components that are, via the NetBeans ExplorerManager, loosely coupled to the rendered nodes. This API can also be used outside the NetBeans Platform. In the NetBeans sources, package "org.openide.explorer". Start reading about it here.

  7. Datasystems API (also known as "Loaders API"). Enables custom file types to be represented in the application. If the application does not make use of custom file types, this API can be ignored. In the NetBeans sources, package "org.openide.loaders". Start reading about it here.

  8. Actions API. Enables you to include actions that can be hooked up to menu items and toolbar buttons in your application, where you can define them as being always available or context sensitively enabled. In the NetBeans sources, package "org.openide.actions", with the related package "org.openide.util.actions". Start reading about it here.

  9. Visual Library API. Enables you to add widgets to your application, with common functionality, such as 'zoom' and 'move' provided out of the box. This API can also be used outside the NetBeans Platform. In the NetBeans sources, package "org.netbeans.api.visual". Start reading about it here.

  10. What do you think..?

I doubt that there'll be much argument about the top 9 listed above (apart from, possibly, the Datasystems API, which those who don't use custom file types are probably not using; and potentially someone will argue that the whole 'runtime container' should be included in the first item, rather than just the Module System API). But... what should no. 10 be? Options? I/O? Common Palette? Something else? Suggestions (with justifications!) welcome.

Oct 19 2008, 10:50:55 AM PDT Permalink

Download NetBeans!

20081018 Saturday October 18, 2008

"But... Don't All NetBeans Platform Applications End Up Looking Like NetBeans IDE?"

I had an interesting discussion recently which started when someone's central reservation to using the NetBeans Platform turned on their assumption that the end product would "look a lot like NetBeans IDE".

That is not a very surprising assumption. It is logical to assume that you should consider building your Swing application on the NetBeans Platform if you're thinking about creating "some kind of editor". But it shows a misunderstanding of what the NetBeans Platform is. The NetBeans Platform is not bits and pieces removed from NetBeans IDE. Quite the opposite, in fact: NetBeans IDE is bits and pieces placed on top of the NetBeans Platform! I.e., the relationship is the other way round: the NetBeans Platform is the dominant partner, while the NetBeans IDE is just one way (of many) in which the NetBeans Platform can be used.

However, of course, when it comes to talking about how something "looks", one shouldn't be using words. One should be using pictures. So here are three applications on top of the NetBeans Platform:

None of them look like any kind of IDE. Say about them whatever you like, but you can't say: "Wow, those look a lot like NetBeans IDE". The only thing the above have in common with NetBeans IDE is their infrastructure, not "the way they look". Many more screenshots (and more are being added all the time) can be found here.

Oct 18 2008, 08:42:17 AM PDT Permalink

Download NetBeans!

20081017 Friday October 17, 2008

NetBeans Platform Certified Training Mentioned on java.net

Oct 17 2008, 10:57:29 AM PDT Permalink

Download NetBeans!

20081016 Thursday October 16, 2008

How Users Can Let Children Move Up & Move Down (Part 2)

In How Users Can Let Children Move Up & Move Down (Part 1), the children class extended Index.ArrayChildren. That was extremely convenient, because (in order for the 'Move Up' and 'Move Down' menu items to be enabled), an implementation of the Index class MUST be included in the root node's Lookup. Since an implementation of Index.ArrayChildren meets this requirement, things look good so long as you're using that class. However, what if you're extending Children.Keys instead? That's the vexing question posed in this blog entry.

In the case where you're not extending Index.ArrayChildren, you have a problem. In this case, you need to create a new class that extends Index.Support, with content like this:

import javax.swing.JOptionPane;
import org.openide.nodes.Index;
import org.openide.nodes.Node;

public class IndexSupportImpl extends Index.Support {

    private PropChildren prop;

    public IndexSupportImpl(PropChildren prop) {
        this.prop = prop;
    }

    @Override
    public Node[] getNodes() {
        return prop.getNodes();
    }

    @Override
    public int getNodesCount() {
        return prop.getNodesCount();
    }

    @Override
    public void reorder(final int[] perm) {
        JOptionPane.showMessageDialog(null, "reorder here!");
    }
    
}

The "only" problem is that I haven't been able to figure out how to implement the 'reorder' method above. I've seen all the related sources but haven't been able to figure it out. Anyway, now you need to add the above implementation of Index to the root node's Lookup:

PropChildren prop = new PropChildren();
explorerManager.setRootContext(new AbstractNode(prop, Lookups.singleton(new IndexSupportImpl(prop))));

And, finally, your children object needs to implement Index and then delegate to the above Index.Support class. At least, then the menu items will be enabled, even though the 'reorder' will need to be figured out per implementation.

Oct 16 2008, 01:39:41 PM PDT Permalink

Download NetBeans!

20081015 Wednesday October 15, 2008

NetBeans Podcast Episode 47 (Part 2)

Lloyd and I very conscientiously send prizes to those who win the 'NetBeans Puzzler of the Podcast'. We tend to ask, sometime afterwards, for a pic of the happy winner together with their prize.

Below you see one of our recent winners, Lukáš Vlček, with his prize and his daughter:

Below is the text he sent with the picture:

You can see that the book is now the natural course of events in our family. My daughter cannot wait to get her hands dirty with the code while I read the book and naturally she cannot fall asleep without me reading her at least one chapter covering an advanced NetBeans API topic. If I were to describe this book then I would borrow words from Albert Einstein: "If you want your children to be intelligent, read them fairy tales. If you want them to be more intelligent, read them more fairy tales." Yes, this book is unbelievable!

Finally, if you ever won the NetBeans Puzzler of the Podcast and did not receive your prize (Robert Appleby in Australia is potentially someone falling in this category), please DO write and let us know! We really don't want disgruntled winners spread around the world as a result of our forgetfulness, incompetence, or otherwise. So write to nbpodcast@netbeans.org if you won a prize without actually receiving it.

Oct 15 2008, 01:52:55 PM PDT Permalink

NetBeans Podcast Episode 47 (Part 1)

Another podcast filled with info, insights, and innuendo!

Here's the agenda (34.17 mins):

  • 1.00: News. Tinu Awopetu, Managing Editor of NetBeans.org, talks about the NetBeans Calendar (next stop of NetBeans Day is Seoul, South Korea, October 17th, i.e., this Friday!), the 10th birthday of the NetBeans project, and... the NetBeans Decathlon!
  • 3.40: Interview. David Strupl, technical lead of JavaFX support in NetBeans IDE, is interviewed by Lloyd. Find out all about David, his technical background, and what's going on with JavaFX tooling in the IDE. Also find out about JavaFX itself, as well as JavaFX script. How does JavaFX script compare to other scripting languages? And what will the NetBeans tools for JavaFX actually consist of? What makes working on this project interesting? David tells all and asks for user feedback!
  • 15.30: API Design Tip. Are APIs like stars or are they like diamonds? Jaroslav Tulach hooks into a discussion connected to Josh Bloch (here in the comments) about whether APIs are 'stars' or 'diamonds'. What's the difference between these two metaphors and what does the difference say about APIs? (In the process of the discussion, Geertjan shows he's not very smart.)
  • 22:40: NetBeans Innovator Grant Contest. Jirka Kovalsky talks about the NetBeans Innovator Grant Contest. He talks about how shocked he was at the amount of submissions and, then, how impressed he was with their quality. He thanks the NetBeans Dream team for selecting the best 20 proposals and for defining the process/rules as well.
  • 28.30: Project of the Podcast. For the first time, we talk to a NetBeans user on the NetBeans Podcast. Brian Segale, who manages the Solutions Team at DeviceAnywhere, talks about the NetBeans modules they developed for their mobile solutions.
  • 33.00: Puzzler. We announce the previous winner and introduce the next puzzler! Deadline: Friday, October 31, all submissions to nbpodcast@netbeans.org. And, if you write with ideas for future podcasts, and your idea ends up being used, we'll send you a NetBeans t-shirt in gratitude!

Click here to hear it all:

Alternative source: http://feeds.feedburner.com/NetBeansPodcast

Many thanks to Lloyd for stringing everything together!

Oct 15 2008, 06:04:32 AM PDT Permalink