-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Added a "Clear text" button in right click menu within the text boxes #3465
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.
Thanks for your contribution!
|
||
class ClearField extends MenuItem { | ||
|
||
private final TextArea opener; |
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.
I think there is no need for this private field since the variable is only used in the constructor anyway.
public ClearField(TextArea opener) { | ||
super(Localization.lang("Clear text")); | ||
this.opener = opener; | ||
setOnAction(event -> opener.setText(new NormalizeNamesFormatter().format(""))); |
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.
Why do you use the names formatter here? I think TextArea
has a clear
method, or otherwise setText("")
should work.
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.
Hi, I was on the team with Weida that was working on this issue. We now realize that the things you mention were not needed. We were trying to follow how the other menu item classes were built, and that is why we added the private field. We found the class to add the menu item to the menuItem array by finding a similar issue that dealt with the Normalize name option. But we see now that we made it much more complicated than it needed to be. We should be able to fix these this week if we need to.
Thanks
We also see that the continuous build failed? I'm not sure how adding a small class could break it, so we'll look into this. If anyone sees an issue as well please let us know. Thanks |
Hi, you simply forgot to add a languagefile entry (from the end of the travis log)
|
Adresses koppor#198
It was requested to have a new button within the right click menu of text boxes when creating or editing library entries. See this link for description
We created a new class that extended MenuItem to create the instance of the ClearField.
We added the instance into the menuItem array so that it would be included in the right click menu.
There is a possibility to make each text box a clearable text box, with a red "x" in the corner to clear the text box even quicker. We could not target where to change the type of text box, so that feature still remains.
gradle localizationUpdate
?