Class EditorEnum<T extends Enum<T>>

  • Type Parameters:
    T - The type this editor selects.
    All Implemented Interfaces:
    ConfigEditor<T>

    public class EditorEnum<T extends Enum<T>>
    extends EditorDefault<T>
    Author:
    Hylke van der Schaaf
    • Field Detail

      • profilesEdit

        public Set<String> profilesEdit
    • Constructor Detail

      • EditorEnum

        public EditorEnum()
      • EditorEnum

        public EditorEnum​(Class<T> sourceType,
                          T deflt,
                          String label,
                          String description)
    • Method Detail

      • initFor

        public void initFor​(Field field)
        Description copied from interface: ConfigEditor
        Initialise the editor for the given Field, using the Field name and type and any annotations present on the Field.
        Specified by:
        initFor in interface ConfigEditor<T extends Enum<T>>
        Overrides:
        initFor in class EditorDefault<T extends Enum<T>>
        Parameters:
        field - the Field to initialise the editor for.
      • setConfig

        public void setConfig​(com.google.gson.JsonElement config)
        Description copied from interface: ConfigEditor
        Load the given configuration into this editor.
        Parameters:
        config - the configuration to load into this editor.
      • getConfig

        public com.google.gson.JsonElement getConfig()
        Description copied from interface: ConfigEditor
        Get the current (edited) state of the configuration.
        Returns:
        The current (edited) configuration.
      • getJsonSchema

        public SchemaItem getJsonSchema​(RootSchema rootSchema)
        Description copied from interface: ConfigEditor
        Get the JSON Schema for this editor, using the given rootSchema for shared $defs.
        Parameters:
        rootSchema - the root schema to use for $defs. If null, the return value must be a root schema.
        Returns:
        the schema for this editor.
      • getGuiFactorySwing

        public GuiFactorySwing getGuiFactorySwing()
        Description copied from interface: ConfigEditor
        Get a factory that can generate a swing-based gui for this editor.
        Returns:
        A factory that can generate a swing-based gui for this editor.
      • getGuiFactoryFx

        public GuiFactoryFx getGuiFactoryFx()
        Description copied from interface: ConfigEditor
        Get a factory that can generate a JavaFX-based gui for this editor.
        Returns:
        A factory that can generate a JavaFX-based gui for this editor.
      • getSourceType

        public Class<T> getSourceType()
      • getRawValue

        public T getRawValue()
      • setRawValue

        public void setRawValue​(T value)
      • getValue

        public T getValue()
        Description copied from interface: ConfigEditor
        Get the value configured in the editor.
        Returns:
        the value configured in the editor.
      • setValue

        public void setValue​(T value)
        Description copied from interface: ConfigEditor
        Set the value in the editor. Used for saving an (externally) updated configuration.
        Parameters:
        value - the value in the editor.
      • setProfile

        public void setProfile​(String profile)
        Description copied from interface: ConfigEditor
        Sets the currently active profile.
        Parameters:
        profile - the currently active profile.
      • setProfilesEdit

        public void setProfilesEdit​(String csv)
      • canEdit

        public boolean canEdit()
        Description copied from interface: ConfigEditor
        True if the component is editable in the current profile.
        Returns:
        True if the component is editable in the current profile.
      • isDefault

        public boolean isDefault()