Package net.sf.okapi.common
Class ParametersEditorMapper
- java.lang.Object
-
- net.sf.okapi.common.ParametersEditorMapper
-
- All Implemented Interfaces:
IParametersEditorMapper
- Direct Known Subclasses:
FilterConfigurationMapper
public class ParametersEditorMapper extends Object implements IParametersEditorMapper
Common set of methods to manage parameters editors.
-
-
Field Summary
Fields Modifier and Type Field Description protected LinkedHashMap<String,ClassInfo>descMapMap of the editor descriptions for this mapper.protected LinkedHashMap<String,ClassInfo>editorMapMap of the editors for this mapper.
-
Constructor Summary
Constructors Constructor Description ParametersEditorMapper()Creates an empty ParametersEditorMapper object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDescriptionProvider(String descriptionProviderClassName, String parametersClassName)Adds a new editor description provider mapping to this mapper.voidaddDescriptionProvider(ClassInfo descriptionProviderClass, String parametersClassName)Adds a new editor description provider mapping to this mapper.voidaddEditor(String editorClassName, String parametersClassName)Adds a new parameters editor mapping to this mapper.voidaddEditor(ClassInfo editorClass, String parametersClassName)Adds a new parameters editor mapping to this mapper.voidclearDescriptionProviders()Removes all editor mappings for this mapper.voidclearEditors()Removes all editor mappings for this mapper.IParametersEditorcreateParametersEditor(String parametersClassName)Creates an instance of the parameters editor for a given parameters class name.IEditorDescriptionProvidergetDescriptionProvider(String parametersClassName)Gets an object that can provide the UI description to use with a generic editor.voidremoveDescriptionProvider(String className)Removes a given editor description provider from this mapper.voidremoveEditor(String className)Removes a given editor from this mapper.
-
-
-
Field Detail
-
editorMap
protected LinkedHashMap<String,ClassInfo> editorMap
Map of the editors for this mapper.
-
descMap
protected LinkedHashMap<String,ClassInfo> descMap
Map of the editor descriptions for this mapper.
-
-
Method Detail
-
addEditor
public void addEditor(ClassInfo editorClass, String parametersClassName)
Description copied from interface:IParametersEditorMapperAdds a new parameters editor mapping to this mapper.- Specified by:
addEditorin interfaceIParametersEditorMapper- Parameters:
editorClass- the class information of the editor to add.parametersClassName- the class name of the parameters this editor can edit. If this class name is already listed, the exiting entry will be replaced by this one.
-
addEditor
public void addEditor(String editorClassName, String parametersClassName)
Description copied from interface:IParametersEditorMapperAdds a new parameters editor mapping to this mapper. This is the same as callingaddEditor(new ClassInfo(editorClassName)).- Specified by:
addEditorin interfaceIParametersEditorMapper- Parameters:
editorClassName- the class name of the editor to add.parametersClassName- the class name of the parameters this editor can edit. If this class name is already listed, the exiting entry will be replaced by this one.
-
addDescriptionProvider
public void addDescriptionProvider(ClassInfo descriptionProviderClass, String parametersClassName)
Description copied from interface:IParametersEditorMapperAdds a new editor description provider mapping to this mapper.- Specified by:
addDescriptionProviderin interfaceIParametersEditorMapper- Parameters:
descriptionProviderClass- the class information of the editor description provider to add.parametersClassName- the class name of the parameters this editor can edit. If this class name is already listed, the exiting entry will be replaced by this one.
-
addDescriptionProvider
public void addDescriptionProvider(String descriptionProviderClassName, String parametersClassName)
Description copied from interface:IParametersEditorMapperAdds a new editor description provider mapping to this mapper. This is the same as callingaddDescriptionProvider(new ClassInfo(descriptionProviderClassName)).- Specified by:
addDescriptionProviderin interfaceIParametersEditorMapper- Parameters:
descriptionProviderClassName- the class name of the editor description provider to add.parametersClassName- the class name of the parameters this editor can edit. If this class name is already listed, the exiting entry will be replaced by this one.
-
clearEditors
public void clearEditors()
Description copied from interface:IParametersEditorMapperRemoves all editor mappings for this mapper.- Specified by:
clearEditorsin interfaceIParametersEditorMapper
-
clearDescriptionProviders
public void clearDescriptionProviders()
Description copied from interface:IParametersEditorMapperRemoves all editor mappings for this mapper.- Specified by:
clearDescriptionProvidersin interfaceIParametersEditorMapper
-
removeEditor
public void removeEditor(String className)
Description copied from interface:IParametersEditorMapperRemoves a given editor from this mapper.- Specified by:
removeEditorin interfaceIParametersEditorMapper- Parameters:
className- the class name of the editor to remove.
-
removeDescriptionProvider
public void removeDescriptionProvider(String className)
Description copied from interface:IParametersEditorMapperRemoves a given editor description provider from this mapper.- Specified by:
removeDescriptionProviderin interfaceIParametersEditorMapper- Parameters:
className- the class name of the editor description provider to remove.
-
createParametersEditor
public IParametersEditor createParametersEditor(String parametersClassName)
Description copied from interface:IParametersEditorMapperCreates an instance of the parameters editor for a given parameters class name.- Specified by:
createParametersEditorin interfaceIParametersEditorMapper- Parameters:
parametersClassName- the parameters class name to use for lookup.- Returns:
- a new IParametersEditor object for the given class name, or null if no editor is available or if the object could not be created.
-
getDescriptionProvider
public IEditorDescriptionProvider getDescriptionProvider(String parametersClassName)
Description copied from interface:IParametersEditorMapperGets an object that can provide the UI description to use with a generic editor.- Specified by:
getDescriptionProviderin interfaceIParametersEditorMapper- Parameters:
parametersClassName- the name of the class for which to get the description provider.- Returns:
- an editor description provider or null if none is set for this class.
-
-