This is the base class when using a tree based property editor for any kind of objects. Those objects can go from simple beans to {@link org.jamesii.core.parameters.ParameterBlock}s used to parameterize a factory. The editor provides easy access to arbitrary properties of a given object and its properties and subproperties. It also provides the option to provide custom editors for special properties and/or special values. It also provides the option to provide custom implementations for specific properties which are shown in a dropdown for selection. The entire property determination process is transparent in a way that it is possible to provide arbitrary properties for an object, property or subproperty using {@link IPropertyProvider} implementations.
To use this component you can just pass an object which's properties you want to edit. If no special {@link IPropertyProvider} is provided only write andreadable bean properties are displayed. Also only a bunch of standard editors are integrated by default this include editors for numbers, Strings, Fonts and booleans. Any other editor should be custom registered using {@link #registerEditor(Class,IPropertyEditor)}. If you want to provide more or different properties than bean properties you can register a custom property provider using {@link #registerPropertyProvider(Class,IPropertyProvider)}. In case a property provider provides unwanted or to many properties you could also use a custom {@link IPropertyFilter} implementation with{@link #registerPropertyFilter(IPropertyFilter)} instead of implementinganother custom {@link IPropertyProvider}.
To provide special values for properties you can provide a list of assignable values by providing a {@link IImplementationProvider} using{@link #registerImplementationProvider(IImplementationProvider)}.
An example usage could look like this:
... ObjectEditorComponent c=ObjectEditorComponent(object); c.registerEditor(Double.class, new DoubleImplementationProvider()); panel.add(c, ...);
The example creates an editor component for a given object. Assuming the object has a {@link Double} property a{@link org.jamesii.gui.utils.objecteditor.implementationprovider.DoubleImplementationProvider}is provided to be able to set the property to {@link Double#POSITIVE_INFINITY} or {@link Double#NEGATIVE_INFINITY}.
E.g., {@link org.jamesii.gui.utils.parameters.factories.FactoryParameters}makes heavy use of this component with custom {@link IPropertyProvider}s as well as {@link IImplementationProvider} for plugin types. There thiscomponent is used to fill a {@link ParameterBlock} for a specified{@link org.jamesii.core.factories.Factory}, including plugin type assignment and sub {@link ParameterBlock}s for sub plugin type parameters.
@author Stefan Rybacki