new EditorMananger()
Property editor manager. This class is used to select most suitable property editor for a certain property
in object inspector.
Methods
-
findEditorClass(objClass, propInfo) → {Class}
-
Find a suitable property editor class based on objClass and propInfo. If nothing found, null will be returned.
Parameters:
Name Type Description objClass
Class propInfo
Object Returns:
- Type
- Class
-
findEditorClassForType(propType, propName) → {Class}
-
Find a suitable property editor simply by property type and property name. This method is useful to find property editor for some simple type value (such as object, array element).
Parameters:
Name Type Description propType
String propName
String Returns:
- Type
- Class
-
register(editorClass, propType, objClass, propName, matchFunc)
-
Register a property editor. Usually at least one of propType, objClass, propName and matchFunc param should be set. If nothing is set, a default editor will be registered.
Parameters:
Name Type Description editorClass
Class Property editor class. propType
String Type of property, value from DataType. Set null to match all types. objClass
Class Target class. Property editor will only apply to properties in this class. Set null to match all classes. propName
String Property name. Property editor will only apply to property with this name. Set null to match all property names. matchFunc
Func A custom function to check if property editor matches on a property. The function is in the following form: match(objClass, propInfo) and should return a boolean result. -
unregister(editorClass)
-
Unregister a property editor.
Parameters:
Name Type Description editorClass
Class