Class AbstractDialogFrame<V>

    • Constructor Detail

      • AbstractDialogFrame

        public AbstractDialogFrame​(ValueModel<V> valueModel,
                                   Component component)
        Value model, and component constructor.
        Parameters:
        valueModel - The frame value model.
        component - The single child component, or null if this frame should have no child component.
        Throws:
        java.lang.NullPointerException - if the given value model is null.
    • Method Detail

      • getValueModel

        protected ValueModel<V> getValueModel()
        Returns:
        The value model used by this component.
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface Enableable
        Returns:
        Whether the object is enabled and can receive user input.
      • setEnabled

        public void setEnabled​(boolean newEnabled)
        Description copied from interface: Enableable
        Sets whether the object is enabled and can receive user input. This is a bound property of type Boolean.
        Specified by:
        setEnabled in interface Enableable
        Parameters:
        newEnabled - true if the object should indicate and accept user input.
        See Also:
        Enableable.ENABLED_PROPERTY
      • getStatus

        public Control.Status getStatus()
        Specified by:
        getStatus in interface Control
        Returns:
        The status of the current user input, or null if there is no status to report.
      • setStatus

        protected void setStatus​(Control.Status newStatus)
        Sets the status of the current user input. This is a bound property.
        Parameters:
        newStatus - The new status of the current user input, or null if there is no status to report.
        See Also:
        Control.STATUS_PROPERTY
      • updateStatus

        protected void updateStatus()
        Rechecks user input status of this component, and updates the status.
        See Also:
        setStatus(Control.Status)
      • updateValid

        protected void updateValid()
        Rechecks user input validity of this component and all child components, and updates the valid state. This implementation only updates the valid property if the property is already initialized or there is at least one listener to the Component.VALID_PROPERTY.

        This version also updates the status.

        Overrides:
        updateValid in class AbstractComponent
        See Also:
        updateStatus()
      • setNotification

        public void setNotification​(Notification newNotification)
        Sets the component notification. This is a bound property. The notification is also fired as a NotificationEvent on this component if a new notification is given. Parents are expected to refire the notification event up the hierarchy.

        This version updates the component status if the notification changes.

        Specified by:
        setNotification in interface Component
        Overrides:
        setNotification in class AbstractComponent
        Parameters:
        newNotification - The notification for the component, or null if no notification is associated with this component.
        See Also:
        Component.NOTIFICATION_PROPERTY
      • firePropertyChange

        protected <VV> void firePropertyChange​(java.lang.String propertyName,
                                               VV oldValue,
                                               VV newValue)

        This version first updates the valid status if the value is reported as being changed.

        Overrides:
        firePropertyChange in class com.globalmentor.beans.BoundPropertyObject
      • getValue

        public V getValue()
        Specified by:
        getValue in interface com.globalmentor.model.Valued<V>
        Specified by:
        getValue in interface ValuedComponent<V>
        Specified by:
        getValue in interface ValueModel<V>
        Returns:
        The input value, or null if there is no input value.
      • setValue

        public void setValue​(V newValue)
                      throws java.beans.PropertyVetoException
        Description copied from interface: ValueModel
        Sets the new value. This is a bound property that only fires a change event when the new value is different via the equals() method. If a validator is installed, the value will first be validated before the current value is changed. Validation always occurs if a validator is installed, even if the value is not changing. If the value change is vetoed by the installed validator, the validation exception will be accessible via Throwable.getCause().
        Specified by:
        setValue in interface com.globalmentor.model.MutableValued<V>
        Specified by:
        setValue in interface ValuedComponent<V>
        Specified by:
        setValue in interface ValueModel<V>
        Parameters:
        newValue - The new value.
        Throws:
        java.beans.PropertyVetoException - if the provided value is not valid or the change has otherwise been vetoed.
        See Also:
        ValueModel.getValidator(), ValueModel.VALUE_PROPERTY
      • clearValue

        public void clearValue()
        Description copied from interface: ValueModel
        Clears the value by setting the value to null, which may be invalid according to any installed validators. No validation occurs.
        Specified by:
        clearValue in interface ValueModel<V>
        See Also:
        ValueModel.VALUE_PROPERTY
      • resetValue

        public void resetValue()
        Description copied from interface: ValueModel
        Resets the value to a default value, which may be invalid according to any installed validators. No validation occurs.
        Specified by:
        resetValue in interface ValueModel<V>
        See Also:
        ValueModel.VALUE_PROPERTY
      • getValidator

        public Validator<V> getValidator()
        Specified by:
        getValidator in interface ValueModel<V>
        Returns:
        The validator for this model, or null if no validator is installed.
      • isValidValue

        public boolean isValidValue()
        Description copied from interface: ValueModel
        Determines whether the value of this model is valid.
        Specified by:
        isValidValue in interface ValueModel<V>
        Returns:
        Whether the value of this model is valid.