Package io.guise.framework.model
Class DefaultTextModel
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- io.guise.framework.model.AbstractModel
-
- io.guise.framework.model.DefaultTextModel
-
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,Model
,TextModel
public class DefaultTextModel extends AbstractModel implements TextModel
The default implementation of a model for text and an associated label.- Author:
- Garret Wilson
-
-
Field Summary
-
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Fields inherited from interface io.guise.framework.model.TextModel
TEXT_CONTENT_TYPE_PROPERTY, TEXT_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description DefaultTextModel()
Default constructor.DefaultTextModel(java.lang.String text)
Text constructor with a defaultText.PLAIN_CONTENT_TYPE
content type.DefaultTextModel(java.lang.String text, com.globalmentor.net.ContentType textContentType)
Text and content type constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getText()
com.globalmentor.net.ContentType
getTextContentType()
void
setText(java.lang.String newText)
Sets the text.void
setTextContentType(com.globalmentor.net.ContentType newTextContentType)
Sets the content type of the text.-
Methods inherited from class io.guise.framework.model.AbstractModel
getEventListenerManager, getPlainText
-
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
DefaultTextModel
public DefaultTextModel()
Default constructor.
-
DefaultTextModel
public DefaultTextModel(java.lang.String text)
Text constructor with a defaultText.PLAIN_CONTENT_TYPE
content type.- Parameters:
text
- The text, which may include a resource reference, ornull
if there is no text.
-
DefaultTextModel
public DefaultTextModel(java.lang.String text, com.globalmentor.net.ContentType textContentType)
Text and content type constructor- Parameters:
text
- The text, which may include a resource reference, ornull
if there is no text.textContentType
- The content type of the text.- Throws:
java.lang.NullPointerException
- if the given content type isnull
.java.lang.IllegalArgumentException
- if the given content type is not a text content type.
-
-
Method Detail
-
getText
public java.lang.String getText()
-
setText
public void setText(java.lang.String newText)
Description copied from interface:TextModel
Sets the text. This is a bound property.- Specified by:
setText
in interfaceTextModel
- Parameters:
newText
- The new text, which may include a resource reference.- See Also:
TextModel.TEXT_PROPERTY
-
getTextContentType
public com.globalmentor.net.ContentType getTextContentType()
- Specified by:
getTextContentType
in interfaceTextModel
- Returns:
- The content type of the text.
-
setTextContentType
public void setTextContentType(com.globalmentor.net.ContentType newTextContentType)
Description copied from interface:TextModel
Sets the content type of the text. This is a bound property.- Specified by:
setTextContentType
in interfaceTextModel
- Parameters:
newTextContentType
- The new text content type.- See Also:
TextModel.TEXT_CONTENT_TYPE_PROPERTY
-
-