|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.taursys.model.DefaultTextModel
This class implements the TextModel interface and is designed to work with Parameter and Fields. This model stores its value in a ValueHolder object under a propertyName. This model converts the value to/from text using a given format and formatPattern. By default, this model uses a VariantValueHolder.
Constructor Summary | |
DefaultTextModel()
Constructs new DefaultTextModel and initializes valueHolder via createDefaultValueHolder |
|
DefaultTextModel(int javaDataType)
Constructs new DefaultTextModel and sets valueHolder to a VariantValueHolder for given data type. |
Method Summary | |
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds the specified change listener to receive change events from this model. |
protected ValueHolder |
createDefaultValueHolder()
Creates default valueHolder to be used by this model. |
protected void |
fireStateChanged(javax.swing.event.ChangeEvent e)
Reports a state change to all change listeners. |
java.text.Format |
getFormat()
Returns the format for this model which is used by set/getText to parse/display values. |
java.lang.String |
getFormatPattern()
Returns the format formatPattern for this model which is used by set/getText to parse/display values. |
java.lang.String |
getPropertyName()
Returns the propertyName in the valueHolder where this model stores the value. |
java.lang.String |
getText()
Returns the valueHolder's propertyValue as a String value using Format if defined. |
ValueHolder |
getValueHolder()
Returns the valueHolder for this model. |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes the specified change listener so that it no longer receives change events from this model. |
void |
setFormat(java.text.Format newFormat)
Sets the format for this model which is used by set/getText to parse/display values. |
void |
setFormatPattern(java.lang.String newPattern)
Sets the format formatPattern for this model which is used by set/getText to parse/display values. |
void |
setPropertyName(java.lang.String newPropertyName)
Sets the propertyName in the valueHolder where this model stores the value. |
void |
setText(java.lang.String value)
Sets the valueHolder's propertyValue from the given String value to DataType using Format(if defined) to parse. |
protected void |
setupFormat()
Tries to applies the formatPattern to the format. |
void |
setValueHolder(ValueHolder newValueHolder)
Sets the valueHolder for this model. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
Invoked when the target ValueHolder of the listener has changed its state. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DefaultTextModel()
public DefaultTextModel(int javaDataType) throws UnsupportedDataTypeException
UnsupportedDataTypeException
- if invalid javaDataType is givenDataTypes
Method Detail |
protected ValueHolder createDefaultValueHolder()
public java.lang.String getText() throws ModelException
getText
in interface TextModel
ModelException
- if problem occurs when retrieving value from
ValueHolderpublic void setText(java.lang.String value) throws ModelException
setText
in interface TextModel
ModelException
- if problem parsing or storing valueprotected void setupFormat()
public void setValueHolder(ValueHolder newValueHolder)
setValueHolder
in interface TextModel
public ValueHolder getValueHolder()
getValueHolder
in interface TextModel
public void setPropertyName(java.lang.String newPropertyName)
setPropertyName
in interface TextModel
public java.lang.String getPropertyName()
getPropertyName
in interface TextModel
public void setFormat(java.text.Format newFormat)
setFormat
in interface TextModel
public java.text.Format getFormat()
getFormat
in interface TextModel
public void setFormatPattern(java.lang.String newPattern)
setFormatPattern
in interface TextModel
public java.lang.String getFormatPattern()
getFormatPattern
in interface TextModel
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
removeChangeListener
in interface TextModel
public void addChangeListener(javax.swing.event.ChangeListener l)
addChangeListener
in interface TextModel
protected void fireStateChanged(javax.swing.event.ChangeEvent e)
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |