TextBoxEditManager
Package: Libraries.Interface.Undo · Inherits from: Libraries.Interface.Events.TextChangeListener, Libraries.Language.Object, Libraries.Interface.Undo.EditManager
Variables
integer RESET_STATE: The manager will be in this state when it is ready for changes to the TextBox.integer DELETE_WORD_STATE: This state is for when a word is being deleted from the TextBoxinteger SPECIAL_STATE: This state is used for saving more complex actions such as adding multiple indentations to the text box. If the text box is set to this the text box wont leave it until it is switched out to the RESET_STATEinteger DELETE_SPACE_STATE: This state is for when whitespace is being deleted from the TextBoxinteger ADD_SPACE_STATE: This state is for when whitespace is being added to the TextBoxinteger NULL_STATE: This state is used to tell the edit manager to ignore any upcoming changes to the TextBox. The manager will not leave this state until set to anotherinteger OFF_STATE: This state is used for turning off the manager. This means that the manager will no longer have any edits and will try to make any new ones. Different from the NULL_STATE in that the OFF_STATE is mainly for use in TextBoxes that do need Undo functionalityinteger ADD_WORD_STATE: This state is for when a word is being added to the TextBox
Actions
CanUndo()
If true is passed this will empty the manager and it will no longer save any states until called again with false
Returns
boolean
Empty()
This action empties the EditManager of all edits. In the process, it clears the current state and calls dispose on each edit to ensure it has the opportunity to free any resources.
GetCurrentState()
This state is for when whitespace is being added to the TextBox
Returns
integer
GetTextBox()
This state is for when a word is being deleted from the TextBox
Returns
Redo()
do the undo
Reset()
Saves the current Edit and sets the state to RESET
SetOff(boolean off)
If true is passed this will empty the manager and it will no longer save any states until called again with false
Parameters
offboolean
SetSpecialAction(boolean start)
do the redo
Parameters
startboolean
SetTextBox(Libraries.Interface.Controls.TextBox newBox)
This state is for when whitespace is being deleted from the TextBox
Parameters
SetToIgnore(boolean ignore)
If true then the Edit Manager will be in the NULL_STATE and will ignore any text change events until set to false
Parameters
ignoreboolean
TextChanged(Libraries.Interface.Events.TextChangeEvent event)
Saves the current Edit and sets the state to RESET
Parameters
Undo()
This state is for when a word is being added to the TextBox