Class AbstractPropertiesPreferencesPanel

    • Constructor Detail

      • AbstractPropertiesPreferencesPanel

        public AbstractPropertiesPreferencesPanel()
    • Method Detail

      • initGUI

        protected void initGUI()
        For initializing the GUI.
        Overrides:
        initGUI in class BasePanel
      • clearPropertyTypes

        public void clearPropertyTypes()
        Removes all property/preference type relations.
      • addPreference

        public void addPreference​(String identifier,
                                  String label,
                                  Component comp)
        Adds a preference.
        Parameters:
        identifier - the unique identifier of the preference
        label - the label to add, the mnemonic to use is preceded by "_"
        comp - the component to add
        Throws:
        IllegalArgumentException - if the identifier already exists
      • addPreference

        public void addPreference​(String identifier,
                                  String label,
                                  AbstractChooserPanel chooser)
        Adds the chooser panel at the end.
        Parameters:
        identifier - the unique identifier of the preference
        label - the label to add, the mnemonic to use is preceded by "_"
        chooser - the chooser panel to add
        Throws:
        IllegalArgumentException - if the identifier already exists
      • getPreference

        public Component getPreference​(int index)
        Returns the component at the specified location.
        Parameters:
        index - the index of the specified location
        Returns:
        the component at the position
      • getPreference

        public Component getPreference​(String identifier)
        Returns the component associated with the identifier.
        Parameters:
        identifier - the identifier of the preference to return
        Returns:
        the associated component, null if none found
      • getPreferenceCount

        public int getPreferenceCount()
        Returns the number of preferences currently displayed.
        Returns:
        the number of preferences
      • addPropertyType

        public void addPropertyType​(String property,
                                    PropertiesParameterPanel.PropertyType type)
        Associates the preference type with the specified property.
        Parameters:
        property - the property to associate a type with
        type - the preference type
      • hasPropertyType

        public boolean hasPropertyType​(String property)
        Checks whether a preference type has been specified for a particular property.
        Parameters:
        property - the property to associate a type with
        Returns:
        true if a type has been specified
      • getPropertyType

        public PropertiesParameterPanel.PropertyType getPropertyType​(String property)
        Checks whether a preference type has been specified for a particular property.
        Parameters:
        property - the property to associate a type with
        Returns:
        true if a type has been specified
      • getActualPropertyType

        public PropertiesParameterPanel.PropertyType getActualPropertyType​(String property)
        Checks whether a preference type has been specified for a particular property.
        Parameters:
        property - the property to associate a type with
        Returns:
        true if a type has been specified
      • hasChooser

        public boolean hasChooser​(String property)
        Checks whether a chooser has been specified for a particular property.
        Parameters:
        property - the property check
        Returns:
        true if a chooser has been specified
      • setChooser

        public void setChooser​(String property,
                               AbstractChooserPanel value)
        Associates the chooser with a particular property.
        Parameters:
        property - the property to associate the chooser with
        value - the chooser to use
      • getChooser

        public AbstractChooserPanel getChooser​(String property)
        Returns the chooser associated with a particular property.
        Parameters:
        property - the property to get the chooser for
        Returns:
        the chooser, null if none available
      • hasArrayClass

        public boolean hasArrayClass​(String property)
        Checks whether a custom array class has been specified for a particular property.
        Parameters:
        property - the property check
        Returns:
        true if a custom array class has been specified
      • setArrayClass

        public void setArrayClass​(String property,
                                  Class value)
        Associates the custom array class with a particular property.\ Must have setText(String) and getText() methods!
        Parameters:
        property - the property to associate the chooser with
        value - the custom array class to use
      • getArrayClass

        public Class getArrayClass​(String property)
        Returns the custom array class associated with a particular property.
        Parameters:
        property - the property to get the chooser for
        Returns:
        the custom array class, null if none available
      • hasArraySeparator

        public boolean hasArraySeparator​(String property)
        Checks whether a custom array separator has been specified for a particular property. If no separator specified, comma is used.
        Parameters:
        property - the property check
        Returns:
        true if a custom array separator has been specified
      • setArraySeparator

        public void setArraySeparator​(String property,
                                      String value)
        Associates the custom array separator with a particular property. If no separator specified, comma is used.
        Parameters:
        property - the property to associate the chooser with
        value - the custom array separator to use
      • getArraySeparator

        public String getArraySeparator​(String property)
        Returns the custom array separator associated with a particular property. If no separator specified, comma is used.
        Parameters:
        property - the property to get the chooser for
        Returns:
        the custom array separator, null if none available
      • hasEnum

        public boolean hasEnum​(String property)
        Checks whether a enum has been specified for a particular property.
        Parameters:
        property - the property to check
        Returns:
        true if a enum has been specified
      • setEnum

        public void setEnum​(String property,
                            Class value)
        Associates the enum with a particular property.
        Parameters:
        property - the property to associate the enum with
        value - the enum to use
      • getEnum

        public Class getEnum​(String property)
        Returns the enum associated with a particular property.
        Parameters:
        property - the property to get the enum for
        Returns:
        the enum, null if none available
      • hasList

        public boolean hasList​(String property)
        Checks whether a list has been specified for a particular property.
        Parameters:
        property - the property check
        Returns:
        true if a list has been specified
      • setList

        public void setList​(String property,
                            String[] value)
        Associates the list with a particular property.
        Parameters:
        property - the property to associate the list with
        value - the list to use
      • getList

        public String[] getList​(String property)
        Returns the list associated with a particular property.
        Parameters:
        property - the property to get the list for
        Returns:
        the list, null if none available
      • hasHelp

        public boolean hasHelp​(String property)
        Checks whether a help has been specified for a particular property.
        Parameters:
        property - the property check
        Returns:
        true if a help has been specified
      • setHelp

        public void setHelp​(String property,
                            String value)
        Associates the help with a particular property.
        Parameters:
        property - the property to associate the help with
        value - the help to use
      • getHelp

        public String getHelp​(String property)
        Returns the help associated with a particular property.
        Parameters:
        property - the property to get the help for
        Returns:
        the help, null if none available
      • setPropertyOrder

        public void setPropertyOrder​(String[] value)
        Sets the order for the properties.
        Parameters:
        value - the ordered property names
      • setPropertyOrder

        public void setPropertyOrder​(List<String> value)
        Sets the order for the properties.
        Parameters:
        value - the ordered property names
      • getPropertyOrder

        public List<String> getPropertyOrder()
        Returns the order for the properties.
        Returns:
        the ordered property names
      • setPreferences

        public void setPreferences​(Properties value)
        Sets the properties to base the preferences on.
        Parameters:
        value - the properties to use
      • getPreferences

        public Properties getPreferences()
        Returns the currently display preferences as a properties object.
        Returns:
        the preferences