Interface PropertyEditor<T>

    • Method Detail

      • setValue

        void setValue​(java.lang.Object value)
        Set (or change) the object that is to be edited. Primitive types such as "int" must be wrapped as the corresponding object type such as "java.lang.Integer".
        Parameters:
        value - The new target object to be edited. Note that this object should not be modified by the PropertyEditor, rather the PropertyEditor should create a new object to hold any modified value.
      • getValue

        T getValue()
        Gets the property value.
        Returns:
        The value of the property. Primitive types such as "int" will be wrapped as the corresponding object type such as "java.lang.Integer".
      • getAsText

        java.lang.String getAsText()
        Gets the property value as text.
        Returns:
        The property value as a human editable string.

        Returns null if the value can't be expressed as an editable string.

        If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().

      • setAsText

        void setAsText​(java.lang.String text)
                throws java.lang.IllegalArgumentException
        Set the property value by parsing a given String. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text.
        Parameters:
        text - The string to be parsed.
        Throws:
        java.lang.IllegalArgumentException
      • addPropertyChangeListener

        void addPropertyChangeListener​(PropertyChangeListener<T> listener)
        Adds a listener for the value change. When the property editor changes its value it should fire a PropertyChangeEvent on all registered PropertyChangeListeners, specifying the null value for the property name and itself as the source.
        Parameters:
        listener - the PropertyChangeListener to add