Tonight I decided I was going to learn the NetBeans platform. I had an issue or two with an older tutorial for 5.0 but for the most part I was able to get something up and running.
This tutorial has a shiny web 2.0 icon "REQUIRES NetBeans 6.1". So I thought, great! The tutorial was written for NB 6.1! I won't have any issues...! I was wrong.
Generating the Skeleton Application
-----------------------------
1) The first step is a sign of things to come.
It says: "...the very first step is to create a module suite project."
Alright, that seems easy enough. However, the screenshot shows "NetBeans Platform Application" is selected instead of "Module Suite" and a few sentences later it tells you to create a NetBeans Platform Application Project. So I used my brain and chose "NetBeans Platform Application".
2) In step 2, I'd like to use Java 6's built in splash screen instead of the one NetBeans provides. The NB splash screen is delayed when opening, appears white until painted, etc. This does not seem possible in this dialog, but that's not a big deal.
2) In step 3, we're supposed to setup the libraries. My first problem is that when I go into the libraries section, certain clusters have all the modules selected (and the module list is disabled) yet the checkbox next to them is unchecked. In order to "uncheck" the modules, I have to first "check" the cluster to enable the modules list, then I have to uncheck them one by one. I'm used to the parent checkbox (the cluster) acting as a check all/uncheck all.
3) The next issue is in step 3, I'm supposed to copy and paste a list of entries into the config file so that my libraries matches the tutorial exactly. If I do this, and then open the project properties library section, I get a million red dependency errors. Finally, if I run the project I get a warning screen with dependency errors.
Tweaking the User Interface
-----------------------------
4) In step 2, it tells you to enter the XML layer field but it makes no mention of the code base field. What happens if the layer.xml is not in the same directory as the code base? "org/company/mypkg/layer.xml" does not match the default code base name. I looked at the screenshot for the next step, and just formatted them to be in the same package.
5) In step 4 of tweaking the user interface, it shows deleting New Project, New File.. but if I run the project these items do not exist so I was a bit confused what the purpose of deleting them was.
6) Since the image displayed deleting New Project and New File, that's what I did. Apparently, I'm supposed to be able to view these items in layer.xml, but when I open layer.xml all I have is this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "
http://www.netbeans.org/dtds/filesystem-1_1.dtd">
<filesystem>
</filesystem>
At this point, I'm thinking: "Oh my god I just deleted the New Project menu item! How do I get it back!"
7) layer.xml is misspelled as leyer.xml
8) I decided to copy and past the contents of step 5's layer.xml into my module's layer.xml to try and bring the new project items back. Doing this made some of the items in the <this layer in context> tree bold. Ok this is cool, but how the heck do I restore the New Project menu item!
9) Moving on, while tweaking the Window layout, I'm supposed to find some ComponentPaletteWstcref.xml file and change the open state to true. Ok, right click the Windows2 node, choose Find, "ComponentPalette". "No matching files were found". Great! I guess I don't need a component palette!
10) Another thing I noticed is that these files aren't even named the same. The tutorial shows them as runtimeWstcref.xml while the tree in NB 6.1 shows them as runtime.wstcref.
11) While writing that last line, NetBeans 6.1 came up with an error 20 seconds after finishing disabling the open state of runtime.wstcref:
"Cannot get shared access to
D:\dev\NBPlatformTutorialHTMLEditor\BrandingModule\src\com\mycompany\brandingmodule\runtimeWstcref.xml (probably opened for writing).
Alright, that makes sense.... I guess.
Running the Application
-----------------------------
12) Clean and Build All... Run... oh my it looks nothing like the screen shot and I get a bunch of warnings...
WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.editor uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead.
WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.options.editor uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead.
WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.editor.macros uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead.
WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.editor.codetemplates uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead.
WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.gsf uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead.
WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.gsf uses org.netbeans.modules.editor.highlights which is deprecated: Use org.netbeans.spi.highlighting (Editor Library 2) instead.
WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.html.editor uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead.
WARNING [org.netbeans.core.modules]: the module org.netbeans.modules.editor.plain uses org.openide.options which is deprecated: Use org.openide.util.NbPreferences instead.
I don't have an HTML Files tab even though I set favorites "state opened" to true.
I give up! Why can't this tutorial be straightfoward!? argh...