This is something that will probably look at first like a convoluted way to do something simple.
However, I think it’s actually quite a simple way of doing something that is otherwise quite complicated.
[A quick overview]
An EditableAspect defines a collection of properties related to a specific feature of an object type. It also defines how PropertyComponents should be created for these properties.
EditableAspect::Container is a base for objects wishing to expose EditableAspects. It is an interface for providing a list of supported aspects, as well as Value objects wrapping the data the properties represent.
An AspectEditor wraps a PropertyPanel with the ability to display properties for objects derived from EditableAspect::Container.
The main unique feature this system provides is the ability to edit properties of multiple target objects at once, even if they are not of the same type. The AspectEditor can be given an array of EditableAspect::Container objects to show properties for. As each container provides a list of supported aspects, the editor is able to determine which aspects are common to all containers, and show their properties. Also, as the properties are provided in the form of Value objects, it is able to automatically bundle matching properties of multiple targets into proxy Values.
There’s a lot more to it than that; have a look at the comments in the header for more information.
If nothing else, it also provides a ‘pattern’ of sorts for dealing with a PropertyPanel; though the basic PropertyPanel is very useful, you’re very much on your own when it comes to figuring out how to make it work with your data model.
Download EditableAspect_v0.zip
[Haven’t got any shareable example code yet I’m afraid, but hopefully the comments are reasonably clear]
When i have a bit more time, I’ll try to put together a more comprehensive description of how it all slots together. However, I’ll first wait to see if anyone even cares!