Class AbstractKeyEditor

    • Field Detail

      • VALID_INPUT_PROPERTY

        public static final String VALID_INPUT_PROPERTY
        A constant for the "validInput" property name.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractKeyEditor

        protected AbstractKeyEditor​(org.pentaho.reporting.libraries.base.config.HierarchicalConfiguration config,
                                    ConfigDescriptionEntry entry)
        Creates a new key editor for the given report configuration and key entry.
        Parameters:
        config - the report configuration that supplies the value for the editor
        entry - the entry description provides the meta data for the edited key.
    • Method Detail

      • getEmptyIcon

        protected Icon getEmptyIcon()
        Returns the empty icon for this an all derived editors.
        Returns:
        the empty icon.
      • getErrorIcon

        protected Icon getErrorIcon()
        Returns the error icon for this an all derived editors.
        Returns:
        the error icon.
      • setContentPane

        protected void setContentPane​(JPanel contentPane)
        Defines the content pane for this editor.
        Parameters:
        contentPane - the new content pane
      • getConfig

        public org.pentaho.reporting.libraries.base.config.Configuration getConfig()
        Returns the report configuration instance used for this editor.
        Returns:
        the report configuration instance of this editor.
      • getEntry

        public ConfigDescriptionEntry getEntry()
        Returns the config description entry of this editor.
        Returns:
        the config description entry.
      • loadValue

        protected String loadValue()
        Loads the value from the configuration.
        Returns:
        the value of the edited key from the configuration.
      • storeValue

        protected void storeValue​(String o)
        Stores the value to the configuration.
        Parameters:
        o - the new value for the key of the editor.
      • deleteValue

        protected void deleteValue()
        Removes the value from the configuration; the configuration will fall back to the default value from the global configuration.

        Deleting the value triggers the isDefined property.

      • isValidInput

        public boolean isValidInput()
        Returns true, if the component validated the entered values, false otherwise.
        Returns:
        true, if the input is valid, false otherwise.
      • setValidInput

        protected void setValidInput​(boolean validInput)
        Defines, whether the input is valid. This should be called after the value of the component changed.
        Parameters:
        validInput - true, if the input should be considered valid, false otherwise.
      • isDefined

        public boolean isDefined()
        Checks whether the local key has a defined value in the local report configuration.
        Specified by:
        isDefined in interface KeyEditor
        Returns:
        true, if the key is defined, false otherwise.
      • getComponent

        public JComponent getComponent()
        Returns the editor component; this implementation returns the "this" reference.
        Specified by:
        getComponent in interface KeyEditor
        Returns:
        a reference to this object.