Skip to content
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

Merged
merged 5 commits into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We added an option to mass append to fields via the Quality -> set/clear/append/rename fields dialog. [#2721](https://github.com/JabRef/jabref/issues/2721)
- We added a check on startup to ensure JabRef is run with an adequate Java version. [3310](https://github.com/JabRef/jabref/issues/3310)
- In the preference, all installed java Look and Feels are now listed and selectable
- We added a clear option to the right-click menu of the text field in the entry editor. [koppor#198](https://github.com/koppor/jabref/issues/198)


### Fixed
- We fixed the translation of \textendash in the entry preview [#3307](https://github.com/JabRef/jabref/issues/3307)
Expand Down
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"));
setOnAction(event -> opener.setText(""));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
Expand All @@ -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());
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Klassenavn
Clear=Ryd

Clear_fields=Ryd_felter
Clear_text=
Copy link
Member

Choose a reason for hiding this comment

The 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=
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Klassenname
Clear=Zurücksetzen

Clear_fields=Felder_löschen
Clear_text=

Close=Schließen
Close_others=Andere_schließen
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_el.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=
Clear=Καθαρισμός

Clear_fields=Καθαρισμός_πεδίων
Clear_text=

Close=Κλείσιμο
Close_others=
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Class_name
Clear=Clear

Clear_fields=Clear_fields
Clear_text=Clear_text

Close=Close
Close_others=Close_others
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Nombre_de_clase
Clear=Limpiar

Clear_fields=Limpiar_campos
Clear_text=

Close=Cerrar
Close_others=Cerrar_otros
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=
Clear=

Clear_fields=
Clear_text=

Close=
Close_others=
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Nom_de_classe
Clear=Vider

Clear_fields=Vider_les_champs
Clear_text=

Close=Fermer
Close_others=Fermer_les_autres
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_in.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Nama_kelas
Clear=Bersihkan

Clear_fields=Bersihkan_beberapa_bidang
Clear_text=

Close=Tutup
Close_others=Tutup_lainnya
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Nome_della_classe
Clear=Svuota

Clear_fields=Annulla_i_campi
Clear_text=

Close=Chiudi
Close_others=Chiudi_gli_altri
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=クラス名
Clear=消去

Clear_fields=フィールドを消去
Clear_text=

Close=閉じる
Close_others=他を閉じる
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Klassenaam
Clear=Wissen

Clear_fields=Velden_wissen
Clear_text=

Close=Sluiten
Close_others=
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_no.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Klassenavn
Clear=Opphev

Clear_fields=Slett_felter
Clear_text=

Close=Lukk
Close_others=
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Nome_da_classe
Clear=Limpar

Clear_fields=Limpar_campos
Clear_text=

Close=Fechar
Close_others=Fechar_os_outros
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Имя_класса
Clear=Очистить

Clear_fields=Очистить_поля
Clear_text=

Close=Закрыть
Close_others=Закрыть_другие
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Klassnamn
Clear=Rensa

Clear_fields=Rensa_fält
Clear_text=

Close=Stäng
Close_others=Stäng_andra
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Sınıf_adı
Clear=Sil

Clear_fields=Alanları_sil
Clear_text=

Close=Kapat
Close_others=Diğerlerini_Kapat
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_vi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=Tên_lớp
Clear=Xóa

Clear_fields=Xóa_các_dữ_liệu
Clear_text=

Close=Đóng
Close_others=Đóng_các_mục_khác
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Class_name=类名
Clear=清除

Clear_fields=清除域内容
Clear_text=

Close=关闭
Close_others=关闭其它
Expand Down