Class EditorList<U,​T extends ConfigEditor<U>>

  • Type Parameters:
    T - The type of editors that edit the items in the list.
    U - The type of items in the list.
    All Implemented Interfaces:
    ConfigEditor<List<U>>, Iterable<T>

    public class EditorList<U,​T extends ConfigEditor<U>>
    extends EditorDefault<List<U>>
    implements Iterable<T>
    An editor for a list of editors, all of the same type.
    Author:
    Hylke van der Schaaf
    • Field Detail

      • profilesEdit

        public Set<String> profilesEdit
    • Method Detail

      • setContexts

        public final void setContexts​(Object context,
                                      Object edtCtx)
        The contexts to pass on to item editors. Only needed when using annotations, since then the factory is not externally supplied.
        Parameters:
        context - the context.
        edtCtx - the edit context.
      • 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<U>
        Overrides:
        initFor in class EditorDefault<List<U>>
        Parameters:
        field - the Field to initialise the editor for.
      • initFor

        public void initFor​(Field field,
                            String key)
        Description copied from interface: ConfigEditor
        Initialise the editor for the given Field, using the Field name and type and the annotation on the Field, identified by the given key.
        Specified by:
        initFor in interface ConfigEditor<U>
        Parameters:
        field - the Field to initialise the editor for.
        key - the key to use to identify the annotation to load the configuration from.
      • setConfig

        public void setConfig​(com.google.gson.JsonElement config)
        Description copied from interface: ConfigEditor
        Load the given configuration into this editor.
        Specified by:
        setConfig in interface ConfigEditor<U>
        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.
        Specified by:
        getConfig in interface ConfigEditor<U>
        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.
        Specified by:
        getJsonSchema in interface ConfigEditor<U>
        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.
        Specified by:
        getGuiFactorySwing in interface ConfigEditor<U>
        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.
        Specified by:
        getGuiFactoryFx in interface ConfigEditor<U>
        Returns:
        A factory that can generate a JavaFX-based gui for this editor.
      • addItem

        public void addItem()
      • removeItem

        public void removeItem​(T item)
      • getRawValue

        public List<T> getRawValue()
      • setValue

        public void setValue​(List<U> value)
        Description copied from interface: ConfigEditor
        Set the value in the editor. Used for saving an (externally) updated configuration.
        Specified by:
        setValue in interface ConfigEditor<U>
        Parameters:
        value - the value in the editor.
      • getMinCount

        public int getMinCount()
      • setMinCount

        public void setMinCount​(int minCount)
      • getMaxCount

        public int getMaxCount()
      • setMaxCount

        public void setMaxCount​(int maxCount)
      • setProfilesEdit

        public void setProfilesEdit​(String csv)
      • setProfile

        public void setProfile​(String profile)
        Description copied from interface: ConfigEditor
        Sets the currently active profile.
        Specified by:
        setProfile in interface ConfigEditor<U>
        Parameters:
        profile - the currently active profile.
      • canEdit

        public boolean canEdit()
        Description copied from interface: ConfigEditor
        True if the component is editable in the current profile.
        Specified by:
        canEdit in interface ConfigEditor<U>
        Returns:
        True if the component is editable in the current profile.