Interface IConfigValueEditorMetadataFactory


@NonExtendable public interface IConfigValueEditorMetadataFactory
Creates editor metadata for values with a text serializer. Obtain this factory from IConfigGuiRegistration.getEditorMetadataFactory().
Since:
0.6.0
  • Method Summary

    Modifier and Type
    Method
    Description
    create(net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> serializer, ConfigValueEditorType<T> editorType)
    Create metadata for a chosen editor with standard localized text.
    create(net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> serializer, T value)
    Create metadata for a standard editor appropriate for the value and its storage constraints.
    createRange(net.mezzdev.config.api.value.serializer.IConfigValueSerializer<net.mezzdev.config.api.value.serializer.ConfigValueRange<T>> serializer, net.mezzdev.config.api.value.serializer.ConfigValueRange<T> bounds)
    Create metadata for editing a numeric interval with two slider handles.
  • Method Details

    • create

      <T> IConfigValueEditorMetadata<T> create(net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> serializer, T value)
      Create metadata for a standard editor appropriate for the value and its storage constraints.
      Parameters:
      serializer - the value's serialization and validation rules
      value - a representative value for choosing the editor
      Returns:
      editor metadata with storage validation, available choices, and standard localized text
      Since:
      0.6.0
    • create

      <T> IConfigValueEditorMetadata<T> create(net.mezzdev.config.api.value.serializer.IConfigValueSerializer<T> serializer, ConfigValueEditorType<T> editorType)
      Create metadata for a chosen editor with standard localized text.
      Parameters:
      serializer - the value's serialization and validation rules
      editorType - the editor to use
      Throws:
      IllegalArgumentException - if a list editor has no element serializer, or a range editor is requested without bounds; use createRange(IConfigValueSerializer, ConfigValueRange) for ranges
      Since:
      0.6.0
    • createRange

      <T> IConfigRangeValueEditorMetadata<T> createRange(net.mezzdev.config.api.value.serializer.IConfigValueSerializer<net.mezzdev.config.api.value.serializer.ConfigValueRange<T>> serializer, net.mezzdev.config.api.value.serializer.ConfigValueRange<T> bounds)
      Create metadata for editing a numeric interval with two slider handles.
      Parameters:
      serializer - the interval's serialization and validation rules
      bounds - the inclusive bounds for both endpoints
      Since:
      0.6.0