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


 

 

jve.generated
Class SwingTextComponentBinder

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.PlainDocument
          extended byjve.generated.SwingTextComponentBinder

All Implemented Interfaces:
javax.swing.text.Document, java.util.EventListener, IFieldBinder, java.beans.PropertyChangeListener, java.io.Serializable


public class SwingTextComponentBinder
extends javax.swing.text.PlainDocument
implements IFieldBinder, java.beans.PropertyChangeListener

Swing implementation of the IFieldBinder interface. This class acts as a document for a Swing JTextComponent. This field provides basic validation of the text entered into the field, to ensure the value can be parsed into the bound data type. To modify the default validation behavior, override the textToObject() method.

See Also:
Serialized Form


Nested Class Summary
 

Nested classes inherited from class javax.swing.text.AbstractDocument
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
 

Field Summary
 

Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
 

Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 

Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 

Constructor Summary
SwingTextComponentBinder()
           
 

Method Summary
protected  void contentChanged(javax.swing.event.DocumentEvent de)
          Drive the text field change back into the Object we are bounded to.
 IDataObject getDataObject()
          Get the data object that provides the data to this binder.
 java.lang.String getProperty()
          Get the property of the data object that will be used by this binder
 javax.swing.text.JTextComponent getVisualTextComponent()
           
 boolean isAutoEditable()
          Check to see if the autoEditable feature is enabled.
protected  boolean isNullEditable()
           
protected  boolean isReadOnly()
           
 java.lang.String objectToText(java.lang.Object o)
          Convert the given object into a text representation.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void setAutoEditable(boolean autoEnable)
          Set the auto enable property, which automatically enables/disables editing the text field when the bound data value is valid.
 void setDataObject(IDataObject binder)
          Set the data object that provides the data used by this binder.
 void setProperty(java.lang.String string)
          Set the property of the object that will be used as the target of this binder.
 void setVisualTextComponent(javax.swing.text.JTextComponent visualTextComponent)
           
 java.lang.Object textToObject(java.lang.String text)
          Convert the given text to a Object of the type that's the bound property.
 java.lang.String toString()
           
protected  void updateContent()
           
protected  void updateContent(java.lang.Object o)
           
 

Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertString, insertUpdate, removeUpdate
 

Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 

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

Constructor Detail

 

 

SwingTextComponentBinder

public SwingTextComponentBinder()

Method Detail

 

 

getDataObject

public IDataObject getDataObject()

Description copied from interface: IFieldBinder
Get the data object that provides the data to this binder.

Specified by:
getDataObject in interface IFieldBinder

Returns:
the data object this binder is associated with.


 

 

getProperty

public java.lang.String getProperty()

Description copied from interface: IFieldBinder
Get the property of the data object that will be used by this binder

Specified by:
getProperty in interface IFieldBinder

Returns:
the property this field is bound to.


 

 

setDataObject

public void setDataObject(IDataObject binder)

Description copied from interface: IFieldBinder
Set the data object that provides the data used by this binder.

Specified by:
setDataObject in interface IFieldBinder

Parameters:
binder -


 

 

setProperty

public void setProperty(java.lang.String string)

Description copied from interface: IFieldBinder
Set the property of the object that will be used as the target of this binder. This property should have a string representation that will be used in this field.

Specified by:
setProperty in interface IFieldBinder

Parameters:
string -


 

 

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)

Specified by:
propertyChange in interface java.beans.PropertyChangeListener


 

 

isNullEditable

protected boolean isNullEditable()


 

 

updateContent

protected void updateContent(java.lang.Object o)


 

 

isReadOnly

protected boolean isReadOnly()


 

 

updateContent

protected void updateContent()


 

 

contentChanged

protected void contentChanged(javax.swing.event.DocumentEvent de)

Drive the text field change back into the Object we are bounded to.


 

 

getVisualTextComponent

public javax.swing.text.JTextComponent getVisualTextComponent()

Returns:
Returns the visualTextComponent.


 

 

setVisualTextComponent

public void setVisualTextComponent(javax.swing.text.JTextComponent visualTextComponent)

Parameters:
visualTextComponent - fooa The visualTextComponent to set.


 

 

objectToText

public java.lang.String objectToText(java.lang.Object o)

Convert the given object into a text representation. Overide for special conversion semantics.

Specified by:
objectToText in interface IFieldBinder

Parameters:
o - the object to convert
Returns:
an text representation of the object.


 

 

textToObject

public java.lang.Object textToObject(java.lang.String text)
                              throws java.lang.IllegalArgumentException

Convert the given text to a Object of the type that's the bound property. Overide for special conversion semantics.

Specified by:
textToObject in interface IFieldBinder

Parameters:
text - the text value to convert
Returns:
the converted object of the correct type
Throws:
java.lang.IllegalArgumentException - if the text cannot be converted into the proper type.


 

 

isAutoEditable

public boolean isAutoEditable()

Check to see if the autoEditable feature is enabled.

Returns:
Returns the autoEnable.


 

 

setAutoEditable

public void setAutoEditable(boolean autoEnable)

Set the auto enable property, which automatically enables/disables editing the text field when the bound data value is valid.

Parameters:
autoEnable - true to enable the autoEditable feature, false to disable.


 

 

toString

public java.lang.String toString()


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