Category Archives: java

Netbeans file type integration tutorial comments

Netbeans 7.1rc1 has been released. When I went through the file type tutorial (which has been updated for 7.1) I found a couple of minor niggles which needed more than a couple of lines in a comment to express, hence this post.  In Summary, it’s a good tutorial, but there a few rough edges that could be ironed out:

  • A design bug in the properties window section,
  • Missing the visual library api dependency,
  • Excessive overiding the default action on file context menu,

and it would really benefit from some extensions, particularly:

  • implementing a navigation window instead of a node tree under the file node,
  • real-time synchronisation across all views.

Continue reading Netbeans file type integration tutorial comments

Eclipse + Ubuntu + Groovy pain

A couple of days ago the v2 Groovy Eclipse plugin was released, but sadly I’m still not able to use it on my Ubuntu desktop because of a fairly convoluted set of configuration problems.

The first is that the linux download of eclipse doesnt work very well in the latest version of Ubuntu (Karmic Koala). A work around is described here with further links to Ubuntu’s issuelist. But actually the work around is only a partial fix because Eclipse sometimes starts a copy of itself and, when it does, it ignores the work around. This affects me as I’m currently trying to develop plugins.

One alternative approach that has worked for me so far is to use the version of eclipse that’s in the Ubuntu repositories. However, this version wasn’t taken from the final release of the eclipse codebase and the groovy plugin install, which patches the JDT (Java Development Toolkit) just wont install in this version.

So to use the groovy plugin it looks as though I’ll have to wait for Eclipse 3.5.2 (which is due on February 29th).

Scripting languages in Java – manipulating an EMF model

I’m currently attempting to embed a scripting engine into a Java application. The Java Scripting API means this exercise should be quite straightforward (at least to get something up and running) and there is a huge choice of script languages to choose from so one of them ought to match my requirements, right?

I’m taking baby steps while I explore the space of possible options.  So far I’ve prototyped an expression evaluator that accepts data in the form of simple Java  framework objects and allows boolean expressions to be evaluated over them. In today’s baby step I thought I’d try and manipulate some non-framework Java objects built with an EMF model that I’m currently working on and two different scripting languages, Groovy and Rhino. Groovy is a scripting language that has grown out of the Java community in response to Python and Ruby.  Rhino is a Javascript engine implemented in Java from the Mozilla foundation that is bundled as the default scripting engine in the Java6 JDK.  I got somewhere with Groovy but got completely stumped with Rhino because I just couldn’t load my custom classes.

Continue reading Scripting languages in Java – manipulating an EMF model

ArgKit: An argumentation toolkit

ArgKit websiteLast week I released an open source project: ArgKit. It’s the synthesis of some work that I’ve been doing in the last couple of years and I’m very pleased with it. I’ve released early (ish) on this one, so there is more work to come in the same vein, time and attention allowing. One thing that ArgKit’s website misses is some background on “what is argumentation?” so I thought I’d just blog something about Dungine – the only tool in the toolkit at the moment, based on an email I sent to a friend recently (thanks for the question Steve).

Continue reading ArgKit: An argumentation toolkit

You lied to me when you said this was a program

A Dutch colleague introduced me to a while ago – an excellent software engineering resource. I hadnt noticed it before* but today I was most tickled by a quote he has on his code page:

A friend of mine in a compiler writing class produced a compiler with one error message ‘you lied to me when you told me this was a program’


* Maybe I did notice it before and didnt get it. Since I first looked at that site I’ve done some work with the RACC, JACC and JavaCC compiler compilers (of the two Java compiler compilers, I prefer JavaCC).

Java status bar

This might save someone else a little bother. I’ve been building Java Swing demo’s in the last few months and one thing that has slowed me down is building a status bar. A status bar is the strip at the bottom of a window that contains useful information about the status of an application. As an example, here is the status bar for my skype client:

skype status bar

There is no standard swing control (container) to do this so you must roll your own. Searching for “java status bar” didnt get me very far. Initially I just used a JLabel, but this is too simple. I really wanted something with multiple recessed panels (as in the skype example). I considered using an unfloatable JToolBar but I dropped this idea because a toolbar’s default background doesnt look like a status bar and because its not easy to make the recessed panels this way. Finally I realised that the best way to build my status bar is to nest JPanels. Continue reading Java status bar