Libraries.Interface.Undo.TextBoxEditManager Documentation

Inherits from: Libraries.Interface.Events.TextChangeListener, Libraries.Language.Object, Libraries.Interface.Undo.EditManager

Summary

Variable Summary Table

VariablesDescription
integer RESET_STATEThe manager will be in this state when it is ready for changes to the TextBox.
integer DELETE_WORD_STATEThis state is for when a word is being deleted from the TextBox
integer ADD_WORD_STATEThis state is for when a word is being added to the TextBox
integer SPECIAL_STATEThis 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_STATE
integer DELETE_SPACE_STATEThis state is for when whitespace is being deleted from the TextBox
integer ADD_SPACE_STATEThis state is for when whitespace is being added to the TextBox
integer NULL_STATEThis 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 another
integer OFF_STATEThis 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 functionality

Actions Summary Table

ActionsDescription
Add(Libraries.Interface.Undo.Edit undo)The Add(Edit) action adds an item to the undo list.
CanRedo()This action checks to see if there is any items that can be redone.
CanUndo()
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Empty()This action empties the EditManager of all edits.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetCurrentState()
GetHashCode()This action gets the hash code for an object.
GetRedoCount()This action returns how many edits there are in the redo list.
GetTextBox()
GetUndoCount()This action returns how many edits there are in the undo list.
Redo()
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
SetSpecialAction(boolean start)
SetTextBox(Libraries.Interface.Controls.TextBox newBox)
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
TextChanged(Libraries.Interface.Events.TextChangeEvent event)
Undo()

Actions Documentation

Add(Libraries.Interface.Undo.Edit undo)

The Add(Edit) action adds an item to the undo list. The redo list cannot be directly added to and is, instead, controlled by undoing.

Example Code

use Libraries.Interface.Undo.EditManager
        use Libraries.Interface.Undo.Edit

        EditManager edits
        Edit edit
        edits:Add(edit)
        edits:Undo()

Parameters

CanRedo()

This action checks to see if there is any items that can be redone. If so, it returns true.

Example Code

use Libraries.Interface.Undo.EditManager
        use Libraries.Interface.Undo.Edit

        EditManager edits
        Edit edit
        edits:Add(edit)
        output edits:CanRedo()

Return

boolean: whether we can redo

CanUndo()

Return

boolean

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

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.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetCurrentState()

Return

integer

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetRedoCount()

This action returns how many edits there are in the redo list.

Example Code

use Libraries.Interface.Undo.EditManager
        use Libraries.Interface.Undo.Edit

        EditManager edits
        Edit edit
        edits:Add(edit)
        output edits:GetRedoCount()

Return

integer: how many edits are in the redo list

GetTextBox()

Return

Libraries.Interface.Controls.TextBox

GetUndoCount()

This action returns how many edits there are in the undo list.

Example Code

use Libraries.Interface.Undo.EditManager
        use Libraries.Interface.Undo.Edit

        EditManager edits
        Edit edit
        edits:Add(edit)
        output edits:GetUndoCount()

Return

integer: how many edits are in the undo list

Redo()

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

SetSpecialAction(boolean start)

Parameters

SetTextBox(Libraries.Interface.Controls.TextBox newBox)

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

TextChanged(Libraries.Interface.Events.TextChangeEvent event)

Parameters

Undo()