A number of Bridge UI components need to provide the ability for users to edit individual properties, either of replicated objects or of EmbeddedObjectDescriptors. Currently we usually just support double-clicking these to open a JOptionPane for editing the value. This is clunky, and also generally prevents us from supporting constrained input (e.g., only allowing digits using a custom Document object).
A solution to this would be a utility class that could be attached to any JTextComponent and would:
- Initialize itself with the value of an object or descriptor property
- Automatically enable/disable itself based on the object or descriptor's permissions
- Evaluate (or pass in parameter) on construction, then re-evaluate on mouse click?
- Update itself on property changes
- Only if it doesn't have focus?
- Support editing, with property update deferred until focus was lost (or timeout)
- Add popup with "revert" options?
- Should have option for null vs. empty string on empty field
An initial version of this was added 030618 (bridge.swing.PropertyEditorHelper).
|