Private
filePrivate
listenersPrivate
Readonly
mistakePrivate
Readonly
mistakePrivate
mistakePrivate
addOpens the editor to input the details of a new mistake, calling #singleEditMistake and providing it with a new draft mistake generated by MistakeManager#getDraftMistake.
true
if the mistake was added successfully
IllegalArgumentError if the category is invalid
IllegalDOMchangeError if the HTML DOM was changed unexpectedly
the HTML element that was clicked to add a new mistake
Private
clearPrivate
clearPrivate
closePrivate
deleteDeletes a mistake according to the user's input, by calling MistakeManager#deleteMistakeByID.
boolean indicating whether the mistake was deleted successfully
IllegalArgumentError if the HTML element is invalid
the HTML element that was clicked to delete the mistake
Displays an error alert with a generic introduction (if wanted) and, if provided, the given error code and custom error message.
Optional
displayGenericIntroduction: booleanboolean indicating whether the generic introduction should be displayed
Optional
errorCode: ErrorCodeoptional error code to be displayed beneath the generic introduction
Optional
customErrorMessage: stringan optional custom error message to be displayed beneath the generic introduction and the error code
Private
fillFills in those fields of the mistake that are arrays into the editor.
true
if successful
IllegalDOMchangeError if the DOM has been changed in an illegal way
the mistake to be edited
Private
getUIDsExtracts all valid mistake UIDs from the given array, and returns them. Mistake IDs are converted to UIDs by looking them up in the mistake manager.
the array of valid mistake UIDs
IllegalArgumentError if the given array contains invalid related mistakes
the array of related mistakes
Private
hashPrivate
moveMoves a mistake up or down, calling moveMistake.
boolean indicating whether the mistake was moved successfully
IllegalArgumentError if the mistake ID is invalid or does not exist
the HTML element that was clicked by the user
the direction in which the mistake should be moved
Private
readReads the file that was chosen by the user in the GUI and parses it by calling FileManager#parseFile.
boolean indicating whether choosing the file was successful
IllegalArgumentError if the HTML element is null
the file input element that was clicked
Registers all necessary click listeners for the HTML DOM.
Private
saveUser clicked on the "Save" button in the mistake editor.
true
if the mistake was successfully saved, false
otherwise
IllegalDOMchangeError if the DOM has been changed in an illegal way
Private
singleDisplays the editor popup with the mistake to be edited.
true
if the mistake was successfully edited or false
if the mistake was not found
IllegalDOMchangeError if the DOM was changed in a way that is not allowed
Private
singleDisplays the editor popup with the mistake of the given ID.
true
if the mistake was successfully edited or false
otherwise
IllegalArgumentError if the given ID does not exist
IllegalDOMchangeError if the DOM has been changed in an illegal way
Private
toastDisplays a toast with the given status and text.
true
if the toast was displayed successfully
the CSS class to be added to the toast, either "success
" (green) or
"fail
" (red)
the text to be displayed in the toast
Private
toggleStatic
Private
containsStatic
Private
isStatic
Private
removeGenerated using TypeDoc
A UIManager is responsible for updating the HTML DOM and reacting to user input.