com.jgoodies.binding.value
Class ConverterFactory.BooleanNegator

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by com.jgoodies.binding.value.AbstractValueModel
          extended by com.jgoodies.binding.value.AbstractConverter
              extended by com.jgoodies.binding.value.ConverterFactory.BooleanNegator
All Implemented Interfaces:
Observable, ValueModel, java.io.Serializable
Enclosing class:
ConverterFactory

public static final class ConverterFactory.BooleanNegator
extends AbstractConverter

Negates Booleans leaving null unchanged. Maps Boolean.TRUE to Boolean.FALSE, Boolean.FALSE to Boolean.TRUE, and null to null.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jgoodies.binding.value.AbstractConverter
subject
 
Fields inherited from class com.jgoodies.binding.value.AbstractValueModel
PROPERTYNAME_VALUE
 
Method Summary
 java.lang.Object convertFromSubject(java.lang.Object subjectValue)
          Negates Booleans leaving null unchanged.
 void setValue(java.lang.Object newValue)
          Inverts the given Boolean and sets it as the subject's new value.
 
Methods inherited from class com.jgoodies.binding.value.AbstractConverter
getValue, release
 
Methods inherited from class com.jgoodies.binding.value.AbstractValueModel
addValueChangeListener, booleanValue, doubleValue, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, floatValue, getString, intValue, longValue, removeValueChangeListener, setValue, setValue, setValue, setValue, setValue, toString
 
Methods inherited from class com.jgoodies.binding.beans.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, 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
 

Method Detail

convertFromSubject

public java.lang.Object convertFromSubject(java.lang.Object subjectValue)
Negates Booleans leaving null unchanged. Maps Boolean.TRUE to Boolean.FALSE, Boolean.FALSE to Boolean.TRUE, and null to null.

Specified by:
convertFromSubject in class AbstractConverter
Parameters:
subjectValue - the subject value to invert
Returns:
the text that represents the subject value
Throws:
java.lang.ClassCastException - if the subject's value is not a Boolean

setValue

public void setValue(java.lang.Object newValue)
Inverts the given Boolean and sets it as the subject's new value.

Parameters:
newValue - the value to be inverted and set as new subject value
Throws:
java.lang.ClassCastException - if the new value is not a Boolean
java.lang.IllegalArgumentException - if the new value does neither match the trueText nor the falseText


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