Interface ConfigEditor<T>

    • Method Detail

      • setConfig

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

        com.google.gson.JsonElement getConfig()
        Get the current (edited) state of the configuration.
        Returns:
        The current (edited) configuration.
      • getValue

        T getValue()
            throws ConfigurationException
        Get the value configured in the editor.
        Returns:
        the value configured in the editor.
        Throws:
        ConfigurationException - when the configuration can not be used to create a value.
      • setValue

        void setValue​(T value)
        Set the value in the editor. Used for saving an (externally) updated configuration.
        Parameters:
        value - the value in the editor.
      • getJsonRootSchema

        default RootSchema getJsonRootSchema()
        Get the Schema for this editor, in the form of a root schema.
        Returns:
        The schema for this editor, as a root schema.
      • getJsonSchema

        SchemaItem getJsonSchema​(RootSchema rootSchema)
        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

        GuiFactorySwing getGuiFactorySwing()
        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

        GuiFactoryFx getGuiFactoryFx()
        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.
      • getLabel

        String getLabel()
        Get the human-readable label to use for this editor. Can return an empty string.
        Returns:
        The label to use for this editor.
      • setLabel

        void setLabel​(String label)
        The human readable label for this editor.
        Parameters:
        label - the label to set
      • getDescription

        String getDescription()
        Get the description for this editor. Can return an empty string.
        Returns:
        The description to use for this editor.
      • setDescription

        void setDescription​(String description)
        The longer description for this editor.
        Parameters:
        description - the description to set
      • initFor

        void initFor​(Field field)
        Initialise the editor for the given Field, using the Field name and type and any annotations present on the Field.
        Parameters:
        field - the Field to initialise the editor for.
      • initFor

        default void initFor​(Field field,
                             String key)
        Initialise the editor for the given Field, using the Field name and type and the annotation on the Field, identified by the given key.
        Parameters:
        field - the Field to initialise the editor for.
        key - the key to use to identify the annotation to load the configuration from.
      • setProfile

        default void setProfile​(String profile)
        Sets the currently active profile.
        Parameters:
        profile - the currently active profile.
      • canEdit

        default boolean canEdit()
        True if the component is editable in the current profile.
        Returns:
        True if the component is editable in the current profile.
      • isDefault

        default boolean isDefault()