org.escot
Class StringAdapter

java.lang.Object
  |
  +--org.escot.BasicFeature
        |
        +--org.escot.BasicValue
              |
              +--org.escot.BasicString
                    |
                    +--org.escot.StringAdapter
All Implemented Interfaces:
ChangeListener, DocumentListener, EscotAssociated, EscotFeature, EventListener, PropertyChangeListener, StringProperty

public class StringAdapter
extends BasicString
implements PropertyChangeListener, DocumentListener

Adapts a String property. If the property is bound, registers for change events and relays the change. If the target is a JTextComponent, register as a DocumentListener on the document, and track changes to the document property.


Fields inherited from class org.escot.BasicValue
mChangeSupport
 
Fields inherited from class org.escot.BasicFeature
INITIAL_ATTR_CAPACITY, mAttributes, mPCSupport
 
Fields inherited from interface org.escot.StringProperty
MIME_TYPE_ATTRIBUTE, URL_ATTRIBUTE
 
Fields inherited from interface org.escot.EscotFeature
COLOR_ATTRIBUTE, DESCRIPTION_ATTRIBUTE, ICON16x16_ATTRIBUTE, TYPE_ATTRIBUTE
 
Constructor Summary
StringAdapter(Object target, PropertyDescriptor desc)
           
 
Method Summary
protected  void addDocumentListenerToTarget(DocumentListener listener)
           
 void changedUpdate(DocumentEvent e)
           
 String getTextValue()
          Returns the value of this DataItem.
protected  Object getValueFromTarget()
           
 void insertUpdate(DocumentEvent e)
           
 void propertyChange(PropertyChangeEvent evt)
           
 void removeUpdate(DocumentEvent e)
           
 void setTextValue(String s)
          Sets the value of this DataItem.
protected  void updateValueFromTarget()
           
 
Methods inherited from class org.escot.BasicString
addAssociate, duplicate, getBooleanValue, getNumberValue, stateChanged
 
Methods inherited from class org.escot.BasicValue
addChangeListener, canAddAssociate, fireChangeEvent, removeAssociate, removeChangeListener
 
Methods inherited from class org.escot.BasicFeature
addPropertyChangeListener, getAttribute, getName, putAttribute, removePropertyChangeListener, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.escot.StringProperty
addChangeListener, removeChangeListener
 
Methods inherited from interface org.escot.EscotFeature
addPropertyChangeListener, getAttribute, getName, putAttribute, removePropertyChangeListener
 
Methods inherited from interface org.escot.EscotAssociated
canAddAssociate, removeAssociate
 

Constructor Detail

StringAdapter

public StringAdapter(Object target,
                     PropertyDescriptor desc)
Method Detail

updateValueFromTarget

protected void updateValueFromTarget()

insertUpdate

public void insertUpdate(DocumentEvent e)
Specified by:
insertUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent e)
Specified by:
removeUpdate in interface DocumentListener

changedUpdate

public void changedUpdate(DocumentEvent e)
Specified by:
changedUpdate in interface DocumentListener

addDocumentListenerToTarget

protected void addDocumentListenerToTarget(DocumentListener listener)

getValueFromTarget

protected Object getValueFromTarget()

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

getTextValue

public String getTextValue()
Description copied from class: BasicString
Returns the value of this DataItem.
Overrides:
getTextValue in class BasicString
Following copied from interface: org.escot.StringProperty
Returns:
the String for this StringProperty

setTextValue

public void setTextValue(String s)
                  throws NotMutableException
Description copied from class: BasicString
Sets the value of this DataItem.
Overrides:
setTextValue in class BasicString