Class ParameterImpl

    • Field Detail

      • configKey

        protected final java.lang.String configKey
      • labelKey

        private java.lang.String labelKey
      • label

        private java.lang.String label
      • mode

        private int mode
      • enabled

        private java.lang.Boolean enabled
      • visible

        private boolean visible
      • generate_intermediate_events

        private boolean generate_intermediate_events
      • toDisable

        private java.util.List<Parameter> toDisable
      • toEnable

        private java.util.List<Parameter> toEnable
      • change_listeners

        private java.util.List change_listeners
      • indent

        private int indent
      • fancyIndent

        private boolean fancyIndent
      • refID

        private java.lang.String refID
      • allowedUiTypes

        private java.lang.String[] allowedUiTypes
    • Constructor Detail

      • ParameterImpl

        public ParameterImpl​(java.lang.String coreConfigKey,
                             java.lang.String _labelKey)
    • Method Detail

      • getKey

        @Deprecated
        public java.lang.String getKey()
        Deprecated.
        (forRemoval=true) Use getConfigKeyName()
      • addDisabledOnSelection

        public void addDisabledOnSelection​(Parameter... parameters)
        Description copied from interface: EnablerParameter
        disables parameter when EnablerParameter is selected.
        Specified by:
        addDisabledOnSelection in interface EnablerParameter
        Parameters:
        parameters - the Parameter to act on
      • addEnabledOnSelection

        public void addEnabledOnSelection​(Parameter paramToEnable)
        Description copied from interface: EnablerParameter
        enables paramToEnable when this EnablerParameter is selected (checked).
        paramToEnable is disabled when this EnablerParameter isn't selected (checked).

        Note: When this EnableParameter is disabled, paramToEnable's state will not be modified. In cases where parameter1 is enabled by its parent, and parameter1 enabled children, you must also parent.addEnabledOnSelection(children) if you want the children to be disabled when parent is unselected (unchecked).

        Specified by:
        addEnabledOnSelection in interface EnablerParameter
        Parameters:
        paramToEnable - the Parameter to act on
      • addEnabledOnSelection

        public void addEnabledOnSelection​(Parameter... parameters)
        Description copied from interface: EnablerParameter
        enables paramToEnable when this EnablerParameter is selected (checked).
        paramToEnable is disabled when this EnablerParameter isn't selected (checked).

        Note: When this EnableParameter is disabled, parametersToDisable's state will not be modified. In cases where parameter1 is enabled by its parent, and parameter1 enabled children, you must also parent.addEnabledOnSelection(children) if you want the children to be disabled when parent is unselected (unchecked).

        Specified by:
        addEnabledOnSelection in interface EnablerParameter
        Parameters:
        parameters - the Parameter to act on
      • getDisabledOnSelectionParameters

        public java.util.List<Parameter> getDisabledOnSelectionParameters()
      • getEnabledOnSelectionParameters

        public java.util.List<Parameter> getEnabledOnSelectionParameters()
      • parameterChanged

        public void parameterChanged​(java.lang.String key)
        Description copied from interface: ParameterListener
        Called, when a parameter has changed. The listener could only react if the parameter name is relevant. Or the listener can just read all parameters again.
        Specified by:
        parameterChanged in interface ParameterListener
        Parameters:
        key - the name of the parameter that has changed
      • fireParameterChanged

        public void fireParameterChanged()
      • setEnabled

        public void setEnabled​(boolean e)
        Description copied from interface: Parameter
        Sets whether the UI object for this parameter is enabled (changeable) or disabled (not changeable, and usually grayed out)
        Specified by:
        setEnabled in interface Parameter
        Parameters:
        e - The new enabled state
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: Parameter
        Retrieves the enabled state for the UI object for this parameter
        Specified by:
        isEnabled in interface Parameter
        Returns:
        The enabled state
      • getMinimumRequiredUserMode

        public int getMinimumRequiredUserMode()
        Description copied from interface: Parameter
        Gets the lowest user mode required for this parameter to be displayed.
        Specified by:
        getMinimumRequiredUserMode in interface Parameter
        Returns:
        MODE_ constants above
      • setMinimumRequiredUserMode

        public void setMinimumRequiredUserMode​(int _mode)
        Description copied from interface: Parameter
        Sets the lowest user mode required for this parameter to be displayed.
        Specified by:
        setMinimumRequiredUserMode in interface Parameter
        Parameters:
        _mode - see MODE_ constants defined above
      • setVisible

        public void setVisible​(boolean _visible)
        Description copied from interface: Parameter
        Sets whether the UI object for this parameter is visible to the user
        Specified by:
        setVisible in interface Parameter
        Parameters:
        _visible - The new visibility state
      • isVisible

        public boolean isVisible()
        Description copied from interface: Parameter
        Retrieves the visiblility state for the UI object for this parameter
        Specified by:
        isVisible in interface Parameter
        Returns:
        The visibility state
      • setGenerateIntermediateEvents

        public void setGenerateIntermediateEvents​(boolean b)
        Description copied from interface: Parameter
        Controls whether or not 'parameter change' events are fired for each incremental value change
        Specified by:
        setGenerateIntermediateEvents in interface Parameter
      • addListener

        public void addListener​(ParameterListener l)
        Description copied from interface: Parameter
        Adds a listener triggered when the parameter is changed by the user
        Specified by:
        addListener in interface Parameter
        Parameters:
        l - Listener to add
      • addValidator

        public void addValidator​(ParameterValidator validator)
        Description copied from interface: Parameter
        Adds a validator to this parameter. The Validator will be called when the user tries to change the value.

        For parameters that have a text field, the validator will be called on each edit of the field. This allows you to notify the user of a potential error while they type.

        Subclasses may have helper functions that cast the "toValue" for you.

        Specified by:
        addValidator in interface Parameter
      • getLabelText

        public java.lang.String getLabelText()
        Description copied from interface: Parameter
        Retrieve the actual text of the label associated with this parameter. This is the text after it has been looked up in the language bundle.
        Specified by:
        getLabelText in interface Parameter
        Returns:
        The label's text
      • setLabelText

        public void setLabelText​(java.lang.String sText)
        Description copied from interface: Parameter
        Set the text of the label associated to with this parameter to the literal text supplied.
        Specified by:
        setLabelText in interface Parameter
        Parameters:
        sText - The actual text to assign to the label
      • getLabelKey

        public java.lang.String getLabelKey()
        Description copied from interface: Parameter
        Retrieve the language bundle key for the label associated with this parameter.
        Specified by:
        getLabelKey in interface Parameter
        Returns:
        The language bundle key, or null if the label is using literal text
      • setLabelKey

        public void setLabelKey​(java.lang.String sLabelKey)
        Description copied from interface: Parameter
        Set the label to use the supplied language bundle key for the label associated with this parameter
        Specified by:
        setLabelKey in interface Parameter
        Parameters:
        sLabelKey - The language bundle key to use.
      • getConfigKeyName

        public final java.lang.String getConfigKeyName()
        Specified by:
        getConfigKeyName in interface Parameter
      • triggerLabelChanged

        private void triggerLabelChanged​(java.lang.String text,
                                         boolean isKey)
      • refreshControl

        public void refreshControl()
      • destroy

        public void destroy()
      • setIndent

        public void setIndent​(int indent,
                              boolean fancy)
        Specified by:
        setIndent in interface Parameter
      • getIndent

        public int getIndent()
      • isIndentFancy

        public boolean isIndentFancy()
      • setReferenceID

        public void setReferenceID​(java.lang.String refID)
      • getReferenceID

        public java.lang.String getReferenceID()
      • setAllowedUiTypes

        public void setAllowedUiTypes​(java.lang.String... uiTypes)
        Specified by:
        setAllowedUiTypes in interface Parameter
      • isForUIType

        public boolean isForUIType​(java.lang.String uiType)
        Specified by:
        isForUIType in interface Parameter
      • resetToDefault

        public boolean resetToDefault()
        Description copied from interface: Parameter
        Resets the parameter to its default value
        Specified by:
        resetToDefault in interface Parameter
        Returns:
        true - value was reset; false - already reset
      • getValueObject

        public java.lang.Object getValueObject()
        Description copied from interface: Parameter
        Retrieve the parameter's value as an Object. Subclasses will usually have a getValue() that will return a specific type.
        Specified by:
        getValueObject in interface Parameter
      • search

        public boolean search​(java.util.regex.Pattern regex)