Skip to content

Commit

Permalink
Follow up for JabRef#1323 Batch Fulltext downloader (JabRef#2344)
Browse files Browse the repository at this point in the history
* Rename menu item to plural for finding full texts
* Fix layout of file dialog and increase size of file path significantly
* Reuse description as tooltip, old tooltip is not really accurate anymore
  • Loading branch information
stefan-kolb authored and tobiasdiez committed Dec 10, 2016
1 parent 1dce03f commit ff22214
Show file tree
Hide file tree
Showing 37 changed files with 56 additions and 48 deletions.
18 changes: 12 additions & 6 deletions src/main/java/net/sf/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,9 @@ 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.lang("Follow DOI or URL link and try to locate PDF full text document"));
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,
Expand Down Expand Up @@ -494,7 +495,7 @@ public void actionPerformed(ActionEvent e) {
private final List<Object> oneEntryWithFileOnlyActions = new LinkedList<>();
private final List<Object> oneEntryWithURLorDOIOnlyActions = new LinkedList<>();
private final List<Object> twoEntriesOnlyActions = new LinkedList<>();

private final List<Object> atLeastOneEntryActions = new LinkedList<>();

private class EditModeAction extends AbstractAction {

Expand Down Expand Up @@ -536,7 +537,6 @@ public void actionPerformed(ActionEvent evt) {
public JabRefFrame() {
init();
updateEnabledState();

}

private List<NewEntryAction> getNewEntryActions() {
Expand Down Expand Up @@ -1528,6 +1528,9 @@ dupliCheck, autoSetFile, newEntryAction, newSpec, customizeAction, plainTextImpo
twoEntriesOnlyActions.clear();
twoEntriesOnlyActions.addAll(Arrays.asList(mergeEntries));

atLeastOneEntryActions.clear();
atLeastOneEntryActions.addAll(Arrays.asList(downloadFullText));

tabbedPane.addChangeListener(event -> updateEnabledState());

}
Expand Down Expand Up @@ -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;
Expand All @@ -1591,6 +1594,9 @@ public void updateEnabledState() {

boolean twoEntriesSelected = current.getSelectedEntries().size() == 2;
setEnabled(twoEntriesOnlyActions, twoEntriesSelected);

boolean atLeastOneEntrySelected = !current.getSelectedEntries().isEmpty();
setEnabled(atLeastOneEntryActions, atLeastOneEntrySelected);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ public FindFullTextAction(BasePanel basePanel) {

@Override
public void init() throws Exception {
basePanel.output(Localization.lang("Looking for full text document..."));
if (!basePanel.getSelectedEntries().isEmpty()) {
basePanel.output(Localization.lang("Looking for full text document..."));
} else {
LOGGER.debug("No entry selected for fulltext download.");
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -331,7 +332,6 @@ private void storeSettings(FileListEntry listEntry) {

public boolean okPressed() {
return okPressed;

}

private final ActionListener browsePressed = e -> {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_in.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=右側の項目
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_no.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=Запись_справа
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_vi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -2311,3 +2310,4 @@ 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=

2 changes: 1 addition & 1 deletion src/main/resources/l10n/Menu_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/Menu_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/Menu_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/Menu_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/Menu_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/Menu_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/l10n/Menu_in.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit ff22214

Please sign in to comment.