Samples
Java Web Start
A Java Hacker's Worksheet

This is a worksheet where the cells contain arbitrary Java objects. They are described by a Java-like expression language: you can type a "Java" expression into a cell, and it will be parsed, executed, and the result will be cached as the contents of the cell. From this page, the worksheet is available both as an applet and as a Web Start application: in the latest release of jga (0.7), it is included as a stand-alone application as well. Both the standalone and the Web Start versions can read and write files on your local filesystem (with an appropriate warning in the case of the Web Start version).

The langauge is a subset of a Java 1.5 grammar, whose BNF form is available here. While it is an incomplete subset of the Java expression syntax, what's already implemented is enough to be interesting. You can do basic arithmetic (with all standard Number implementations, including BigDecimal and BigInteger), relational comparisons, shifts, boolean expressions, conditionals, call constructors and methods, reference member variables, cast values, test instanceof, and reference class constants.

There are minor extensions to cover the spreadsheet-like functionality that is inherent in this form.

The following expression syntax is not yet implemented

Note that this is running the jga-0.7.jar, and it makes very heavy use of the FunctorParser, which allows you to programatically parse expressions into Functors, doing things like:

      UnaryFunctor fn = parser.parseUnary("x.length()", String.class);
  
to create a functor that returns the length of any string you pass it (as an Integer). The parser (and its generified derivitive GenericParser) is available programaticlly, allowing functors to be described using a more natural expression syntax. The visual basis of the Hacker's Worksheet is the net.sf.jga.swing.spreadsheet.Spreadsheet class that forms the basis of the: this is a JTable derivative that can be used like any other Swing widget in rich client applications.