Please see code at http://trac.openmicroscopy.org.uk/shoola/browser/branches/ProtocolEditor/src/tree/DataField.java