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
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
ConstructorDescriptionDefault constructor.DefaultTextModel
(String text) Text constructor with a defaultText.PLAIN_MEDIA_TYPE
content type.DefaultTextModel
(String text, com.globalmentor.net.MediaType textContentType) Text and content type constructor -
Method Summary
Modifier and TypeMethodDescriptiongetText()
com.globalmentor.net.MediaType
void
Sets the text.void
setTextContentType
(com.globalmentor.net.MediaType 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
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
Methods inherited from interface com.globalmentor.beans.PropertyConstrainable
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Constructor Details
-
DefaultTextModel
public DefaultTextModel()Default constructor. -
DefaultTextModel
Text constructor with a defaultText.PLAIN_MEDIA_TYPE
content type.- Parameters:
text
- The text, which may include a resource reference, ornull
if there is no text.
-
DefaultTextModel
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:
NullPointerException
- if the given content type isnull
.IllegalArgumentException
- if the given content type is not a text content type.
-
-
Method Details
-
getText
-
setText
Description copied from interface:TextModel
Sets the text. This is a bound property. -
getTextContentType
public com.globalmentor.net.MediaType getTextContentType()- Specified by:
getTextContentType
in interfaceTextModel
- Returns:
- The content type of the text.
-
setTextContentType
public void setTextContentType(com.globalmentor.net.MediaType 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:
-