-
-
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. #3475
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.jabref.gui.fieldeditors.contextmenu; | ||
|
||
import javafx.scene.control.MenuItem; | ||
import javafx.scene.control.TextArea; | ||
|
||
import org.jabref.logic.l10n.Localization; | ||
|
||
class ClearField extends MenuItem { | ||
|
||
public ClearField(TextArea opener) { | ||
super(Localization.lang("Clear text")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can also just reuse the text "Clear" here so that our poor translators don't have to work too much. |
||
setOnAction(event -> opener.setText("")); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please end code files with a new line |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,13 @@ public class EditorMenus { | |
*/ | ||
public static Supplier<List<MenuItem>> getDefaultMenu(TextArea textArea) { | ||
return () -> { | ||
List<MenuItem> menuItems = new ArrayList<>(5); | ||
List<MenuItem> menuItems = new ArrayList<>(6); | ||
menuItems.add(new CaseChangeMenu(textArea.textProperty())); | ||
menuItems.add(new ConversionMenu(textArea.textProperty())); | ||
menuItems.add(new SeparatorMenuItem()); | ||
menuItems.add(new ProtectedTermsMenu(textArea)); | ||
menuItems.add(new SeparatorMenuItem()); | ||
menuItems.add(new ClearField(textArea)); | ||
return menuItems; | ||
}; | ||
} | ||
|
@@ -57,7 +58,6 @@ public static Supplier<List<MenuItem>> getNameMenu(TextArea textArea) { | |
normalizeNames.setOnAction(event -> textArea.setText(new NormalizeNamesFormatter().format(textArea.getText()))); | ||
Tooltip toolTip = new Tooltip(Localization.lang("If possible, normalize this list of names to conform to standard BibTeX name formatting")); | ||
Tooltip.install(normalizeNames.getContent(), toolTip); | ||
|
||
List<MenuItem> menuItems = new ArrayList<>(6); | ||
menuItems.add(normalizeNames); | ||
menuItems.addAll(getDefaultMenu(textArea).get()); | ||
|
@@ -84,4 +84,4 @@ public static Supplier<List<MenuItem>> getDOIMenu(TextArea textArea) { | |
return menuItems; | ||
}; | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above, please do not remove the new line here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,7 @@ Class_name=Klassenavn | |
Clear=Ryd | ||
|
||
Clear_fields=Ryd_felter | ||
Clear_text= | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You still need to delete these now unused translation strings. |
||
|
||
Close=Luk | ||
Close_others= | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,7 @@ Class_name= | |
Clear= | ||
|
||
Clear_fields= | ||
Clear_text= | ||
|
||
Close= | ||
Close_others= | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,7 @@ Class_name=クラス名 | |
Clear=消去 | ||
|
||
Clear_fields=フィールドを消去 | ||
Clear_text= | ||
|
||
Close=閉じる | ||
Close_others=他を閉じる | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,7 @@ Class_name=Klassenavn | |
Clear=Opphev | ||
|
||
Clear_fields=Slett_felter | ||
Clear_text= | ||
|
||
Close=Lukk | ||
Close_others= | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,7 @@ Class_name=类名 | |
Clear=清除 | ||
|
||
Clear_fields=清除域内容 | ||
Clear_text= | ||
|
||
Close=关闭 | ||
Close_others=关闭其它 | ||
|
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.
Please format the link to the issue in the same way as for the other changelog entries.