Class Table.DefaultCellValueModel<C>

  • Type Parameters:
    C - The type of value in the cell.
    All Implemented Interfaces:
    com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, com.globalmentor.model.MutableValued<C>, com.globalmentor.model.Valued<C>, Model, ValueModel<C>
    Enclosing class:

    public static class Table.DefaultCellValueModel<C>
    extends DefaultValueModel<C>
    A value model that returns and updates a the value of the cell.
    Garret Wilson
    • Field Summary

      • Fields inherited from class com.globalmentor.beans.BoundPropertyObject

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected TableModel.Cell<C> getCell()  
      protected TableModel getModel()  
      Validator<C> getValidator()  
      C getValue()  
      void resetValue()
      Resets the value to a default value, which may be invalid according to any installed validators.
      void setValidator​(Validator<C> newValidator)
      Sets the validator.
      void setValue​(C newValue)
      Sets the new value.
      • Methods inherited from class com.globalmentor.beans.BoundPropertyObject

        addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.globalmentor.beans.PropertyBindable

        addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
      • Methods inherited from interface com.globalmentor.beans.PropertyConstrainable

        addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
    • Constructor Detail

      • DefaultCellValueModel

        public DefaultCellValueModel​(TableModel model,
                                     TableModel.Cell<C> cell)
        Constructs a default value model for a cell.
        model - The table model of the cell.
        cell - The cell being represented.
        java.lang.NullPointerException - if the given table model and/or cell is null.
    • Method Detail

      • getModel

        protected TableModel getModel()
        The table model of the cell.
      • getCell

        protected TableModel.Cell<C> getCell()
        The cell being represented
      • getValue

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

        public void setValue​(C 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<C>
        Specified by:
        setValue in interface ValueModel<C>
        setValue in class DefaultValueModel<C>
        newValue - The new value.
        java.beans.PropertyVetoException - if the provided value is not valid or the change has otherwise been vetoed.
        See Also:
        ValueModel.getValidator(), ValueModel.VALUE_PROPERTY