brainless-studios / alchemist

Other
2 stars 1 forks source link

Property editor factory #8

Open methusalah opened 8 years ago

methusalah commented 8 years ago

Right now, the property editor factory in the inspector window instanciate the correct PropertyEditor in a big hardcoded switch.

This is correct and efficient design, but not very extensible. And users will want to add their own PropertyEditors to edit their own data classes.

I propose to change the factory to become more dynamic : It would scan a specific package (and subpackages) of the user project by reflexion to find PropertyEditor implementations and add them to its collection.

Because reflexion take time at each run, it seems stupid to scan for the built-in PropertyEditor. so the factory would also accept implementations in a classic way.

This will need the PropertyEditors to store the class they are able to edit, probably with an anotation