From 8aedf6f5b9fd7d64740aa5dec8305e40a667c60b Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Wed, 7 Dec 2016 16:42:09 +0100 Subject: [PATCH 1/7] Rename menu item to plurar for finding full texts --- src/main/java/net/sf/jabref/gui/JabRefFrame.java | 2 +- src/main/resources/l10n/Menu_da.properties | 2 +- src/main/resources/l10n/Menu_de.properties | 2 +- src/main/resources/l10n/Menu_en.properties | 2 +- src/main/resources/l10n/Menu_es.properties | 2 +- src/main/resources/l10n/Menu_fa.properties | 2 +- src/main/resources/l10n/Menu_fr.properties | 2 +- src/main/resources/l10n/Menu_in.properties | 2 +- src/main/resources/l10n/Menu_it.properties | 2 +- src/main/resources/l10n/Menu_ja.properties | 2 +- src/main/resources/l10n/Menu_nl.properties | 2 +- src/main/resources/l10n/Menu_no.properties | 2 +- src/main/resources/l10n/Menu_pt_BR.properties | 2 +- src/main/resources/l10n/Menu_ru.properties | 2 +- src/main/resources/l10n/Menu_sv.properties | 2 +- src/main/resources/l10n/Menu_tr.properties | 2 +- src/main/resources/l10n/Menu_vi.properties | 2 +- src/main/resources/l10n/Menu_zh.properties | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/JabRefFrame.java b/src/main/java/net/sf/jabref/gui/JabRefFrame.java index b97af960413..8bdb23bf391 100644 --- a/src/main/java/net/sf/jabref/gui/JabRefFrame.java +++ b/src/main/java/net/sf/jabref/gui/JabRefFrame.java @@ -438,7 +438,7 @@ public void actionPerformed(ActionEvent e) { IconTheme.JabRefIcon.MERGE_ENTRIES.getIcon()); private final AbstractAction downloadFullText = new GeneralAction(Actions.DOWNLOAD_FULL_TEXT, - Localization.menuTitle("Look up full text document"), + Localization.menuTitle("Look up full text documents"), Localization.lang("Follow DOI or URL link and try to locate PDF full text document")); private final AbstractAction increaseFontSize = new IncreaseTableFontSizeAction(); private final AbstractAction decreseFontSize = new DecreaseTableFontSizeAction(); diff --git a/src/main/resources/l10n/Menu_da.properties b/src/main/resources/l10n/Menu_da.properties index ae8a38436c0..e9997224c01 100644 --- a/src/main/resources/l10n/Menu_da.properties +++ b/src/main/resources/l10n/Menu_da.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=For&mindsk_fontstørrelse_i_hovedtabel Forward=Frem Back=Tilbage -Look_up_full_text_document=&Hent_tekstdokument +Look_up_full_text_documents= Set/clear/rename_fields=Udfyld/ryd/omdøb_felter Resolve_duplicate_BibTeX_keys=Udred_dublerede_BibTeX-nøgler diff --git a/src/main/resources/l10n/Menu_de.properties b/src/main/resources/l10n/Menu_de.properties index 30072351df7..427c34bebb8 100644 --- a/src/main/resources/l10n/Menu_de.properties +++ b/src/main/resources/l10n/Menu_de.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=Schriftgröße_in_der_Tabelle_verkleinern Forward=Vor Back=Zurück -Look_up_full_text_document=Volltext-Dokument_suchen +Look_up_full_text_documents=Volltext-Dokumente_suchen Set/clear/rename_fields=Felder_setzen/löschen/umbenennen Resolve_duplicate_BibTeX_keys=Doppelte_BibTeX-Keys_beseitigen diff --git a/src/main/resources/l10n/Menu_en.properties b/src/main/resources/l10n/Menu_en.properties index 767ca25869b..3fe31aeb1f7 100644 --- a/src/main/resources/l10n/Menu_en.properties +++ b/src/main/resources/l10n/Menu_en.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=&Decrease_table_font_size Forward=Forward Back=Back -Look_up_full_text_document=Look_up_full_text_document +Look_up_full_text_documents=Look_up_full_text_documents Set/clear/rename_fields=Set/clear/rename_fields Resolve_duplicate_BibTeX_keys=Resolve_duplicate_BibTeX_keys diff --git a/src/main/resources/l10n/Menu_es.properties b/src/main/resources/l10n/Menu_es.properties index 8227a959cce..8c01f6b7d7d 100644 --- a/src/main/resources/l10n/Menu_es.properties +++ b/src/main/resources/l10n/Menu_es.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=&Disminuir_tama\u00f1o_de_fuente_en_tabla Forward=Avanzar Back=Retroceder -Look_up_full_text_document=Buscar_en_todo_el_texto_del_documento +Look_up_full_text_documents= Set/clear/rename_fields=Establecer/limpiar/renombrar_campos Resolve_duplicate_BibTeX_keys=Resolver_claves_BibTeX_duplicadas diff --git a/src/main/resources/l10n/Menu_fa.properties b/src/main/resources/l10n/Menu_fa.properties index 46118e0659b..46549a9c1db 100644 --- a/src/main/resources/l10n/Menu_fa.properties +++ b/src/main/resources/l10n/Menu_fa.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=کاهش_اندازه‌ی_قلم_جدول Forward=بعد Back=قبل -Look_up_full_text_document=جستجوی_همه‌ی_متن_سند +Look_up_full_text_documents= Set/clear/rename_fields=تنظیم/حذف/تغییرنام_حوزه‌ها Resolve_duplicate_BibTeX_keys=حل_کلیدهای_تکراری_BibTeX diff --git a/src/main/resources/l10n/Menu_fr.properties b/src/main/resources/l10n/Menu_fr.properties index c4ea61f324c..a42f57282da 100644 --- a/src/main/resources/l10n/Menu_fr.properties +++ b/src/main/resources/l10n/Menu_fr.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=&Diminuer_la_taille_de_police_de_la_table Forward=Suivant Back=Précédent -Look_up_full_text_document=Télécharger_le_document_cité +Look_up_full_text_documents=Télécharger_les_documents_cité Set/clear/rename_fields=Configurer/vider/renommer_des_champs Resolve_duplicate_BibTeX_keys=Traitement_des_clefs_BibTeX_dupliquées diff --git a/src/main/resources/l10n/Menu_in.properties b/src/main/resources/l10n/Menu_in.properties index a28429aa1ff..db7368bdf6b 100644 --- a/src/main/resources/l10n/Menu_in.properties +++ b/src/main/resources/l10n/Menu_in.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=Kecilkan_ukuran_huruf_tabel Forward=Maju Back=Mundur -Look_up_full_text_document=Lihat_dokumen_teks_lengkap +Look_up_full_text_documents= Set/clear/rename_fields=Tetapkan/bersihkan/namai_bidang Resolve_duplicate_BibTeX_keys=Menyelesaikan_kesamaan_kunci_BibTeX diff --git a/src/main/resources/l10n/Menu_it.properties b/src/main/resources/l10n/Menu_it.properties index 98819f573f1..a3964ccda9e 100644 --- a/src/main/resources/l10n/Menu_it.properties +++ b/src/main/resources/l10n/Menu_it.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=&Diminuisci_la_dimensione_dei_caratteri_della_tabella Forward=Seguente Back=Precedente -Look_up_full_text_document=Scarica_il_documento_citato +Look_up_full_text_documents= Set/clear/rename_fields=Imposta_/_svuota_/_rinomina_i_campi Resolve_duplicate_BibTeX_keys=Risolvi_le_chiavi_BibTeX_duplicate diff --git a/src/main/resources/l10n/Menu_ja.properties b/src/main/resources/l10n/Menu_ja.properties index b11adcf82a3..e661816290c 100644 --- a/src/main/resources/l10n/Menu_ja.properties +++ b/src/main/resources/l10n/Menu_ja.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=表フォントを縮小(&D) Forward=進む Back=戻る -Look_up_full_text_document=平文文書全体を検索 +Look_up_full_text_documents= Set/clear/rename_fields=フィールドを設定/クリア/名称変更 Resolve_duplicate_BibTeX_keys=重複したBibTeX鍵を解消する diff --git a/src/main/resources/l10n/Menu_nl.properties b/src/main/resources/l10n/Menu_nl.properties index d11ea50c1f6..1f4046c9da5 100644 --- a/src/main/resources/l10n/Menu_nl.properties +++ b/src/main/resources/l10n/Menu_nl.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=Tabel_font_kleiner_maken Forward=Verder Back=Terug -Look_up_full_text_document=Full-text-document_opzoeken +Look_up_full_text_documents= Set/clear/rename_fields=Instellen/wissen/hernoemen_van_velden Resolve_duplicate_BibTeX_keys=Dubbele_BibTeX_steutels_aanpakken diff --git a/src/main/resources/l10n/Menu_no.properties b/src/main/resources/l10n/Menu_no.properties index cbf84465d4e..bb3f6139329 100644 --- a/src/main/resources/l10n/Menu_no.properties +++ b/src/main/resources/l10n/Menu_no.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=Reduser_størrelse_på_tabellfont Forward=Fram Back=Tilbake -Look_up_full_text_document=Finn_fulltekstdokument +Look_up_full_text_documents= Set/clear/rename_fields=Sett/slett/endre_navn_på_felter Resolve_duplicate_BibTeX_keys=Søk_etter_dupliserte_BibTeX-nøkler diff --git a/src/main/resources/l10n/Menu_pt_BR.properties b/src/main/resources/l10n/Menu_pt_BR.properties index 3acf83e146c..b887ec43df2 100644 --- a/src/main/resources/l10n/Menu_pt_BR.properties +++ b/src/main/resources/l10n/Menu_pt_BR.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=&Diminuir_tamanho_da_fonte_da_tabela Forward=Avançar Back=Voltar -Look_up_full_text_document=Pesquiar_pelo_documento_de_texto_completo +Look_up_full_text_documents= Set/clear/rename_fields=Definir/Limpar/Renomear_campos Resolve_duplicate_BibTeX_keys=Resolver_chaves_BibTeX_duplicadas diff --git a/src/main/resources/l10n/Menu_ru.properties b/src/main/resources/l10n/Menu_ru.properties index 4f59f50bf51..05866d905c1 100644 --- a/src/main/resources/l10n/Menu_ru.properties +++ b/src/main/resources/l10n/Menu_ru.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=Уменьшить_шрифт_в_таблице Forward=Вперед Back=Назад -Look_up_full_text_document=Поиск_цитируемого_документа +Look_up_full_text_documents= Set/clear/rename_fields=Задать/очистить/переименовать_поля Resolve_duplicate_BibTeX_keys=Разрешение_дубликатов_ключей_BibTeX diff --git a/src/main/resources/l10n/Menu_sv.properties b/src/main/resources/l10n/Menu_sv.properties index 7c6d1224070..ba8c6dd84fe 100644 --- a/src/main/resources/l10n/Menu_sv.properties +++ b/src/main/resources/l10n/Menu_sv.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=&Minska_typsnittsstorlek_i_tabellen Forward=&Framåt Back=&Bakåt -Look_up_full_text_document=Leta_reda_på_fulltextdokument +Look_up_full_text_documents= Set/clear/rename_fields=Sätt/rensa/byt_namn_på_fält Resolve_duplicate_BibTeX_keys=Hantera_BibTeX-nyckeldubbletter diff --git a/src/main/resources/l10n/Menu_tr.properties b/src/main/resources/l10n/Menu_tr.properties index efb18486011..a841a0fc076 100644 --- a/src/main/resources/l10n/Menu_tr.properties +++ b/src/main/resources/l10n/Menu_tr.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=Tablo_yazıtipi_boyutunu_azalt Forward=İleri Back=Geri -Look_up_full_text_document=Tam_metin_belge_bul +Look_up_full_text_documents= Set/clear/rename_fields=Alanları_ata/sil/yeniden_adlandır Resolve_duplicate_BibTeX_keys=Çifte_BibTeX_anahtarlarını_çözümle diff --git a/src/main/resources/l10n/Menu_vi.properties b/src/main/resources/l10n/Menu_vi.properties index 92df7585e46..c828624f4da 100644 --- a/src/main/resources/l10n/Menu_vi.properties +++ b/src/main/resources/l10n/Menu_vi.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=Giảm_kích_thước_phông_của_bảng Forward=Tới Back=Lui -Look_up_full_text_document=Tìm_tài_liệu_đầy_đủ +Look_up_full_text_documents= Set/clear/rename_fields=Thiết_lập/Xóa/Đổi_tên_trường Resolve_duplicate_BibTeX_keys=Giải_quyết_khóa_Bibtex_bị_lặp_lại diff --git a/src/main/resources/l10n/Menu_zh.properties b/src/main/resources/l10n/Menu_zh.properties index 1d12a19306a..14627773996 100644 --- a/src/main/resources/l10n/Menu_zh.properties +++ b/src/main/resources/l10n/Menu_zh.properties @@ -104,7 +104,7 @@ Decrease_table_font_size=缩小列表字体_(&D) Forward=前进 Back=后退 -Look_up_full_text_document=查找完整文档 +Look_up_full_text_documents= Set/clear/rename_fields=设置/清除/重命名_域 Resolve_duplicate_BibTeX_keys=处理重复的_BibTeX_键值 From 2f4735ea79cf18f72e1b709cb44e5b9530a80a59 Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Wed, 7 Dec 2016 16:42:09 +0100 Subject: [PATCH 2/7] Warn if there are no documents selected for fulltext retrieval and fix some related UI issues --- .../gui/externalfiles/FindFullTextAction.java | 16 +++++++++++++++- src/main/resources/l10n/JabRef_da.properties | 3 +++ src/main/resources/l10n/JabRef_de.properties | 3 +++ src/main/resources/l10n/JabRef_en.properties | 3 +++ src/main/resources/l10n/JabRef_es.properties | 3 +++ src/main/resources/l10n/JabRef_fa.properties | 3 +++ src/main/resources/l10n/JabRef_fr.properties | 3 +++ src/main/resources/l10n/JabRef_in.properties | 3 +++ src/main/resources/l10n/JabRef_it.properties | 3 +++ src/main/resources/l10n/JabRef_ja.properties | 3 +++ src/main/resources/l10n/JabRef_nl.properties | 3 +++ src/main/resources/l10n/JabRef_no.properties | 3 +++ src/main/resources/l10n/JabRef_pt_BR.properties | 3 +++ src/main/resources/l10n/JabRef_ru.properties | 3 +++ src/main/resources/l10n/JabRef_sv.properties | 3 +++ src/main/resources/l10n/JabRef_tr.properties | 3 +++ src/main/resources/l10n/JabRef_vi.properties | 3 +++ src/main/resources/l10n/JabRef_zh.properties | 3 +++ 18 files changed, 66 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java index 53779dad0a9..bfa72af44be 100644 --- a/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java @@ -41,12 +41,26 @@ public FindFullTextAction(BasePanel basePanel) { @Override public void init() throws Exception { + if (basePanel.getSelectedEntries().size() == 0) { + JOptionPane.showMessageDialog( + basePanel, + "Select at least one entry to perform this operation", + "No entry selected", + JOptionPane.ERROR_MESSAGE); + return; + } basePanel.output(Localization.lang("Looking for full text document...")); } @Override public void run() { - if (basePanel.getSelectedEntries().size() >= warningLimit) { + int numberOfSelectedEntries = basePanel.getSelectedEntries().size(); + + if (numberOfSelectedEntries == 0) { + return; + } + + if (numberOfSelectedEntries >= warningLimit) { String[] options = new String[]{Localization.lang("Look up full text documents"), Localization.lang("Cancel")}; int answer = JOptionPane.showOptionDialog(basePanel.frame(), Localization.lang( diff --git a/src/main/resources/l10n/JabRef_da.properties b/src/main/resources/l10n/JabRef_da.properties index 8ba8e3639b3..964b07b43f9 100644 --- a/src/main/resources/l10n/JabRef_da.properties +++ b/src/main/resources/l10n/JabRef_da.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_de.properties b/src/main/resources/l10n/JabRef_de.properties index 48505320494..11139621f33 100644 --- a/src/main/resources/l10n/JabRef_de.properties +++ b/src/main/resources/l10n/JabRef_de.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 9e7a6ed6ffa..180305daf6f 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web=Update_with_bibliographic_inf Could_not_find_any_bibliographic_information.=Could_not_find_any_bibliographic_information. BibTeX_key_%0_deviates_from_generated_key_%1=BibTeX_key_%0_deviates_from_generated_key_%1 DOI_%0_is_invalid=DOI_%0_is_invalid + +Select_at_least_one_entry_to_perform_this_operation=Select_at_least_one_entry_to_perform_this_operation +No_entry_selected=No_entry_selected diff --git a/src/main/resources/l10n/JabRef_es.properties b/src/main/resources/l10n/JabRef_es.properties index aeffda0bff4..fef9780014c 100644 --- a/src/main/resources/l10n/JabRef_es.properties +++ b/src/main/resources/l10n/JabRef_es.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_fa.properties b/src/main/resources/l10n/JabRef_fa.properties index d6295952d50..f9bb32a50ae 100644 --- a/src/main/resources/l10n/JabRef_fa.properties +++ b/src/main/resources/l10n/JabRef_fa.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index 1e74ba40b34..95aac65ea5b 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_in.properties b/src/main/resources/l10n/JabRef_in.properties index bb56ff5764b..b8b88f1d557 100644 --- a/src/main/resources/l10n/JabRef_in.properties +++ b/src/main/resources/l10n/JabRef_in.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index bb545415d21..81a98bedfd6 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web=Aggiorna_con_informazioni_bib Could_not_find_any_bibliographic_information.=Non_ho_trovato_informazioni_bibliografiche. BibTeX_key_%0_deviates_from_generated_key_%1=Chiave_BibTeX_%0_diversa_dalla_chiave_generata_%1 DOI_%0_is_invalid=DOI_%0_non_valido + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_ja.properties b/src/main/resources/l10n/JabRef_ja.properties index b168c2b41b3..1e1385672ab 100644 --- a/src/main/resources/l10n/JabRef_ja.properties +++ b/src/main/resources/l10n/JabRef_ja.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index 947c76c719c..ff3ee0496ee 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_no.properties b/src/main/resources/l10n/JabRef_no.properties index 32f22c80320..48012403013 100644 --- a/src/main/resources/l10n/JabRef_no.properties +++ b/src/main/resources/l10n/JabRef_no.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index a8befa87c55..31d360def2e 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_ru.properties b/src/main/resources/l10n/JabRef_ru.properties index 22ff4340947..a0772dbf3f6 100644 --- a/src/main/resources/l10n/JabRef_ru.properties +++ b/src/main/resources/l10n/JabRef_ru.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_sv.properties b/src/main/resources/l10n/JabRef_sv.properties index 77e4af9791f..65c773ebb1f 100644 --- a/src/main/resources/l10n/JabRef_sv.properties +++ b/src/main/resources/l10n/JabRef_sv.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_tr.properties b/src/main/resources/l10n/JabRef_tr.properties index a1af574fffc..5908082e10e 100644 --- a/src/main/resources/l10n/JabRef_tr.properties +++ b/src/main/resources/l10n/JabRef_tr.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_vi.properties b/src/main/resources/l10n/JabRef_vi.properties index 0b97eb3144c..36359a11ec0 100644 --- a/src/main/resources/l10n/JabRef_vi.properties +++ b/src/main/resources/l10n/JabRef_vi.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_zh.properties b/src/main/resources/l10n/JabRef_zh.properties index 4351cfe22c5..7061ba296f7 100644 --- a/src/main/resources/l10n/JabRef_zh.properties +++ b/src/main/resources/l10n/JabRef_zh.properties @@ -2309,3 +2309,6 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= + +Select_at_least_one_entry_to_perform_this_operation= +No_entry_selected= From 61e04ccf0f354685d490580d4d2de3b7be612367 Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Wed, 7 Dec 2016 17:10:41 +0100 Subject: [PATCH 3/7] Fix layout of file dialog and increase size of file path significantly --- .../jabref/gui/filelist/FileListEntryEditor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/filelist/FileListEntryEditor.java b/src/main/java/net/sf/jabref/gui/filelist/FileListEntryEditor.java index e38af801b9c..3359e6d111c 100644 --- a/src/main/java/net/sf/jabref/gui/filelist/FileListEntryEditor.java +++ b/src/main/java/net/sf/jabref/gui/filelist/FileListEntryEditor.java @@ -115,11 +115,13 @@ public FileListEntryEditor(JabRefFrame frame, FileListEntry entry, boolean showP } }); - FormBuilder builder = FormBuilder.create().layout(new FormLayout( - "left:pref, 4dlu, fill:150dlu, 4dlu, fill:pref, 4dlu, fill:pref", "p, 2dlu, p, 2dlu, p")); + FormLayout fileDialog = new FormLayout( + "left:pref, 4dlu, fill:400dlu, 4dlu, fill:pref, 4dlu, fill:pref", + "p, 8dlu, p, 8dlu, p" + ); + FormBuilder builder = FormBuilder.create().layout(fileDialog); builder.add(Localization.lang("Link")).xy(1, 1); builder.add(link).xy(3, 1); - //final BrowseListener browse = new BrowseListener(frame, link); //TODO: Maybe use browse action final JButton browseBut = new JButton(Localization.lang("Browse")); browseBut.addActionListener(browsePressed); @@ -129,10 +131,10 @@ public FileListEntryEditor(JabRefFrame frame, FileListEntry entry, boolean showP builder.add(open).xy(7, 1); } builder.add(Localization.lang("Description")).xy(1, 3); - builder.add(description).xyw(3, 3, 3); + builder.add(description).xyw(3, 3, 5); builder.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); builder.add(Localization.lang("File type")).xy(1, 5); - builder.add(types).xyw(3, 5, 3); + builder.add(types).xyw(3, 5, 5); if (showProgressBar) { builder.appendRows("2dlu, p"); builder.add(downloadLabel).xy(1, 7); @@ -156,7 +158,6 @@ public FileListEntryEditor(JabRefFrame frame, FileListEntry entry, boolean showP open.addActionListener(e -> openFile()); AbstractAction cancelAction = new AbstractAction() { - @Override public void actionPerformed(ActionEvent e) { diag.dispose(); @@ -331,7 +332,6 @@ private void storeSettings(FileListEntry listEntry) { public boolean okPressed() { return okPressed; - } private final ActionListener browsePressed = e -> { From dd963f90c2b183adafc302578d7adfecf2e72640 Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Wed, 7 Dec 2016 17:15:51 +0100 Subject: [PATCH 4/7] Reuse description as tooltip, old tooltip is not really accurate anymore --- src/main/java/net/sf/jabref/gui/JabRefFrame.java | 2 +- src/main/resources/l10n/JabRef_da.properties | 1 - src/main/resources/l10n/JabRef_de.properties | 1 - src/main/resources/l10n/JabRef_en.properties | 1 - src/main/resources/l10n/JabRef_es.properties | 1 - src/main/resources/l10n/JabRef_fa.properties | 1 - src/main/resources/l10n/JabRef_fr.properties | 1 - src/main/resources/l10n/JabRef_in.properties | 1 - src/main/resources/l10n/JabRef_it.properties | 1 - src/main/resources/l10n/JabRef_ja.properties | 1 - src/main/resources/l10n/JabRef_nl.properties | 1 - src/main/resources/l10n/JabRef_no.properties | 1 - src/main/resources/l10n/JabRef_pt_BR.properties | 1 - src/main/resources/l10n/JabRef_ru.properties | 1 - src/main/resources/l10n/JabRef_sv.properties | 1 - src/main/resources/l10n/JabRef_tr.properties | 1 - src/main/resources/l10n/JabRef_vi.properties | 1 - src/main/resources/l10n/JabRef_zh.properties | 1 - 18 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/JabRefFrame.java b/src/main/java/net/sf/jabref/gui/JabRefFrame.java index 8bdb23bf391..a89f32454ff 100644 --- a/src/main/java/net/sf/jabref/gui/JabRefFrame.java +++ b/src/main/java/net/sf/jabref/gui/JabRefFrame.java @@ -439,7 +439,7 @@ public void actionPerformed(ActionEvent e) { private final AbstractAction downloadFullText = new GeneralAction(Actions.DOWNLOAD_FULL_TEXT, Localization.menuTitle("Look up full text documents"), - Localization.lang("Follow DOI or URL link and try to locate PDF full text document")); + Localization.lang("Look up full text documents")); private final AbstractAction increaseFontSize = new IncreaseTableFontSizeAction(); private final AbstractAction decreseFontSize = new DecreaseTableFontSizeAction(); private final AbstractAction resolveDuplicateKeys = new GeneralAction(Actions.RESOLVE_DUPLICATE_KEYS, diff --git a/src/main/resources/l10n/JabRef_da.properties b/src/main/resources/l10n/JabRef_da.properties index 964b07b43f9..fa37e642eef 100644 --- a/src/main/resources/l10n/JabRef_da.properties +++ b/src/main/resources/l10n/JabRef_da.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format= Help_on_Name_Formatting= Add_new_file_type= -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document= Left_entry= Right_entry= diff --git a/src/main/resources/l10n/JabRef_de.properties b/src/main/resources/l10n/JabRef_de.properties index 11139621f33..c001c2eb712 100644 --- a/src/main/resources/l10n/JabRef_de.properties +++ b/src/main/resources/l10n/JabRef_de.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=Normalisiere_ins_BibTeX-Namensformat Help_on_Name_Formatting=Hilfe_zur_Namensformatierung Add_new_file_type=Füge_neuen_Dateityp_hinzu -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=Folge_DOI/URL-Link_um_ein_PDF-Volltextdokument_zu_finden Left_entry=Linker_Eintrag Right_entry=Rechter_Eintrag diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 180305daf6f..8c8dce1dae6 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=Normalize_to_BibTeX_name_format Help_on_Name_Formatting=Help_on_Name_Formatting Add_new_file_type=Add_new_file_type -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document Left_entry=Left_entry Right_entry=Right_entry diff --git a/src/main/resources/l10n/JabRef_es.properties b/src/main/resources/l10n/JabRef_es.properties index fef9780014c..d9de08a09bc 100644 --- a/src/main/resources/l10n/JabRef_es.properties +++ b/src/main/resources/l10n/JabRef_es.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=Normalizar_a_formato_de_nombre_BibTeX Help_on_Name_Formatting=Ayuda_en_Formateo_de_Nombres Add_new_file_type=Añadir_un_nuevo_tipo_de_archivo -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=Seguir_DOI_o_URL_e_intentar_encontrar_PDF_de_texto_completo Left_entry=Entrada_izquierda Right_entry=Entrada_derecha diff --git a/src/main/resources/l10n/JabRef_fa.properties b/src/main/resources/l10n/JabRef_fa.properties index f9bb32a50ae..65d8013c442 100644 --- a/src/main/resources/l10n/JabRef_fa.properties +++ b/src/main/resources/l10n/JabRef_fa.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format= Help_on_Name_Formatting= Add_new_file_type= -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document= Left_entry= Right_entry= diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index 95aac65ea5b..fd7b5f3ccfc 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=Normaliser_au_format_de_nom_BibTeX Help_on_Name_Formatting=Aide_sur_le_formatage_des_noms Add_new_file_type=Ajouter_un_nouveau_type_de_fichier -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=Suivre_le_DOI_ou_le_lien_URL,_et_essayer_de_trouver_le_document_complet_en_PDF Left_entry=Entrée_de_gauche Right_entry=Entrée_de_droite diff --git a/src/main/resources/l10n/JabRef_in.properties b/src/main/resources/l10n/JabRef_in.properties index b8b88f1d557..b61f671cea1 100644 --- a/src/main/resources/l10n/JabRef_in.properties +++ b/src/main/resources/l10n/JabRef_in.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format= Help_on_Name_Formatting= Add_new_file_type=Tambahkan_tipe_berkas_yang_baru -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=Ikut_DOI_atau_URL_dan_coba_melokasikan_dokumen_PDF_teks_penuh Left_entry= Right_entry= diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index 81a98bedfd6..6090d3c5fe6 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=Normalizza_al_formato_di_nome_di_BibTeX Help_on_Name_Formatting=Aiuto_sulla_Formattazione_dei_Nomi Add_new_file_type=Aggiungi_un_nuovo_tipo_di_file -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=Segue_il_link_DOI_o_URL_e_cerca_di_localizzare_il_documento_PDF_completo Left_entry=Voce_di_sinistra Right_entry=Voce_di_destra diff --git a/src/main/resources/l10n/JabRef_ja.properties b/src/main/resources/l10n/JabRef_ja.properties index 1e1385672ab..d970133e975 100644 --- a/src/main/resources/l10n/JabRef_ja.properties +++ b/src/main/resources/l10n/JabRef_ja.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=BibTeXの名前書式に標準化 Help_on_Name_Formatting=名前の書式に関するヘルプ Add_new_file_type=新規ファイル形式を追加 -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=DOIまたはURLリンクをたどってPDF文書本体の場所を探してください Left_entry=左側の項目 Right_entry=右側の項目 diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index ff3ee0496ee..42db6d9868f 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format= Help_on_Name_Formatting= Add_new_file_type= -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document= Left_entry= Right_entry= diff --git a/src/main/resources/l10n/JabRef_no.properties b/src/main/resources/l10n/JabRef_no.properties index 48012403013..5d19c5519a7 100644 --- a/src/main/resources/l10n/JabRef_no.properties +++ b/src/main/resources/l10n/JabRef_no.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format= Help_on_Name_Formatting= Add_new_file_type= -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document= Left_entry= Right_entry= diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index 31d360def2e..839ea03e0d6 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=Normalizar para o formato_de_nome_do_BibTeX Help_on_Name_Formatting=Ajuda_na_formatação_do_nome Add_new_file_type=Adicionar_novo_tipo_de_arquivo -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document= Left_entry= Right_entry= diff --git a/src/main/resources/l10n/JabRef_ru.properties b/src/main/resources/l10n/JabRef_ru.properties index a0772dbf3f6..aa8582f28de 100644 --- a/src/main/resources/l10n/JabRef_ru.properties +++ b/src/main/resources/l10n/JabRef_ru.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=Нормализовать_в_формат_им Help_on_Name_Formatting=Справка_по_форматированию_имен Add_new_file_type=Добавить_новый_тип_файлов -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=Перейдите_по_ссылке_для_DOI_или_URL-адреса,_чтобы_найти_полный_текст_документа_в_формате_PDF Left_entry=Запись_слева Right_entry=Запись_справа diff --git a/src/main/resources/l10n/JabRef_sv.properties b/src/main/resources/l10n/JabRef_sv.properties index 65c773ebb1f..7d654420ce3 100644 --- a/src/main/resources/l10n/JabRef_sv.properties +++ b/src/main/resources/l10n/JabRef_sv.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format= Help_on_Name_Formatting=Hjälp_för_namnformattering Add_new_file_type=Lägg_till_ny_filtyp -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=Följ_DOI_eller_URL_och_försök_hitta_en_PDF-version_av_dokumentet Left_entry=Vänster_post Right_entry=Höger_post diff --git a/src/main/resources/l10n/JabRef_tr.properties b/src/main/resources/l10n/JabRef_tr.properties index 5908082e10e..e2f5599892f 100644 --- a/src/main/resources/l10n/JabRef_tr.properties +++ b/src/main/resources/l10n/JabRef_tr.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format=BibTeX_adı_biçimine_normalleştir Help_on_Name_Formatting=İsim_Biçimlemede_Yardım Add_new_file_type=Yeni_dosya_türü_ekle -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document=DOI_ya_da_URL_linikini_izle_ve_PDF_tam_metin_belgesini_bulmaya_çalış Left_entry=Sol_girdi Right_entry=Sağ_girdi diff --git a/src/main/resources/l10n/JabRef_vi.properties b/src/main/resources/l10n/JabRef_vi.properties index 36359a11ec0..19d5600a014 100644 --- a/src/main/resources/l10n/JabRef_vi.properties +++ b/src/main/resources/l10n/JabRef_vi.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format= Help_on_Name_Formatting= Add_new_file_type= -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document= Left_entry= Right_entry= diff --git a/src/main/resources/l10n/JabRef_zh.properties b/src/main/resources/l10n/JabRef_zh.properties index 7061ba296f7..babab06d79a 100644 --- a/src/main/resources/l10n/JabRef_zh.properties +++ b/src/main/resources/l10n/JabRef_zh.properties @@ -1858,7 +1858,6 @@ Normalize_to_BibTeX_name_format= Help_on_Name_Formatting= Add_new_file_type= -Follow_DOI_or_URL_link_and_try_to_locate_PDF_full_text_document= Left_entry= Right_entry= From 3cd3f895de85543296155e082e694176ab650f86 Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Wed, 7 Dec 2016 17:28:28 +0100 Subject: [PATCH 5/7] Use translation --- .../net/sf/jabref/gui/externalfiles/FindFullTextAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java index bfa72af44be..bcf7ee89426 100644 --- a/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java @@ -44,8 +44,8 @@ public void init() throws Exception { if (basePanel.getSelectedEntries().size() == 0) { JOptionPane.showMessageDialog( basePanel, - "Select at least one entry to perform this operation", - "No entry selected", + Localization.lang("Select at least one entry to perform this operation"), + Localization.lang("No entry selected"), JOptionPane.ERROR_MESSAGE); return; } From 020de78d053be03456d3375f1f4a82a2acd400a5 Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Thu, 8 Dec 2016 11:01:18 +0100 Subject: [PATCH 6/7] Do not warn user just disable menu item for entry selection <= 0 --- .../java/net/sf/jabref/gui/JabRefFrame.java | 14 ++++++++++---- .../gui/externalfiles/FindFullTextAction.java | 18 +++--------------- src/main/resources/l10n/JabRef_da.properties | 3 --- src/main/resources/l10n/JabRef_de.properties | 3 --- src/main/resources/l10n/JabRef_en.properties | 2 -- src/main/resources/l10n/JabRef_es.properties | 2 -- src/main/resources/l10n/JabRef_fa.properties | 2 -- src/main/resources/l10n/JabRef_fr.properties | 2 -- src/main/resources/l10n/JabRef_in.properties | 2 -- src/main/resources/l10n/JabRef_it.properties | 2 -- src/main/resources/l10n/JabRef_ja.properties | 2 -- src/main/resources/l10n/JabRef_nl.properties | 2 -- src/main/resources/l10n/JabRef_no.properties | 2 -- .../resources/l10n/JabRef_pt_BR.properties | 2 -- src/main/resources/l10n/JabRef_ru.properties | 2 -- src/main/resources/l10n/JabRef_sv.properties | 2 -- src/main/resources/l10n/JabRef_tr.properties | 2 -- src/main/resources/l10n/JabRef_vi.properties | 2 -- src/main/resources/l10n/JabRef_zh.properties | 2 -- 19 files changed, 13 insertions(+), 55 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/JabRefFrame.java b/src/main/java/net/sf/jabref/gui/JabRefFrame.java index a89f32454ff..0d0af2da5cf 100644 --- a/src/main/java/net/sf/jabref/gui/JabRefFrame.java +++ b/src/main/java/net/sf/jabref/gui/JabRefFrame.java @@ -440,6 +440,7 @@ public void actionPerformed(ActionEvent e) { private final AbstractAction downloadFullText = new GeneralAction(Actions.DOWNLOAD_FULL_TEXT, Localization.menuTitle("Look up full text documents"), Localization.lang("Look up full text documents")); + private final AbstractAction increaseFontSize = new IncreaseTableFontSizeAction(); private final AbstractAction decreseFontSize = new DecreaseTableFontSizeAction(); private final AbstractAction resolveDuplicateKeys = new GeneralAction(Actions.RESOLVE_DUPLICATE_KEYS, @@ -494,7 +495,7 @@ public void actionPerformed(ActionEvent e) { private final List oneEntryWithFileOnlyActions = new LinkedList<>(); private final List oneEntryWithURLorDOIOnlyActions = new LinkedList<>(); private final List twoEntriesOnlyActions = new LinkedList<>(); - + private final List oneOrMoreEntriesActions = new LinkedList<>(); private class EditModeAction extends AbstractAction { @@ -536,7 +537,6 @@ public void actionPerformed(ActionEvent evt) { public JabRefFrame() { init(); updateEnabledState(); - } private List getNewEntryActions() { @@ -1528,6 +1528,9 @@ dupliCheck, autoSetFile, newEntryAction, newSpec, customizeAction, plainTextImpo twoEntriesOnlyActions.clear(); twoEntriesOnlyActions.addAll(Arrays.asList(mergeEntries)); + oneOrMoreEntriesActions.clear(); + oneOrMoreEntriesActions.addAll(Arrays.asList(downloadFullText)); + tabbedPane.addChangeListener(event -> updateEnabledState()); } @@ -1572,12 +1575,12 @@ public void updateEnabledState() { getForwardAction().setEnabled(false); setEnabled(openAndSavedDatabasesOnlyActions, false); setEnabled(sharedDatabaseOnlyActions, false); + setEnabled(oneEntryOnlyActions, false); } - if (tabCount > 0) { BasePanel current = getCurrentBasePanel(); - boolean saved = current.getBibDatabaseContext().getDatabaseFile().isPresent(); + boolean saved = current.getBibDatabaseContext().getDatabasePath().isPresent(); setEnabled(openAndSavedDatabasesOnlyActions, saved); boolean isShared = current.getBibDatabaseContext().getLocation() == DatabaseLocation.SHARED; @@ -1591,6 +1594,9 @@ public void updateEnabledState() { boolean twoEntriesSelected = current.getSelectedEntries().size() == 2; setEnabled(twoEntriesOnlyActions, twoEntriesSelected); + + boolean oneOrMoreEntriesSelected = current.getSelectedEntries().size() >= 1; + setEnabled(oneOrMoreEntriesActions, oneOrMoreEntriesSelected); } } diff --git a/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java index bcf7ee89426..fb5d4c34361 100644 --- a/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java @@ -41,26 +41,14 @@ public FindFullTextAction(BasePanel basePanel) { @Override public void init() throws Exception { - if (basePanel.getSelectedEntries().size() == 0) { - JOptionPane.showMessageDialog( - basePanel, - Localization.lang("Select at least one entry to perform this operation"), - Localization.lang("No entry selected"), - JOptionPane.ERROR_MESSAGE); - return; + if (basePanel.getSelectedEntries().size() > 0) { + basePanel.output(Localization.lang("Looking for full text document...")); } - basePanel.output(Localization.lang("Looking for full text document...")); } @Override public void run() { - int numberOfSelectedEntries = basePanel.getSelectedEntries().size(); - - if (numberOfSelectedEntries == 0) { - return; - } - - if (numberOfSelectedEntries >= warningLimit) { + if (basePanel.getSelectedEntries().size() >= warningLimit) { String[] options = new String[]{Localization.lang("Look up full text documents"), Localization.lang("Cancel")}; int answer = JOptionPane.showOptionDialog(basePanel.frame(), Localization.lang( diff --git a/src/main/resources/l10n/JabRef_da.properties b/src/main/resources/l10n/JabRef_da.properties index fa37e642eef..b5e6dcb1485 100644 --- a/src/main/resources/l10n/JabRef_da.properties +++ b/src/main/resources/l10n/JabRef_da.properties @@ -2308,6 +2308,3 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= - -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_de.properties b/src/main/resources/l10n/JabRef_de.properties index c001c2eb712..d163891cc4f 100644 --- a/src/main/resources/l10n/JabRef_de.properties +++ b/src/main/resources/l10n/JabRef_de.properties @@ -2308,6 +2308,3 @@ Update_with_bibliographic_information_from_the_web= Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= - -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 8c8dce1dae6..b0cb219d561 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.=Could_not_find_any_bibliographic_i BibTeX_key_%0_deviates_from_generated_key_%1=BibTeX_key_%0_deviates_from_generated_key_%1 DOI_%0_is_invalid=DOI_%0_is_invalid -Select_at_least_one_entry_to_perform_this_operation=Select_at_least_one_entry_to_perform_this_operation -No_entry_selected=No_entry_selected diff --git a/src/main/resources/l10n/JabRef_es.properties b/src/main/resources/l10n/JabRef_es.properties index d9de08a09bc..faff1606f08 100644 --- a/src/main/resources/l10n/JabRef_es.properties +++ b/src/main/resources/l10n/JabRef_es.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_fa.properties b/src/main/resources/l10n/JabRef_fa.properties index 65d8013c442..9077d38eb33 100644 --- a/src/main/resources/l10n/JabRef_fa.properties +++ b/src/main/resources/l10n/JabRef_fa.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index fd7b5f3ccfc..6ec485bc694 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_in.properties b/src/main/resources/l10n/JabRef_in.properties index b61f671cea1..6e71b43f923 100644 --- a/src/main/resources/l10n/JabRef_in.properties +++ b/src/main/resources/l10n/JabRef_in.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index 6090d3c5fe6..2390c776345 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.=Non_ho_trovato_informazioni_biblio BibTeX_key_%0_deviates_from_generated_key_%1=Chiave_BibTeX_%0_diversa_dalla_chiave_generata_%1 DOI_%0_is_invalid=DOI_%0_non_valido -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_ja.properties b/src/main/resources/l10n/JabRef_ja.properties index d970133e975..ff0593747fa 100644 --- a/src/main/resources/l10n/JabRef_ja.properties +++ b/src/main/resources/l10n/JabRef_ja.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index 42db6d9868f..5f06d87947c 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_no.properties b/src/main/resources/l10n/JabRef_no.properties index 5d19c5519a7..c26d7ad0107 100644 --- a/src/main/resources/l10n/JabRef_no.properties +++ b/src/main/resources/l10n/JabRef_no.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index 839ea03e0d6..d06044deb24 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_ru.properties b/src/main/resources/l10n/JabRef_ru.properties index aa8582f28de..d6206a0ac83 100644 --- a/src/main/resources/l10n/JabRef_ru.properties +++ b/src/main/resources/l10n/JabRef_ru.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_sv.properties b/src/main/resources/l10n/JabRef_sv.properties index 7d654420ce3..982fd13c4ad 100644 --- a/src/main/resources/l10n/JabRef_sv.properties +++ b/src/main/resources/l10n/JabRef_sv.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_tr.properties b/src/main/resources/l10n/JabRef_tr.properties index e2f5599892f..5ee1d5ceeed 100644 --- a/src/main/resources/l10n/JabRef_tr.properties +++ b/src/main/resources/l10n/JabRef_tr.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_vi.properties b/src/main/resources/l10n/JabRef_vi.properties index 19d5600a014..f6699eea415 100644 --- a/src/main/resources/l10n/JabRef_vi.properties +++ b/src/main/resources/l10n/JabRef_vi.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= diff --git a/src/main/resources/l10n/JabRef_zh.properties b/src/main/resources/l10n/JabRef_zh.properties index babab06d79a..f1578f3a34d 100644 --- a/src/main/resources/l10n/JabRef_zh.properties +++ b/src/main/resources/l10n/JabRef_zh.properties @@ -2309,5 +2309,3 @@ Could_not_find_any_bibliographic_information.= BibTeX_key_%0_deviates_from_generated_key_%1= DOI_%0_is_invalid= -Select_at_least_one_entry_to_perform_this_operation= -No_entry_selected= From e0d56f6d69fd82c7892296454b6bc653fd63c062 Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Thu, 8 Dec 2016 11:25:51 +0100 Subject: [PATCH 7/7] Syntactic sugar --- src/main/java/net/sf/jabref/gui/JabRefFrame.java | 10 +++++----- .../jabref/gui/externalfiles/FindFullTextAction.java | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/JabRefFrame.java b/src/main/java/net/sf/jabref/gui/JabRefFrame.java index 0d0af2da5cf..f0d69659e39 100644 --- a/src/main/java/net/sf/jabref/gui/JabRefFrame.java +++ b/src/main/java/net/sf/jabref/gui/JabRefFrame.java @@ -495,7 +495,7 @@ public void actionPerformed(ActionEvent e) { private final List oneEntryWithFileOnlyActions = new LinkedList<>(); private final List oneEntryWithURLorDOIOnlyActions = new LinkedList<>(); private final List twoEntriesOnlyActions = new LinkedList<>(); - private final List oneOrMoreEntriesActions = new LinkedList<>(); + private final List atLeastOneEntryActions = new LinkedList<>(); private class EditModeAction extends AbstractAction { @@ -1528,8 +1528,8 @@ dupliCheck, autoSetFile, newEntryAction, newSpec, customizeAction, plainTextImpo twoEntriesOnlyActions.clear(); twoEntriesOnlyActions.addAll(Arrays.asList(mergeEntries)); - oneOrMoreEntriesActions.clear(); - oneOrMoreEntriesActions.addAll(Arrays.asList(downloadFullText)); + atLeastOneEntryActions.clear(); + atLeastOneEntryActions.addAll(Arrays.asList(downloadFullText)); tabbedPane.addChangeListener(event -> updateEnabledState()); @@ -1595,8 +1595,8 @@ public void updateEnabledState() { boolean twoEntriesSelected = current.getSelectedEntries().size() == 2; setEnabled(twoEntriesOnlyActions, twoEntriesSelected); - boolean oneOrMoreEntriesSelected = current.getSelectedEntries().size() >= 1; - setEnabled(oneOrMoreEntriesActions, oneOrMoreEntriesSelected); + boolean atLeastOneEntrySelected = !current.getSelectedEntries().isEmpty(); + setEnabled(atLeastOneEntryActions, atLeastOneEntrySelected); } } diff --git a/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java index fb5d4c34361..a8c7d890888 100644 --- a/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/net/sf/jabref/gui/externalfiles/FindFullTextAction.java @@ -41,8 +41,10 @@ public FindFullTextAction(BasePanel basePanel) { @Override public void init() throws Exception { - if (basePanel.getSelectedEntries().size() > 0) { + if (!basePanel.getSelectedEntries().isEmpty()) { basePanel.output(Localization.lang("Looking for full text document...")); + } else { + LOGGER.debug("No entry selected for fulltext download."); } }