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 java.lang.Object
      implements IParametersEditorMapper

  Common set of methods to manage parameters editors.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.LinkedHashMap<java.lang.String,ClassInfo>` | `descMap` Map of the editor descriptions for this mapper.
    `protected java.util.LinkedHashMap<java.lang.String,ClassInfo>` | `editorMap` Map of the editors for this mapper.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParametersEditorMapper()` Creates an empty ParametersEditorMapper object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDescriptionProvider(ClassInfo descriptionProviderClass, java.lang.String parametersClassName)` Adds a new editor description provider mapping to this mapper.
    `void` | `addDescriptionProvider(java.lang.String descriptionProviderClassName, java.lang.String parametersClassName)` Adds a new editor description provider mapping to this mapper.
    `void` | `addEditor(ClassInfo editorClass, java.lang.String parametersClassName)` Adds a new parameters editor mapping to this mapper.
    `void` | `addEditor(java.lang.String editorClassName, java.lang.String parametersClassName)` Adds a new parameters editor mapping to this mapper.
    `void` | `clearDescriptionProviders()` Removes all editor mappings for this mapper.
    `void` | `clearEditors()` Removes all editor mappings for this mapper.
    `IParametersEditor` | `createParametersEditor(java.lang.String parametersClassName)` Creates an instance of the parameters editor for a given parameters class name.
    `IEditorDescriptionProvider` | `getDescriptionProvider(java.lang.String parametersClassName)` Gets an object that can provide the UI description to use with a generic editor.
    `void` | `removeDescriptionProvider(java.lang.String className)` Removes a given editor description provider from this mapper.
    `void` | `removeEditor(java.lang.String className)` Removes a given editor from this mapper.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### editorMap

          protected java.util.LinkedHashMap<java.lang.String,ClassInfo> editorMap

      Map of the editors for this mapper.

    - #### descMap

          protected java.util.LinkedHashMap<java.lang.String,ClassInfo> descMap

      Map of the editor descriptions for this mapper.

  - ### Constructor Detail

    - #### ParametersEditorMapper

          public ParametersEditorMapper()

      Creates an empty ParametersEditorMapper object.

  - ### Method Detail

    - #### addEditor

          public void addEditor(ClassInfo editorClass,
                                java.lang.String parametersClassName)

      Description copied from interface: `IParametersEditorMapper`
      Adds a new parameters editor mapping to this mapper.
      Specified by:
        `addEditor` in interface `IParametersEditorMapper`
      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(java.lang.String editorClassName,
                                java.lang.String parametersClassName)

      Description copied from interface: `IParametersEditorMapper`
      Adds a new parameters editor mapping to this mapper. This is the same as calling `addEditor(new ClassInfo(editorClassName))`.
      Specified by:
        `addEditor` in interface `IParametersEditorMapper`
      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,
                                             java.lang.String parametersClassName)

      Description copied from interface: `IParametersEditorMapper`
      Adds a new editor description provider mapping to this mapper.
      Specified by:
        `addDescriptionProvider` in interface `IParametersEditorMapper`
      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(java.lang.String descriptionProviderClassName,
                                             java.lang.String parametersClassName)

      Description copied from interface: `IParametersEditorMapper`
      Adds a new editor description provider mapping to this mapper. This is the same as calling `addDescriptionProvider(new ClassInfo(descriptionProviderClassName))`.
      Specified by:
        `addDescriptionProvider` in interface `IParametersEditorMapper`
      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: `IParametersEditorMapper`
      Removes all editor mappings for this mapper.
      Specified by:
        `clearEditors` in interface `IParametersEditorMapper`

    - #### clearDescriptionProviders

          public void clearDescriptionProviders()

      Description copied from interface: `IParametersEditorMapper`
      Removes all editor mappings for this mapper.
      Specified by:
        `clearDescriptionProviders` in interface `IParametersEditorMapper`

    - #### removeEditor

          public void removeEditor(java.lang.String className)

      Description copied from interface: `IParametersEditorMapper`
      Removes a given editor from this mapper.
      Specified by:
        `removeEditor` in interface `IParametersEditorMapper`
      Parameters:
        `className` - the class name of the editor to remove.

    - #### removeDescriptionProvider

          public void removeDescriptionProvider(java.lang.String className)

      Description copied from interface: `IParametersEditorMapper`
      Removes a given editor description provider from this mapper.
      Specified by:
        `removeDescriptionProvider` in interface `IParametersEditorMapper`
      Parameters:
        `className` - the class name of the editor description provider to remove.

    - #### createParametersEditor

          public IParametersEditor createParametersEditor(java.lang.String parametersClassName)

      Description copied from interface: `IParametersEditorMapper`
      Creates an instance of the parameters editor for a given parameters class name.
      Specified by:
        `createParametersEditor` in interface `IParametersEditorMapper`
      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(java.lang.String parametersClassName)

      Description copied from interface: `IParametersEditorMapper`
      Gets an object that can provide the UI description to use with a generic editor.
      Specified by:
        `getDescriptionProvider` in interface `IParametersEditorMapper`
      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.