Class PropertiesParameterPanel

    • Constructor Detail

      • PropertiesParameterPanel

        public PropertiesParameterPanel()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • initGUI

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

        protected void finishInit()
        finishes the initialization.
        Overrides:
        finishInit in class BasePanel
      • setDefaultSQLDimension

        public void setDefaultSQLDimension​(Dimension value)
        Sets the default dimension to use for SQL query fields.
        Parameters:
        value - the preferred size
      • getDefaultSQLDimension

        public Dimension getDefaultSQLDimension()
        Returns the dimension to use for SQL query fields.
        Returns:
        the preferred size
      • clearPropertyTypes

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

        protected void clearProperties()
        Removes all properties.
      • addProperty

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

        public void addProperty​(String identifier,
                                String label,
                                AbstractChooserPanel chooser)
        Adds the chooser panel at the end.
        Parameters:
        identifier - the unique identifier of the property
        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
      • getProperty

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

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

        public int getPropertyCount()
        Returns the number of properties currently displayed.
        Returns:
        the number of properties
      • addPropertyType

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

        public boolean hasPropertyType​(String property)
        Checks whether a property 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 property 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 property 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
      • 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
      • addPropertyHint

        public void addPropertyHint​(String property,
                                    PropertiesParameterPanel.PropertyHint hint)
        Associates the property hint with the specified property.
        Parameters:
        property - the property to associate a hint with
        hint - the property hint
      • hasPropertyHints

        public boolean hasPropertyHints​(String property)
        Checks whether any property hints have been specified for a particular property.
        Parameters:
        property - the property to check
        Returns:
        true if at least one hint has been specified
      • getPropertyHints

        public Set<PropertiesParameterPanel.PropertyHint> getPropertyHints​(String property)
        Returns the hints associated with a property.
        Parameters:
        property - the property to get the hints for
        Returns:
        the hints
      • 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
      • hasComponent

        public boolean hasComponent​(String property)
        Checks whether a custom component has been specified for a particular property.
        Parameters:
        property - the property check
        Returns:
        true if a custom component has been specified
      • setComponent

        public void setComponent​(String property,
                                 Component value)
        Associates the custom component with a particular property.\ Must have setText(String) and getText() methods!
        Parameters:
        property - the property to associate the chooser with
        value - the custom component to use
      • getComponent

        public Component getComponent​(String property)
        Returns the custom component associated with a particular property.
        Parameters:
        property - the property to get the chooser for
        Returns:
        the custom component, 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.\
        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
      • hasListDefault

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

        public void setListDefault​(String property,
                                   String value)
        Associates the list default item with a particular property.
        Parameters:
        property - the property to associate the list with
        value - the default to use
      • getListDefault

        public String getListDefault​(String property)
        Returns the default list item associated with a particular property.
        Parameters:
        property - the property to get the default for
        Returns:
        the default, 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
      • hasLabel

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

        public void setLabel​(String property,
                             String value)
        Associates the label with a particular property.
        Parameters:
        property - the property to associate the label with
        value - the label to use
      • getLabel

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

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

        public void setRegExp​(String property,
                              BaseRegExp value)
        Associates the regexp with a particular property.
        Parameters:
        property - the property to associate the label with
        value - the regexp to use
      • getRegExp

        public BaseRegExp getRegExp​(String property)
        Returns the regexp associated with a particular property.
        Parameters:
        property - the property to get the label for
        Returns:
        the regexp, null if none available
      • updateToolTipText

        protected void updateToolTipText​(Component comp,
                                         String help)
        Updates the tool tip.
        Parameters:
        comp - the component to update
        help - the tip text to use, ignored if null
      • setText

        protected void setText​(Component comp,
                               String text)
        Updates the text of the component.
        Parameters:
        comp - the component to update
        text - the text to set
      • getText

        protected String getText​(Component comp)
        Returns the text from the component.
        Parameters:
        comp - the component to get the text from
        Returns:
        the obtained text
      • setProperties

        public void setProperties​(Properties value)
        Sets the properties to base the properties on.
        Parameters:
        value - the properties to use
      • getProperties

        public Properties getProperties()
        Returns the currently display properties as a properties object.
        Returns:
        the properties
      • getFileChooser

        protected BaseFileChooser getFileChooser()
        Returns the file chooser to use for loading/saving of props files.
        Returns:
        the file chooser
      • loadProperties

        protected void loadProperties()
        Loads properties from a file, prompts the user to select props file.
      • saveProperties

        protected void saveProperties()
        Saves properties to a file, prompts the user to select props file.
      • setButtonPanelVisible

        public void setButtonPanelVisible​(boolean value)
        Sets the visibility state of the buttons panel (load/save).
        Parameters:
        value - true if to show buttons
      • isButtonPanelVisible

        public boolean isButtonPanelVisible()
        Returns the visibility state of the buttons panel (load/save).
        Returns:
        true if buttons displayed
      • addChangeListener

        public void addChangeListener​(ChangeListener l)
        Adds the change listener.
        Parameters:
        l - the change listener
      • removeChangeListener

        public void removeChangeListener​(ChangeListener l)
        Removes the change listener.
        Parameters:
        l - the change listener