| This class contains all the basic functionality for a property editor. It extends
JPanel, so it could be added to a JScrollPane. The PropertyEditor always has
an associated PropertyEditorTarget that acts as the "model" for the PropertyEditor
To implement your PropertyEditor, you have to design a GUI with all the properties
you want the user to see. You have to register the necessary listeners to get notified
if a value is changed by the user in order to set the property in the model.
Additionally you might want to register a PropertyChangeListener that gets notified
if a property is changed in the model (for example by a second window based on the
same model).
In your implementation you should override setEditorTarget() to check, whether you get a correct
object set as editorTarget and to retrieve the inital set of values from the editorTarget.
If your Panel only contains components that implement PropertyEditorComponentInterface,
you do not have to setup any listeners, you just should check that you get the correct
object in setEditorTarget, everything else will be handled by this container. If you
group components withing Panels and add those panels to this container, these panels
have to implement PropertyEdtitorComponentInterface as well, the contained Components wouldn't
get notified of a editorTarget change otherwise.
author: Florian Bruckner version: $Id: PropertyEditor.java,v 1.1.2.1 2005/12/21 22:33:27 tomdz Exp $ |