com.glaivestone.mv
Class StringHolder

java.lang.Object
  |
  +--com.glaivestone.mv.AbstractValueHolder
        |
        +--com.glaivestone.mv.ValueHolder
              |
              +--com.glaivestone.mv.StringHolder

public class StringHolder
extends ValueHolder

A value holder which contains an observed String value.

The value in the holder is guaranteed to always be a String instance (possibly empty). Setting the value to null is equivalent to setting the value to an empty string.

A string holder should generally be used for relatively small string values. Large or complex text values should use a Swing Document model to hold the value.

Author:
Deb Lewis

Field Summary
 
Fields inherited from class com.glaivestone.mv.AbstractValueHolder
DEFAULT_NOTIFICATION_ORDER, NOTIFY_FIRST_TO_LAST, NOTIFY_LAST_TO_FIRST
 
Constructor Summary
StringHolder()
          Creates a new string value holder which contains an empty string.
StringHolder(java.lang.String aString)
          Creates a new string value holder which contains the specified string.
 
Method Summary
 java.lang.String getText()
          Returns the String value held by this model.
 void setText(java.lang.String newValue)
          Sets the String value held by this model.
 void setValueAttribute(java.lang.Object newValue)
          Set the current value.
 
Methods inherited from class com.glaivestone.mv.ValueHolder
getValue, setValue
 
Methods inherited from class com.glaivestone.mv.AbstractValueHolder
addChangeListener, removeChangeListener, setNotificationOrder
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringHolder

public StringHolder()
Creates a new string value holder which contains an empty string.


StringHolder

public StringHolder(java.lang.String aString)
Creates a new string value holder which contains the specified string.

Method Detail

getText

public java.lang.String getText()
Returns the String value held by this model. Always returns a String instance (never null).

Supported for protocol consistency with the Swing Document model.


setValueAttribute

public void setValueAttribute(java.lang.Object newValue)
Set the current value. Do not fire the ValueChange event.

Overrides:
setValueAttribute in class ValueHolder

setText

public void setText(java.lang.String newValue)
Sets the String value held by this model. Triggers the changed event if the value is different.

Supported for protocol consistency with the Swing Document model.


GFL 1.1 API