|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.beanfabrics.AbstractBean
org.beanfabrics.ValidatableBean
org.beanfabrics.model.AbstractPM
org.beanfabrics.model.AbstractValuePM
org.beanfabrics.model.TextPM
public class TextPM
The TextPM
is a presentation model for a text value.
The default value is an empty string.
Nested Class Summary | |
---|---|
class |
TextPM.DefaultOptionsValidationRule
|
protected class |
TextPM.TextComparable
The TextPM.TextComparable delegates the comparison to a CollationKey constructed
from the PM's text using a Collator . |
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractValuePM |
---|
AbstractValuePM.MandatoryValidationRule |
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractPM |
---|
AbstractPM.PropertiesValidationRule |
Field Summary | |
---|---|
protected static java.lang.String |
KEY_MESSAGE_VALUE_NOT_AN_OPTION
|
Fields inherited from class org.beanfabrics.model.AbstractValuePM |
---|
KEY_MESSAGE_MANDATORY |
Fields inherited from class org.beanfabrics.model.AbstractPM |
---|
KEY_MESSAGE_ONE_OR_MORE_INVALID |
Constructor Summary | |
---|---|
TextPM()
Constructs a new TextPM |
|
TextPM(java.lang.String initialText)
Constructs a new TextPM |
Method Summary | |
---|---|
java.lang.Comparable<?> |
getComparable()
Returns the comparable substitute. |
protected java.lang.String |
getDefaultText()
Get the default text value of this model. |
Options |
getOptions()
Returns the options. |
java.lang.String |
getText()
Returns the text value of this PM. |
java.lang.String |
getText(boolean convertWhitespaceStringToNull)
|
boolean |
isEmpty()
Returns whether the value of this PM is interpreted as an empty value. |
boolean |
isModified()
Returns whether this PM is modified. |
boolean |
isRestrictedToOptions()
|
void |
preset()
Sets the default text of this PM to the text value of this PM. |
void |
reformat()
Reformats the text value by first parsing it and the formatting it with an appropriate format. |
void |
reset()
Sets the value of this PM to the value of the default text. |
protected void |
setDefaultText(java.lang.String aText)
Sets the default text value of this model. |
void |
setOptions(Options newOptions)
Sets the Options . |
void |
setRestrictedToOptions(boolean restrictedToOptions)
If set to true this TextPM is only valid if
its text content is contained in its options. |
void |
setText(java.lang.String aText)
Set the value of this OPm to the given text. |
Methods inherited from class org.beanfabrics.model.AbstractValuePM |
---|
getDescription, getTitle, isEditable, isMandatory, revalidate, setDescription, setEditable, setMandatory, setTitle |
Methods inherited from class org.beanfabrics.model.AbstractPM |
---|
getContext, getSupportMap, revalidateProperties |
Methods inherited from class org.beanfabrics.ValidatableBean |
---|
getValidationState, getValidator, isValid, setValidationState |
Methods inherited from class org.beanfabrics.AbstractBean |
---|
addPropertyChangeListener, addPropertyChangeListener, equals, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.beanfabrics.model.IValuePM |
---|
getDescription, getTitle, isEditable, isMandatory, setDescription, setEditable, setMandatory, setTitle |
Methods inherited from interface org.beanfabrics.Bean |
---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from interface org.beanfabrics.validation.Validatable |
---|
getValidationState, getValidator, isValid, revalidate |
Methods inherited from interface org.beanfabrics.support.Supportable |
---|
getSupportMap |
Methods inherited from interface org.beanfabrics.context.ContextOwner |
---|
getContext |
Field Detail |
---|
protected static final java.lang.String KEY_MESSAGE_VALUE_NOT_AN_OPTION
Constructor Detail |
---|
public TextPM(java.lang.String initialText)
TextPM.
public TextPM()
TextPM.
Method Detail |
---|
public java.lang.String getText()
getText
in interface ITextPM
public java.lang.String getText(boolean convertWhitespaceStringToNull)
public void setText(java.lang.String aText)
null
, it will be changed into the empty string
""
.
setText
in interface ITextPM
aText
- the text valueprotected java.lang.String getDefaultText()
protected void setDefaultText(java.lang.String aText)
Use reset()
to set the model's value to it's default value or
preset()
to set the model's default value to it's current value.
Note: Setting this default value does does not necessarily mean that the actual value of this PM is changed to that value also.
aText
- the text to set as default valuepublic boolean isRestrictedToOptions()
public void setRestrictedToOptions(boolean restrictedToOptions)
true
this TextPM
is only valid if
its text content is contained in its options.
restrictedToOptions
- public boolean isEmpty()
isEmpty
in interface IValuePM
true
if this PM contains an empty valuepublic boolean isModified()
isModified
in interface ITextPM
ITextPM.getText()
,
ITextPM.preset()
public void reset()
reset
in interface ITextPM
public void preset()
preset
in interface ITextPM
public void reformat()
reformat
in interface ITextPM
public Options getOptions()
ITextPM
getOptions
in interface ITextPM
ITextPM.setOptions(Options)
public void setOptions(Options newOptions)
ITextPM
Options
. This attribute is used by some view components
to show possible text values that can be choosen.
setOptions
in interface ITextPM
public java.lang.Comparable<?> getComparable()
Override this method to control how instances of this class are sorted by a Sorter.
The default implementation returns a TextPM.TextComparable
or one of its subclasses.
getComparable
in interface HasComparable
getComparable
in class AbstractPM
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |