com.partnersoft.codex.editors
Class TextModel
java.lang.Object
com.partnersoft.codex.CodexResourceModel
com.partnersoft.codex.editors.TextModel
- All Implemented Interfaces:
- CodexNodeView
public class TextModel
- extends CodexResourceModel
- Author:
- Russell Cagle
Copyright 2006 Partner Software, Inc.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextModel
public TextModel(CodexResource resource)
getStringBuilder
protected java.lang.StringBuilder getStringBuilder()
throws java.io.IOException
- Throws:
java.io.IOException
insertTextRaw
protected void insertTextRaw(int offset,
java.lang.String str)
throws java.io.IOException
- Parameters:
offset - str - a -
- Throws:
java.io.IOException
removeTextRaw
protected void removeTextRaw(int offset,
int length)
throws java.io.IOException
- Parameters:
offset - str - a -
- Throws:
java.io.IOException
addTextModelListener
public void addTextModelListener(TextModelListener listener)
getCodexResource
public CodexResource getCodexResource()
- Description copied from class:
CodexResourceModel
- Should return whatever got set in setCodexResource(). This lets CodexResource
manage the parent-child relationship.
- Overrides:
getCodexResource in class CodexResourceModel
- Returns:
getModelLabel
public java.lang.String getModelLabel()
- Description copied from class:
CodexResourceModel
- Used to label the model in the user interface.
- Specified by:
getModelLabel in class CodexResourceModel
- Returns:
getText
public java.lang.String getText()
throws java.io.IOException
- Throws:
java.io.IOException
invalidateModel
public void invalidateModel()
- Description copied from class:
CodexResourceModel
- When another model calls CodexResource.touch(), the resource invalidates all other models
through this method.
Models should clear out their internal model. For example, the CogModel should clear out
its Cog object.
Models should NOT regenerate their internal model.
- Specified by:
invalidateModel in class CodexResourceModel
insertText
public void insertText(int offset,
java.lang.String newValue)
removeText
public void removeText(int offset,
int length)
throws java.io.IOException
- Throws:
java.io.IOException
removeTextModelListener
public void removeTextModelListener(TextModelListener listener)
save
public void save(java.io.OutputStream outie)
throws java.io.IOException
- Description copied from class:
CodexResourceModel
- This is the counterpart to CodexResource.touch(). CodexResource.touch() invalidates the resource's
bytes, and then the resource calls CodexResourceModel.save() when it needs its bytes back.
- Specified by:
save in class CodexResourceModel
- Throws:
java.io.IOException
setCodexResource
public void setCodexResource(CodexResource resource)