-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement user input history #133
Implement user input history #133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/** | ||
* Handles the Enter button pressed event. | ||
*/ | ||
@FXML | ||
private void handleCommandEntered() { | ||
userInputHistory.addToHistory(commandTextField.getText()); | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might want to consider only adding the text if its not blank?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah should've considered that earlier.
@@ -0,0 +1,54 @@ | |||
package seedu.address.ui; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will unit tests be added in future PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add them in this PR!
Closes #132.
New features/changes
Implementations
UserInputHistory
to store all user inputs within the session. User inputs are stored in aLinkedList
, and itsListIterator
is used to navigate between inputs. Whenever the user enters a command, add the input to theuserInputHistory
of the command box and reset its iterator.Possible improvements
ListIterator
navigation logic).Testing
UserInputHistory
class.Demo