Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.jgoodies.binding.value
Class AbstractWrappedValueModel

    java.lang.Object
      com.jgoodies.common.bean.AbstractBean
          com.jgoodies.binding.beans.Model
              com.jgoodies.binding.value.AbstractValueModel
                  com.jgoodies.binding.value.AbstractWrappedValueModel

All Implemented Interfaces:
  ComponentModel, ComponentValueModel, ValueModel, com.jgoodies.common.bean.ObservableBean, com.jgoodies.common.bean.ObservableBean2, Serializable

Direct Known Subclasses:
  AbstractConverter, DefaultComponentValueModel

    public abstract class AbstractWrappedValueModel

extends AbstractValueModel
implements ComponentValueModel

An abstract wrapper for ValueModels that provides ComponentModel features.

Since:
  2.4
Version:
  $Revision: 1.15 $
Author:
  Karsten Lentzsch
See Also:
  Serialized Form

Field Summary

Fields inherited from class com.jgoodies.binding.value.AbstractValueModel
`PROPERTYNAME_VALUE`

Fields inherited from class com.jgoodies.common.bean.AbstractBean
`changeSupport`

Fields inherited from interface com.jgoodies.binding.value.ComponentValueModel
`PROPERTYNAME_EDITABLE, PROPERTYNAME_ENABLED, PROPERTYNAME_VISIBLE`

Fields inherited from interface com.jgoodies.binding.value.ComponentModel
`PROPERTY_EDITABLE, PROPERTY_ENABLED, PROPERTY_VISIBLE`

Constructor Summary
`AbstractWrappedValueModel(ValueModel wrappee)` Constructs a DefaultComponentValueModel that wraps the given ValueModel and adds `ComponentModel` Properties.

Method Summary
`protected abstract PropertyChangeListener` | `createValueChangeHandler()`
`protected ValueModel` | `getWrappee()`
`boolean` | `isEditable()` Returns if this model represents the editable or non-editable text component state.
`boolean` | `isEnabled()` Returns if this model represents an enabled or disabled component state.
`boolean` | `isVisible()` Returns if this model represents the visible or invisible component state.
`void` | `release()` Removes the internal change handlers from the wrapped value model.
`void` | `setEditable(boolean b)` Sets this model state to editable or non-editable, which in turn will make all text components bound to this model editable or non-editable.
`void` | `setEnabled(boolean b)` Enables or disabled this model, which in turn will enable or disable all Swing components bound to this model.
`void` | `setVisible(boolean b)` Sets this model state to visible or invisible, which in turn will make all Swing components bound to this model visible or invisible.

Methods inherited from class com.jgoodies.binding.value.AbstractValueModel
`addValueChangeListener, booleanValue, doubleValue, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, floatValue, getString, intValue, longValue, paramString, removeValueChangeListener, setValue, setValue, setValue, setValue, setValue, toString, valueString`

Methods inherited from class com.jgoodies.binding.beans.Model
`createPropertyChangeSupport, firePropertyChange`

Methods inherited from class com.jgoodies.common.bean.AbstractBean
`addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.jgoodies.binding.value.ValueModel
`addValueChangeListener, getValue, removeValueChangeListener, setValue`

Methods inherited from interface com.jgoodies.common.bean.ObservableBean2
`addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener`

Methods inherited from interface com.jgoodies.common.bean.ObservableBean
`addPropertyChangeListener, removePropertyChangeListener`

Constructor Detail

### AbstractWrappedValueModel

    public AbstractWrappedValueModel(ValueModel wrappee)

  Constructs a DefaultComponentValueModel that wraps the given ValueModel and adds `ComponentModel` Properties.

  Parameters:
    `wrappee` - the underlying or wrapped ValueModel

Method Detail

### isEnabled

    public boolean isEnabled()

  Returns if this model represents an enabled or disabled component state.

  Specified by:
    `isEnabled` in interface `ComponentModel`
  Returns:
    true for enabled, false for disabled

### setEnabled

    public void setEnabled(boolean b)

  Enables or disabled this model, which in turn will enable or disable all Swing components bound to this model.

  Specified by:
    `setEnabled` in interface `ComponentModel`
  Parameters:
    `b` - true to enable, false to disable.

### isVisible

    public boolean isVisible()

  Returns if this model represents the visible or invisible component state.

  Specified by:
    `isVisible` in interface `ComponentModel`
  Returns:
    true for visible, false for invisible

### setVisible

    public void setVisible(boolean b)

  Sets this model state to visible or invisible, which in turn will make all Swing components bound to this model visible or invisible.

  Specified by:
    `setVisible` in interface `ComponentModel`
  Parameters:
    `b` - true for visible, false for invisible

### isEditable

    public boolean isEditable()

  Returns if this model represents the editable or non-editable text component state.

  Specified by:
    `isEditable` in interface `ComponentModel`
  Returns:
    true for editable, false for non-editable

### setEditable

    public void setEditable(boolean b)

  Sets this model state to editable or non-editable, which in turn will make all text components bound to this model editable or non-editable.

  Specified by:
    `setEditable` in interface `ComponentModel`
  Parameters:
    `b` - true for editable, false for non-editable

### release

    public void release()

  Removes the internal change handlers from the wrapped value model. The listener has been registered during construction. Useful to avoid memory leaks, if the wrappee lives much longer than this wrapper. As an alternative you can use event listener lists in your ValueModels that implement references with `WeakReference`.

  This model must not be used anymore once #release has been called.

  Subclasses that override this method must call this super implementation.

### createValueChangeHandler

    protected abstract PropertyChangeListener createValueChangeHandler()

### getWrappee

    protected final ValueModel getWrappee()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2011 JGoodies Karsten Lentzsch. All Rights Reserved.