|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.tum.cs.commons.string.StringUndoStackBase
public abstract class StringUndoStackBase
Base class for an undo stack using a string as the underlying model. Please refer to the test case for a demonstration and further explanation of this class.
Constructor Summary | |
---|---|
protected |
StringUndoStackBase(java.lang.String initialString)
Constructor. |
Method Summary | |
---|---|
boolean |
canRedo()
Returns whether redo is possible. |
boolean |
canUndo()
Returns whether undo is possible. |
protected int |
debugGetSize()
Prints the amount of memory currently used by this stack. |
void |
doSave()
Mark the current position as saved (affects dirty calculation). |
protected abstract void |
fireStackChanged()
Something about this stack has changed. |
protected void |
insertNewVersion(java.lang.String s)
Inserts a new version of the model (as a string) into this stack. |
boolean |
isDirty()
Returns whether something changed compared to the last safe. |
protected abstract java.lang.String |
join(java.util.List<java.lang.String> parts)
Joins the parts created by split(String) . |
void |
redo()
Performs one redo step. |
protected abstract void |
setModelFromString(java.lang.String s)
This should write back the stack content to the model. |
protected abstract java.util.List<java.lang.String> |
split(java.lang.String s)
Splits the given string (as reported from the implementing class) into suitable parts used for diffing (lines, words, tokens, etc.). |
void |
undo()
Performs one undo step. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected StringUndoStackBase(java.lang.String initialString)
Method Detail |
---|
public boolean canUndo()
public void undo()
public boolean canRedo()
public void redo()
public boolean isDirty()
public void doSave()
protected void insertNewVersion(java.lang.String s)
protected abstract java.util.List<java.lang.String> split(java.lang.String s)
protected abstract java.lang.String join(java.util.List<java.lang.String> parts)
split(String)
.
protected abstract void setModelFromString(java.lang.String s)
protected abstract void fireStackChanged()
protected int debugGetSize()
|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |