From 4172fcdbcb83b0aedb836598463cc405b56e28c7 Mon Sep 17 00:00:00 2001 From: dimitra-karadima Date: Sun, 29 Mar 2020 17:41:30 +0300 Subject: [PATCH 01/11] Add tooltips for all entry types for #6074 Change: Add tooltips in the "Select entry type" dialog. You can see the tooltip when hovering a button of an entry type. --- .../java/org/jabref/gui/EntryTypeView.java | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/main/java/org/jabref/gui/EntryTypeView.java b/src/main/java/org/jabref/gui/EntryTypeView.java index d7d45501a8e..d9aa1b66b67 100644 --- a/src/main/java/org/jabref/gui/EntryTypeView.java +++ b/src/main/java/org/jabref/gui/EntryTypeView.java @@ -12,6 +12,7 @@ import javafx.scene.control.ComboBox; import javafx.scene.control.TextField; import javafx.scene.control.TitledPane; +import javafx.scene.control.Tooltip; import javafx.scene.layout.FlowPane; import org.jabref.Globals; @@ -26,6 +27,8 @@ import org.jabref.model.entry.types.BibtexEntryTypeDefinitions; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions; +import org.jabref.model.entry.types.StandardEntryType; +import org.jabref.model.strings.StringUtil; import org.jabref.preferences.JabRefPreferences; import com.airhacks.afterburner.views.ViewLoader; @@ -92,6 +95,13 @@ private void addEntriesToPane(FlowPane pane, Collection entryButton.setUserData(entryType); entryButton.setOnAction(event -> setEntryTypeForReturnAndClose(Optional.of(entryType))); pane.getChildren().add(entryButton); + + String description = getDescription(entryType); + if (StringUtil.isNotBlank(description)) { + Tooltip tooltip = new Tooltip(); + tooltip.setText(description); + entryButton.setTooltip(tooltip); + } } } @@ -168,4 +178,82 @@ private void setEntryTypeForReturnAndClose(Optional entryType) { viewModel.stopFetching(); this.close(); } + + public String getDescription(BibEntryType selectedType) { + EntryType entryType = selectedType.getType(); + try { + StandardEntryType entry = (StandardEntryType) entryType; + switch (entry) { + case Article: + return Localization.lang("An article from a journal or magazine."); + case Book: + return Localization.lang("A book with an explicit publisher."); + case Booklet: + return Localization.lang("A work that is printed and bound, but without a named publisher orsponsoring institution."); + case Collection: + return Localization.lang("A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor."); + case Conference: + return Localization.lang("The same as Inproceedings, included for Scribe compatibility."); + case InBook: + return Localization.lang("A part of a book, which may be a chapter(or section or whatever) and/or a range of pages."); + case InCollection: + return Localization.lang("A part of a book having its own title."); + case InProceedings: + return Localization.lang("An article in a conference proceedings."); + case Manual: + return Localization.lang("Technical documentation."); + case MastersThesis: + return Localization.lang("A Master’s thesis."); + case Misc: + return Localization.lang("Use this type when nothing else fits"); + case PhdThesis: + return Localization.lang("A PhD thesis."); + case Proceedings: + return Localization.lang("The proceedings of a conference."); + case TechReport: + return Localization.lang("A report published by a school or other institution, usually numbered within a series."); + case Unpublished: + return Localization.lang("A document having an author and title, but not formally published."); + case BookInBook: + return Localization.lang("This type is similar to inbook but intended for works originally published as astand-alone book."); + case InReference: + return Localization.lang("An article in a work of reference."); + case MvBook: + return Localization.lang("A multi-volume book."); + case MvCollection: + return Localization.lang("A multi-volume collection."); + case MvProceedings: + return Localization.lang("A multi-volume proceedings entry."); + case MvReference: + return Localization.lang("A multi-volume reference entry. The standard styles will treat this entry typeas an alias for mvcollection."); + case Online: + return Localization.lang("This entry type is intended for sources such as web sites which are intrinsically online resources."); + case Reference: + return Localization.lang("A single-volume work of reference such as an encyclopedia or a dictionary."); + case Report: + return Localization.lang("A technical report, research report, or white paper published by a university or someother institution."); + case Set: + return Localization.lang("An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography."); + case SuppBook: + return Localization.lang("Supplemental material in a book. This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only."); + case SuppCollection: + return Localization.lang("Supplemental material in a collection."); + case SuppPeriodical: + return Localization.lang("Supplemental material in a periodical. This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title."); + case Thesis: + return Localization.lang("A thesis written for an educational institution to satisfy the requirements for a degree."); + case WWW: + return Localization.lang("An alias for online, provided for jurabib compatibility."); + case Software: + return Localization.lang("Computer software. The standard styles will treat this entry type as an alias for misc."); + case DATESET: + return Localization.lang("A data set or a similar collection of (mostly) raw data."); + } + return ""; + } catch (Exception e) { + return ""; + } + + } + } From 073a60cd8d8b83d2bad236f53c5d082ed4e891be Mon Sep 17 00:00:00 2001 From: dimitra-karadima Date: Mon, 30 Mar 2020 20:31:17 +0300 Subject: [PATCH 02/11] Change the tooltips' description for #6074 Add the following changes: -tooltips' description comes from biblatex documentation -comment about the biblatex manual -description to the english localization file --- .../java/org/jabref/gui/EntryTypeView.java | 137 +++++++++++------- src/main/resources/l10n/JabRef_en.properties | 33 +++++ 2 files changed, 120 insertions(+), 50 deletions(-) diff --git a/src/main/java/org/jabref/gui/EntryTypeView.java b/src/main/java/org/jabref/gui/EntryTypeView.java index d9aa1b66b67..5bc6aea6c82 100644 --- a/src/main/java/org/jabref/gui/EntryTypeView.java +++ b/src/main/java/org/jabref/gui/EntryTypeView.java @@ -179,77 +179,114 @@ private void setEntryTypeForReturnAndClose(Optional entryType) { this.close(); } + //The description is coming from biblatex manual chapter 2 + //Biblatex documentation is favored over the bibtex, + //since bibtex is a subset of biblatex and biblatex is better documented. public String getDescription(BibEntryType selectedType) { EntryType entryType = selectedType.getType(); try { StandardEntryType entry = (StandardEntryType) entryType; switch (entry) { - case Article: - return Localization.lang("An article from a journal or magazine."); - case Book: - return Localization.lang("A book with an explicit publisher."); - case Booklet: - return Localization.lang("A work that is printed and bound, but without a named publisher orsponsoring institution."); - case Collection: + case Article -> { + return Localization.lang("An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title."); + } + case Book -> { + return Localization.lang("A single-volume book with one or more authors where the authors share credit for the work as a whole."); + } + case Booklet -> { + return Localization.lang("A book-like work without a formal publisher or sponsoring institution."); + } + case Collection -> { return Localization.lang("A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor."); - case Conference: - return Localization.lang("The same as Inproceedings, included for Scribe compatibility."); - case InBook: - return Localization.lang("A part of a book, which may be a chapter(or section or whatever) and/or a range of pages."); - case InCollection: - return Localization.lang("A part of a book having its own title."); - case InProceedings: + } + case Conference -> { + return Localization.lang("A legacy alias for inproceedings."); + } + case InBook -> { + return Localization.lang("A part of a book which forms a self-contained unit with its own title."); + } + case InCollection -> { + return Localization.lang("A contribution to a collection which forms a self-contained unit with a distinct author and title."); + } + case InProceedings -> { return Localization.lang("An article in a conference proceedings."); - case Manual: - return Localization.lang("Technical documentation."); - case MastersThesis: - return Localization.lang("A Master’s thesis."); - case Misc: - return Localization.lang("Use this type when nothing else fits"); - case PhdThesis: - return Localization.lang("A PhD thesis."); - case Proceedings: - return Localization.lang("The proceedings of a conference."); - case TechReport: - return Localization.lang("A report published by a school or other institution, usually numbered within a series."); - case Unpublished: - return Localization.lang("A document having an author and title, but not formally published."); - case BookInBook: - return Localization.lang("This type is similar to inbook but intended for works originally published as astand-alone book."); - case InReference: - return Localization.lang("An article in a work of reference."); - case MvBook: + } + case Manual -> { + return Localization.lang("Technical or other documentation, not necessarily in printed form."); + } + case MastersThesis -> { + return Localization.lang("Similar to thesis except that the type field is optional and defaults to the localised term Master's thesis."); + } + case Misc -> { + return Localization.lang("A fallback type for entries which do not fit into any other category."); + } + case PhdThesis -> { + return Localization.lang("Similar to thesis except that the type field is optional and defaults to the localised term PhD thesis."); + } + case Proceedings -> { + return Localization.lang("A single-volume conference proceedings. This type is very similar to collection."); + } + case TechReport -> { + return Localization.lang("Similar to report except that the type field is optional and defaults to the localised term technical report."); + } + case Unpublished -> { + return Localization.lang("A work with an author and a title which has not been formally published, such as a manuscript or the script of a talk."); + } + case BookInBook -> { + return Localization.lang("This type is similar to inbook but intended for works originally published as a stand-alone book."); + } + case InReference -> { + return Localization.lang("An article in a work of reference. This is a more specific variant of the generic incollection entry type."); + } + case MvBook -> { return Localization.lang("A multi-volume book."); - case MvCollection: + } + case MvCollection -> { return Localization.lang("A multi-volume collection."); - case MvProceedings: + } + case MvProceedings -> { return Localization.lang("A multi-volume proceedings entry."); - case MvReference: - return Localization.lang("A multi-volume reference entry. The standard styles will treat this entry typeas an alias for mvcollection."); - case Online: + } + case MvReference -> { + return Localization.lang("A multi-volume reference entry. The standard styles will treat this entry type as an alias for mvcollection."); + } + case Online -> { return Localization.lang("This entry type is intended for sources such as web sites which are intrinsically online resources."); - case Reference: + } + case Reference -> { return Localization.lang("A single-volume work of reference such as an encyclopedia or a dictionary."); - case Report: - return Localization.lang("A technical report, research report, or white paper published by a university or someother institution."); - case Set: + } + case Report -> { + return Localization.lang("A technical report, research report, or white paper published by a university or some other institution."); + } + case Set -> { return Localization.lang("An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography."); - case SuppBook: + } + case SuppBook -> { return Localization.lang("Supplemental material in a book. This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only."); - case SuppCollection: + } + case SuppCollection -> { return Localization.lang("Supplemental material in a collection."); - case SuppPeriodical: + } + case SuppPeriodical -> { return Localization.lang("Supplemental material in a periodical. This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title."); - case Thesis: + } + case Thesis -> { return Localization.lang("A thesis written for an educational institution to satisfy the requirements for a degree."); - case WWW: + } + case WWW -> { return Localization.lang("An alias for online, provided for jurabib compatibility."); - case Software: + } + case Software -> { return Localization.lang("Computer software. The standard styles will treat this entry type as an alias for misc."); - case DATESET: + } + case DATESET -> { return Localization.lang("A data set or a similar collection of (mostly) raw data."); + } + default -> { + return ""; + } } - return ""; } catch (Exception e) { return ""; } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 125b07a0806..f28279d40fd 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2169,3 +2169,36 @@ Year\ of\ publication.=Year of publication. Remove\ formatter\ for\ %0=Remove formatter for %0 Remove\ formatter\ '%0'=Remove formatter '%0' + +An\ article\ in\ a\ journal,\ magazine,\ newspaper,\ or\ other\ periodical\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ title.=An article in a journal, magazine, newspaper, or other periodical which forms aself-contained unit with its own title. +A\ single-volume\ book\ with\ one\ or\ more\ authors\ where\ the\ authors\ share\ credit\ for\ the\ work\ as\ a\ whole.=A single-volume book with one or more authors where the authors share credit for the work as a whole. +A\ book-like\ work\ without\ a\ formal\ publisher\ or\ sponsoring\ institution.=A book-like work without a formal publisher or sponsoring institution. +A\ single-volume\ collection\ with\ multiple,\ self-contained\ contributions\ by\ distinct\ authors\ which\ have\ their\ own\ title.\ The\ work\ as\ a\ whole\ has\ no\ overall\ author\ but\ it\ will\ usually\ have\ an\ editor.=A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor. +A\ legacy\ alias\ for\ inproceedings.=A legacy alias for inproceedings. +A\ part\ of\ a\ book\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ title.=A part of a book which forms a self-contained unit with its own title. +A\ contribution\ to\ a\ collection\ which\ forms\ a\ self-contained\ unit\ with\ a\ distinct\ author\ and\ title.=A contribution to a collection which forms a self-contained unit with a distinct author and title. +An\ article\ in\ a\ conference\ proceedings.=An article in a conference proceedings. +Technical\ or\ other\ documentation,\ not\ necessarily\ in\ printed\ form.=Technical or other documentation, not necessarily in printed form. +Similar\ to\ thesis\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master's\ thesis.=Similar to thesis except that the type field is optional and defaults to the localised term Master's thesis. +A\ fallback\ type\ for\ entries\ which\ do\ not\ fit\ into\ any\ other\ category.=A fallback type for entries which do not fit into any other category. +Similar\ to\ thesis\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ PhD\ thesis.=Similar to thesis except that the type field is optional and defaults to the localised term PhD thesis. +A\ single-volume\ conference\ proceedings.\ This\ type\ is\ very\ similar\ to\ collection.=A single-volume conference proceedings. This type is very similar to collection. +Similar\ to\ report\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ technical\ report.=Similar to report except that the type field is optional and defaults to the localised term technical report. +A\ work\ with\ an\ author\ and\ a\ title\ which\ has\ not\ been\ formally\ published,\ such\ as\ a\ manuscript\ or\ the\ script\ of\ a\ talk.=A work with an author and a title which has not been formally published, such as a manuscript or the script of a talk. +This\ type\ is\ similar\ to\ inbook\ but\ intended\ for\ works\ originally\ published\ as\ a\ stand-alone\ book.=This type is similar to inbook but intended for works originally published as a stand-alone book. +An\ article\ in\ a\ work\ of\ reference.\ This\ is\ a\ more\ specific\ variant\ of\ the\ generic\ incollection\ entry\ type.=An article in a work of reference. This is a more specific variant of the generic incollection entry type. +A\ multi-volume\ book.=A multi-volume book. +A\ multi-volume\ collection.=A multi-volume collection. +A\ multi-volume\ proceedings\ entry.=A multi-volume proceedings entry. +A\ multi-volume\ reference\ entry.\ The\ standard\ styles\ will\ treat\ this\ entry\ type\ as\ an\ alias\ for\ mvcollection.=A multi-volume reference entry. The standard styles will treat this entry type as an alias for mvcollection. +This\ entry\ type\ is\ intended\ for\ sources\ such\ as\ web\ sites\ which\ are\ intrinsically\ online\ resources.=This entry type is intended for sources such as web sites which are intrinsically online resources. +A\ single-volume\ work\ of\ reference\ such\ as\ an\ encyclopedia\ or\ a\ dictionary.=A single-volume work of reference such as an encyclopedia or a dictionary. +A\ technical\ report,\ research\ report,\ or\ white\ paper\ published\ by\ a\ university\ or\ some\ other\ institution.=A technical report, research report, or white paper published by a university or some other institution. +An\ entry\ set\ is\ a\ group\ of\ entries\ which\ are\ cited\ as\ a\ single\ reference\ and\ listed\ as\ a\ single\ item\ in\ the\ bibliography.=An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography. +Supplemental\ material\ in\ a\ book.\ This\ type\ is\ provided\ for\ elements\ such\ as\ prefaces,\ introductions,\ forewords,\ afterwords,\ etc.\ which\ often\ have\ a\ generic\ title\ only.=Supplemental material in a book. This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only. +Supplemental\ material\ in\ a\ collection.=Supplemental material in a collection. +Supplemental\ material\ in\ a\ periodical.\ This\ type\ may\ be\ useful\ when\ referring\ to\ items\ such\ as\ regular\ columns,\ obituaries,\ letters\ to\ the\ editor,\ etc.\ which\ only\ have\ a\ generic\ title.=Supplemental material in a periodical. This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title. +A\ thesis\ written\ for\ an\ educational\ institution\ to\ satisfy\ the\ requirements\ for\ a\ degree.=A thesis written for an educational institution to satisfy the requirements for a degree. +An\ alias\ for\ online,\ provided\ for\ jurabib\ compatibility.=An alias for online, provided for jurabib compatibility. +Computer\ software.\ The\ standard\ styles\ will\ treat\ this\ entry\ type\ as\ an\ alias\ for\ misc.=Computer software. The standard styles will treat this entry type as an alias for misc. +A\ data\ set\ or\ a\ similar\ collection\ of\ (mostly)\ raw\ data.=A data set or a similar collection of (mostly) raw data. From a546c32c8acb9a7ae6237e971c4bb777c7c910c3 Mon Sep 17 00:00:00 2001 From: dimitra-karadima Date: Sat, 4 Apr 2020 14:46:48 +0300 Subject: [PATCH 03/11] Refactor tooltip for #6074 Add the following changes: -refactor the tooltip to prevent display issues -check if the entry type is StandardEntryType with instance of -use quotes to describe another entry type in the tooltip's description --- .../java/org/jabref/gui/EntryTypeView.java | 46 ++++++++++--------- src/main/resources/l10n/JabRef_en.properties | 32 ++++++------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/main/java/org/jabref/gui/EntryTypeView.java b/src/main/java/org/jabref/gui/EntryTypeView.java index 5bc6aea6c82..cd8297a0bdb 100644 --- a/src/main/java/org/jabref/gui/EntryTypeView.java +++ b/src/main/java/org/jabref/gui/EntryTypeView.java @@ -14,6 +14,7 @@ import javafx.scene.control.TitledPane; import javafx.scene.control.Tooltip; import javafx.scene.layout.FlowPane; +import javafx.stage.Screen; import org.jabref.Globals; import org.jabref.gui.util.BaseDialog; @@ -98,8 +99,11 @@ private void addEntriesToPane(FlowPane pane, Collection String description = getDescription(entryType); if (StringUtil.isNotBlank(description)) { - Tooltip tooltip = new Tooltip(); - tooltip.setText(description); + Screen currentScreen = Screen.getPrimary(); + double maxWidth = currentScreen.getBounds().getWidth(); + Tooltip tooltip = new Tooltip(description); + tooltip.setMaxWidth((maxWidth * 2) / 3); + tooltip.setWrapText(true); entryButton.setTooltip(tooltip); } } @@ -184,8 +188,7 @@ private void setEntryTypeForReturnAndClose(Optional entryType) { //since bibtex is a subset of biblatex and biblatex is better documented. public String getDescription(BibEntryType selectedType) { EntryType entryType = selectedType.getType(); - try { - StandardEntryType entry = (StandardEntryType) entryType; + if (entryType instanceof StandardEntryType entry) { switch (entry) { case Article -> { return Localization.lang("An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title."); @@ -200,7 +203,7 @@ public String getDescription(BibEntryType selectedType) { return Localization.lang("A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor."); } case Conference -> { - return Localization.lang("A legacy alias for inproceedings."); + return Localization.lang("A legacy alias for \"InProceedings\"."); } case InBook -> { return Localization.lang("A part of a book which forms a self-contained unit with its own title."); @@ -215,40 +218,40 @@ public String getDescription(BibEntryType selectedType) { return Localization.lang("Technical or other documentation, not necessarily in printed form."); } case MastersThesis -> { - return Localization.lang("Similar to thesis except that the type field is optional and defaults to the localised term Master's thesis."); + return Localization.lang("Similar to \"Thesis\" except that the type field is optional and defaults to the localised term Master's thesis."); } case Misc -> { return Localization.lang("A fallback type for entries which do not fit into any other category."); } case PhdThesis -> { - return Localization.lang("Similar to thesis except that the type field is optional and defaults to the localised term PhD thesis."); + return Localization.lang("Similar to \"Thesis\" except that the type field is optional and defaults to the localised term PhD thesis."); } case Proceedings -> { - return Localization.lang("A single-volume conference proceedings. This type is very similar to collection."); + return Localization.lang("A single-volume conference proceedings. This type is very similar to \"Collection\"."); } case TechReport -> { - return Localization.lang("Similar to report except that the type field is optional and defaults to the localised term technical report."); + return Localization.lang("Similar to \"Report\" except that the type field is optional and defaults to the localised term technical report."); } case Unpublished -> { return Localization.lang("A work with an author and a title which has not been formally published, such as a manuscript or the script of a talk."); } case BookInBook -> { - return Localization.lang("This type is similar to inbook but intended for works originally published as a stand-alone book."); + return Localization.lang("This type is similar to \"InBook\" but intended for works originally published as a stand-alone book."); } case InReference -> { - return Localization.lang("An article in a work of reference. This is a more specific variant of the generic incollection entry type."); + return Localization.lang("An article in a work of reference. This is a more specific variant of the generic \"InCollection\" entry type."); } case MvBook -> { - return Localization.lang("A multi-volume book."); + return Localization.lang("A multi-volume \"Book\"."); } case MvCollection -> { - return Localization.lang("A multi-volume collection."); + return Localization.lang("A multi-volume \"Collection\"."); } case MvProceedings -> { - return Localization.lang("A multi-volume proceedings entry."); + return Localization.lang("A multi-volume \"Proceedings\" entry."); } case MvReference -> { - return Localization.lang("A multi-volume reference entry. The standard styles will treat this entry type as an alias for mvcollection."); + return Localization.lang("A multi-volume \"Reference\" entry. The standard styles will treat this entry type as an alias for \"MvCollection\"."); } case Online -> { return Localization.lang("This entry type is intended for sources such as web sites which are intrinsically online resources."); @@ -263,22 +266,22 @@ public String getDescription(BibEntryType selectedType) { return Localization.lang("An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography."); } case SuppBook -> { - return Localization.lang("Supplemental material in a book. This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only."); + return Localization.lang("Supplemental material in a \"Book\". This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only."); } case SuppCollection -> { - return Localization.lang("Supplemental material in a collection."); + return Localization.lang("Supplemental material in a \"Collection\"."); } case SuppPeriodical -> { - return Localization.lang("Supplemental material in a periodical. This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title."); + return Localization.lang("Supplemental material in a \"Periodical\". This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title."); } case Thesis -> { return Localization.lang("A thesis written for an educational institution to satisfy the requirements for a degree."); } case WWW -> { - return Localization.lang("An alias for online, provided for jurabib compatibility."); + return Localization.lang("An alias for \"Online\", provided for jurabib compatibility."); } case Software -> { - return Localization.lang("Computer software. The standard styles will treat this entry type as an alias for misc."); + return Localization.lang("Computer software. The standard styles will treat this entry type as an alias for \"Misc\"."); } case DATESET -> { return Localization.lang("A data set or a similar collection of (mostly) raw data."); @@ -287,10 +290,9 @@ public String getDescription(BibEntryType selectedType) { return ""; } } - } catch (Exception e) { + } else { return ""; } - } } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index f28279d40fd..6def139723d 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2174,31 +2174,31 @@ An\ article\ in\ a\ journal,\ magazine,\ newspaper,\ or\ other\ periodical\ whic A\ single-volume\ book\ with\ one\ or\ more\ authors\ where\ the\ authors\ share\ credit\ for\ the\ work\ as\ a\ whole.=A single-volume book with one or more authors where the authors share credit for the work as a whole. A\ book-like\ work\ without\ a\ formal\ publisher\ or\ sponsoring\ institution.=A book-like work without a formal publisher or sponsoring institution. A\ single-volume\ collection\ with\ multiple,\ self-contained\ contributions\ by\ distinct\ authors\ which\ have\ their\ own\ title.\ The\ work\ as\ a\ whole\ has\ no\ overall\ author\ but\ it\ will\ usually\ have\ an\ editor.=A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor. -A\ legacy\ alias\ for\ inproceedings.=A legacy alias for inproceedings. +A\ legacy\ alias\ for\ "InProceedings".=A legacy alias for "InProceedings". A\ part\ of\ a\ book\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ title.=A part of a book which forms a self-contained unit with its own title. A\ contribution\ to\ a\ collection\ which\ forms\ a\ self-contained\ unit\ with\ a\ distinct\ author\ and\ title.=A contribution to a collection which forms a self-contained unit with a distinct author and title. An\ article\ in\ a\ conference\ proceedings.=An article in a conference proceedings. Technical\ or\ other\ documentation,\ not\ necessarily\ in\ printed\ form.=Technical or other documentation, not necessarily in printed form. -Similar\ to\ thesis\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master's\ thesis.=Similar to thesis except that the type field is optional and defaults to the localised term Master's thesis. +Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master's\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master's thesis. A\ fallback\ type\ for\ entries\ which\ do\ not\ fit\ into\ any\ other\ category.=A fallback type for entries which do not fit into any other category. -Similar\ to\ thesis\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ PhD\ thesis.=Similar to thesis except that the type field is optional and defaults to the localised term PhD thesis. -A\ single-volume\ conference\ proceedings.\ This\ type\ is\ very\ similar\ to\ collection.=A single-volume conference proceedings. This type is very similar to collection. -Similar\ to\ report\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ technical\ report.=Similar to report except that the type field is optional and defaults to the localised term technical report. +Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ PhD\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term PhD thesis. +A\ single-volume\ conference\ proceedings.\ This\ type\ is\ very\ similar\ to\ "Collection".=A single-volume conference proceedings. This type is very similar to "Collection". +Similar\ to\ "Report"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ technical\ report.=Similar to "Report" except that the type field is optional and defaults to the localised term technical report. A\ work\ with\ an\ author\ and\ a\ title\ which\ has\ not\ been\ formally\ published,\ such\ as\ a\ manuscript\ or\ the\ script\ of\ a\ talk.=A work with an author and a title which has not been formally published, such as a manuscript or the script of a talk. -This\ type\ is\ similar\ to\ inbook\ but\ intended\ for\ works\ originally\ published\ as\ a\ stand-alone\ book.=This type is similar to inbook but intended for works originally published as a stand-alone book. -An\ article\ in\ a\ work\ of\ reference.\ This\ is\ a\ more\ specific\ variant\ of\ the\ generic\ incollection\ entry\ type.=An article in a work of reference. This is a more specific variant of the generic incollection entry type. -A\ multi-volume\ book.=A multi-volume book. -A\ multi-volume\ collection.=A multi-volume collection. -A\ multi-volume\ proceedings\ entry.=A multi-volume proceedings entry. -A\ multi-volume\ reference\ entry.\ The\ standard\ styles\ will\ treat\ this\ entry\ type\ as\ an\ alias\ for\ mvcollection.=A multi-volume reference entry. The standard styles will treat this entry type as an alias for mvcollection. +This\ type\ is\ similar\ to\ "InBook"\ but\ intended\ for\ works\ originally\ published\ as\ a\ stand-alone\ book.=This type is similar to "InBook" but intended for works originally published as a stand-alone book. +An\ article\ in\ a\ work\ of\ reference.\ This\ is\ a\ more\ specific\ variant\ of\ the\ generic\ "InCollection"\ entry\ type.=An article in a work of reference. This is a more specific variant of the generic "InCollection" entry type. +A\ multi-volume\ "Book".=A multi-volume "Book". +A\ multi-volume\ "Collection".=A multi-volume "Collection". +A\ multi-volume\ "Proceedings"\ entry.=A multi-volume "Proceedings" entry. +A\ multi-volume\ "Reference"\ entry.\ The\ standard\ styles\ will\ treat\ this\ entry\ type\ as\ an\ alias\ for\ "MvCollection".=A multi-volume "Reference" entry. The standard styles will treat this entry type as an alias for "MvCollection". This\ entry\ type\ is\ intended\ for\ sources\ such\ as\ web\ sites\ which\ are\ intrinsically\ online\ resources.=This entry type is intended for sources such as web sites which are intrinsically online resources. A\ single-volume\ work\ of\ reference\ such\ as\ an\ encyclopedia\ or\ a\ dictionary.=A single-volume work of reference such as an encyclopedia or a dictionary. A\ technical\ report,\ research\ report,\ or\ white\ paper\ published\ by\ a\ university\ or\ some\ other\ institution.=A technical report, research report, or white paper published by a university or some other institution. An\ entry\ set\ is\ a\ group\ of\ entries\ which\ are\ cited\ as\ a\ single\ reference\ and\ listed\ as\ a\ single\ item\ in\ the\ bibliography.=An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography. -Supplemental\ material\ in\ a\ book.\ This\ type\ is\ provided\ for\ elements\ such\ as\ prefaces,\ introductions,\ forewords,\ afterwords,\ etc.\ which\ often\ have\ a\ generic\ title\ only.=Supplemental material in a book. This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only. -Supplemental\ material\ in\ a\ collection.=Supplemental material in a collection. -Supplemental\ material\ in\ a\ periodical.\ This\ type\ may\ be\ useful\ when\ referring\ to\ items\ such\ as\ regular\ columns,\ obituaries,\ letters\ to\ the\ editor,\ etc.\ which\ only\ have\ a\ generic\ title.=Supplemental material in a periodical. This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title. +Supplemental\ material\ in\ a\ "Book".\ This\ type\ is\ provided\ for\ elements\ such\ as\ prefaces,\ introductions,\ forewords,\ afterwords,\ etc.\ which\ often\ have\ a\ generic\ title\ only.=Supplemental material in a "Book". This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only. +Supplemental\ material\ in\ a\ "Collection".=Supplemental material in a "Collection". +Supplemental\ material\ in\ a\ "Periodical".\ This\ type\ may\ be\ useful\ when\ referring\ to\ items\ such\ as\ regular\ columns,\ obituaries,\ letters\ to\ the\ editor,\ etc.\ which\ only\ have\ a\ generic\ title.=Supplemental material in a "Periodical". This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title. A\ thesis\ written\ for\ an\ educational\ institution\ to\ satisfy\ the\ requirements\ for\ a\ degree.=A thesis written for an educational institution to satisfy the requirements for a degree. -An\ alias\ for\ online,\ provided\ for\ jurabib\ compatibility.=An alias for online, provided for jurabib compatibility. -Computer\ software.\ The\ standard\ styles\ will\ treat\ this\ entry\ type\ as\ an\ alias\ for\ misc.=Computer software. The standard styles will treat this entry type as an alias for misc. +An\ alias\ for\ "Online",\ provided\ for\ jurabib\ compatibility.=An alias for "Online", provided for jurabib compatibility. +Computer\ software.\ The\ standard\ styles\ will\ treat\ this\ entry\ type\ as\ an\ alias\ for\ "Misc".=Computer software. The standard styles will treat this entry type as an alias for "Misc". A\ data\ set\ or\ a\ similar\ collection\ of\ (mostly)\ raw\ data.=A data set or a similar collection of (mostly) raw data. From dff1c164ce94000d6e7cce3692b3f1fc1bcec2a0 Mon Sep 17 00:00:00 2001 From: dimitra-karadima Date: Tue, 7 Apr 2020 20:48:16 +0300 Subject: [PATCH 04/11] Add tooltips when changing the entry type Add the following changes: -Add tooltips in the left side of the entry editor when you click the entry type you have already selected or the Change entry type button. -Add tooltips in the main table when you right click and choose "Change entry type" --- .../jabref/gui/menus/ChangeEntryTypeMenu.java | 124 +++++++++++++++++- 1 file changed, 123 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java b/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java index bf574cf411a..c64001495a9 100644 --- a/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java +++ b/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java @@ -7,9 +7,12 @@ import javafx.collections.ObservableList; import javafx.scene.control.ContextMenu; +import javafx.scene.control.CustomMenuItem; +import javafx.scene.control.Label; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; +import javafx.scene.control.Tooltip; import org.jabref.Globals; import org.jabref.gui.undo.CountingUndoManager; @@ -23,6 +26,8 @@ import org.jabref.model.entry.types.BibtexEntryTypeDefinitions; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions; +import org.jabref.model.entry.types.StandardEntryType; +import org.jabref.model.strings.StringUtil; public class ChangeEntryTypeMenu { @@ -31,13 +36,18 @@ public ChangeEntryTypeMenu() { } public static MenuItem createMenuItem(EntryType type, BibEntry entry, UndoManager undoManager) { - MenuItem menuItem = new MenuItem(type.getDisplayName()); + CustomMenuItem menuItem = new CustomMenuItem(new Label(type.getDisplayName())); menuItem.setOnAction(event -> { NamedCompound compound = new NamedCompound(Localization.lang("Change entry type")); entry.setType(type) .ifPresent(change -> compound.addEdit(new UndoableChangeType(change))); undoManager.addEdit(compound); }); + String description = getDescription(type); + if (StringUtil.isNotBlank(description)) { + Tooltip tooltip = new Tooltip(description); + Tooltip.install(menuItem.getContent(), tooltip); + } return menuItem; } @@ -92,4 +102,116 @@ private void populate(ObservableList items, Collection t private void populate(Menu menu, Collection types, BibEntry entry, UndoManager undoManager) { populate(menu.getItems(), types, entry, undoManager); } + + //The description is coming from biblatex manual chapter 2 + //Biblatex documentation is favored over the bibtex, + //since bibtex is a subset of biblatex and biblatex is better documented. + public static String getDescription(EntryType entryType) { + if (entryType instanceof StandardEntryType entry) { + switch (entry) { + case Article -> { + return Localization.lang("An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title."); + } + case Book -> { + return Localization.lang("A single-volume book with one or more authors where the authors share credit for the work as a whole."); + } + case Booklet -> { + return Localization.lang("A book-like work without a formal publisher or sponsoring institution."); + } + case Collection -> { + return Localization.lang("A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor."); + } + case Conference -> { + return Localization.lang("A legacy alias for \"InProceedings\"."); + } + case InBook -> { + return Localization.lang("A part of a book which forms a self-contained unit with its own title."); + } + case InCollection -> { + return Localization.lang("A contribution to a collection which forms a self-contained unit with a distinct author and title."); + } + case InProceedings -> { + return Localization.lang("An article in a conference proceedings."); + } + case Manual -> { + return Localization.lang("Technical or other documentation, not necessarily in printed form."); + } + case MastersThesis -> { + return Localization.lang("Similar to \"Thesis\" except that the type field is optional and defaults to the localised term Master's thesis."); + } + case Misc -> { + return Localization.lang("A fallback type for entries which do not fit into any other category."); + } + case PhdThesis -> { + return Localization.lang("Similar to \"Thesis\" except that the type field is optional and defaults to the localised term PhD thesis."); + } + case Proceedings -> { + return Localization.lang("A single-volume conference proceedings. This type is very similar to \"Collection\"."); + } + case TechReport -> { + return Localization.lang("Similar to \"Report\" except that the type field is optional and defaults to the localised term technical report."); + } + case Unpublished -> { + return Localization.lang("A work with an author and a title which has not been formally published, such as a manuscript or the script of a talk."); + } + case BookInBook -> { + return Localization.lang("This type is similar to \"InBook\" but intended for works originally published as a stand-alone book."); + } + case InReference -> { + return Localization.lang("An article in a work of reference. This is a more specific variant of the generic \"InCollection\" entry type."); + } + case MvBook -> { + return Localization.lang("A multi-volume \"Book\"."); + } + case MvCollection -> { + return Localization.lang("A multi-volume \"Collection\"."); + } + case MvProceedings -> { + return Localization.lang("A multi-volume \"Proceedings\" entry."); + } + case MvReference -> { + return Localization.lang("A multi-volume \"Reference\" entry. The standard styles will treat this entry type as an alias for \"MvCollection\"."); + } + case Online -> { + return Localization.lang("This entry type is intended for sources such as web sites which are intrinsically online resources."); + } + case Reference -> { + return Localization.lang("A single-volume work of reference such as an encyclopedia or a dictionary."); + } + case Report -> { + return Localization.lang("A technical report, research report, or white paper published by a university or some other institution."); + } + case Set -> { + return Localization.lang("An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography."); + } + case SuppBook -> { + return Localization.lang("Supplemental material in a \"Book\". This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only."); + } + case SuppCollection -> { + return Localization.lang("Supplemental material in a \"Collection\"."); + } + case SuppPeriodical -> { + return Localization.lang("Supplemental material in a \"Periodical\". This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title."); + } + case Thesis -> { + return Localization.lang("A thesis written for an educational institution to satisfy the requirements for a degree."); + } + case WWW -> { + return Localization.lang("An alias for \"Online\", provided for jurabib compatibility."); + } + case Software -> { + return Localization.lang("Computer software. The standard styles will treat this entry type as an alias for \"Misc\"."); + } + case DATESET -> { + return Localization.lang("A data set or a similar collection of (mostly) raw data."); + } + default -> { + return ""; + } + } + } else { + return ""; + } + } + } From fe14e5490c7f9d7b687052f6492a88dd0f609f7a Mon Sep 17 00:00:00 2001 From: dimitra-karadima Date: Wed, 8 Apr 2020 12:38:23 +0300 Subject: [PATCH 05/11] Fix some issues Change DATESET standard entry type to Dataset Remove getDescription() from ChangeEntryTypeMenu.java --- .../java/org/jabref/gui/EntryTypeView.java | 10 +- .../jabref/gui/menus/ChangeEntryTypeMenu.java | 115 +----------------- .../types/BiblatexEntryTypeDefinitions.java | 2 +- .../model/entry/types/StandardEntryType.java | 2 +- 4 files changed, 9 insertions(+), 120 deletions(-) diff --git a/src/main/java/org/jabref/gui/EntryTypeView.java b/src/main/java/org/jabref/gui/EntryTypeView.java index cd8297a0bdb..266bd3b7e41 100644 --- a/src/main/java/org/jabref/gui/EntryTypeView.java +++ b/src/main/java/org/jabref/gui/EntryTypeView.java @@ -97,7 +97,8 @@ private void addEntriesToPane(FlowPane pane, Collection entryButton.setOnAction(event -> setEntryTypeForReturnAndClose(Optional.of(entryType))); pane.getChildren().add(entryButton); - String description = getDescription(entryType); + EntryType selectedType = entryType.getType(); + String description = getDescription(selectedType); if (StringUtil.isNotBlank(description)) { Screen currentScreen = Screen.getPrimary(); double maxWidth = currentScreen.getBounds().getWidth(); @@ -186,9 +187,8 @@ private void setEntryTypeForReturnAndClose(Optional entryType) { //The description is coming from biblatex manual chapter 2 //Biblatex documentation is favored over the bibtex, //since bibtex is a subset of biblatex and biblatex is better documented. - public String getDescription(BibEntryType selectedType) { - EntryType entryType = selectedType.getType(); - if (entryType instanceof StandardEntryType entry) { + public static String getDescription(EntryType selectedType) { + if (selectedType instanceof StandardEntryType entry) { switch (entry) { case Article -> { return Localization.lang("An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title."); @@ -283,7 +283,7 @@ public String getDescription(BibEntryType selectedType) { case Software -> { return Localization.lang("Computer software. The standard styles will treat this entry type as an alias for \"Misc\"."); } - case DATESET -> { + case Dataset -> { return Localization.lang("A data set or a similar collection of (mostly) raw data."); } default -> { diff --git a/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java b/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java index c64001495a9..e5625178f81 100644 --- a/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java +++ b/src/main/java/org/jabref/gui/menus/ChangeEntryTypeMenu.java @@ -15,6 +15,7 @@ import javafx.scene.control.Tooltip; import org.jabref.Globals; +import org.jabref.gui.EntryTypeView; import org.jabref.gui.undo.CountingUndoManager; import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.undo.UndoableChangeType; @@ -26,7 +27,6 @@ import org.jabref.model.entry.types.BibtexEntryTypeDefinitions; import org.jabref.model.entry.types.EntryType; import org.jabref.model.entry.types.IEEETranEntryTypeDefinitions; -import org.jabref.model.entry.types.StandardEntryType; import org.jabref.model.strings.StringUtil; public class ChangeEntryTypeMenu { @@ -43,7 +43,7 @@ public static MenuItem createMenuItem(EntryType type, BibEntry entry, UndoManage .ifPresent(change -> compound.addEdit(new UndoableChangeType(change))); undoManager.addEdit(compound); }); - String description = getDescription(type); + String description = EntryTypeView.getDescription(type); if (StringUtil.isNotBlank(description)) { Tooltip tooltip = new Tooltip(description); Tooltip.install(menuItem.getContent(), tooltip); @@ -103,115 +103,4 @@ private void populate(Menu menu, Collection types, BibEntry entry, populate(menu.getItems(), types, entry, undoManager); } - //The description is coming from biblatex manual chapter 2 - //Biblatex documentation is favored over the bibtex, - //since bibtex is a subset of biblatex and biblatex is better documented. - public static String getDescription(EntryType entryType) { - if (entryType instanceof StandardEntryType entry) { - switch (entry) { - case Article -> { - return Localization.lang("An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title."); - } - case Book -> { - return Localization.lang("A single-volume book with one or more authors where the authors share credit for the work as a whole."); - } - case Booklet -> { - return Localization.lang("A book-like work without a formal publisher or sponsoring institution."); - } - case Collection -> { - return Localization.lang("A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor."); - } - case Conference -> { - return Localization.lang("A legacy alias for \"InProceedings\"."); - } - case InBook -> { - return Localization.lang("A part of a book which forms a self-contained unit with its own title."); - } - case InCollection -> { - return Localization.lang("A contribution to a collection which forms a self-contained unit with a distinct author and title."); - } - case InProceedings -> { - return Localization.lang("An article in a conference proceedings."); - } - case Manual -> { - return Localization.lang("Technical or other documentation, not necessarily in printed form."); - } - case MastersThesis -> { - return Localization.lang("Similar to \"Thesis\" except that the type field is optional and defaults to the localised term Master's thesis."); - } - case Misc -> { - return Localization.lang("A fallback type for entries which do not fit into any other category."); - } - case PhdThesis -> { - return Localization.lang("Similar to \"Thesis\" except that the type field is optional and defaults to the localised term PhD thesis."); - } - case Proceedings -> { - return Localization.lang("A single-volume conference proceedings. This type is very similar to \"Collection\"."); - } - case TechReport -> { - return Localization.lang("Similar to \"Report\" except that the type field is optional and defaults to the localised term technical report."); - } - case Unpublished -> { - return Localization.lang("A work with an author and a title which has not been formally published, such as a manuscript or the script of a talk."); - } - case BookInBook -> { - return Localization.lang("This type is similar to \"InBook\" but intended for works originally published as a stand-alone book."); - } - case InReference -> { - return Localization.lang("An article in a work of reference. This is a more specific variant of the generic \"InCollection\" entry type."); - } - case MvBook -> { - return Localization.lang("A multi-volume \"Book\"."); - } - case MvCollection -> { - return Localization.lang("A multi-volume \"Collection\"."); - } - case MvProceedings -> { - return Localization.lang("A multi-volume \"Proceedings\" entry."); - } - case MvReference -> { - return Localization.lang("A multi-volume \"Reference\" entry. The standard styles will treat this entry type as an alias for \"MvCollection\"."); - } - case Online -> { - return Localization.lang("This entry type is intended for sources such as web sites which are intrinsically online resources."); - } - case Reference -> { - return Localization.lang("A single-volume work of reference such as an encyclopedia or a dictionary."); - } - case Report -> { - return Localization.lang("A technical report, research report, or white paper published by a university or some other institution."); - } - case Set -> { - return Localization.lang("An entry set is a group of entries which are cited as a single reference and listed as a single item in the bibliography."); - } - case SuppBook -> { - return Localization.lang("Supplemental material in a \"Book\". This type is provided for elements such as prefaces, introductions, forewords, afterwords, etc. which often have a generic title only."); - } - case SuppCollection -> { - return Localization.lang("Supplemental material in a \"Collection\"."); - } - case SuppPeriodical -> { - return Localization.lang("Supplemental material in a \"Periodical\". This type may be useful when referring to items such as regular columns, obituaries, letters to the editor, etc. which only have a generic title."); - } - case Thesis -> { - return Localization.lang("A thesis written for an educational institution to satisfy the requirements for a degree."); - } - case WWW -> { - return Localization.lang("An alias for \"Online\", provided for jurabib compatibility."); - } - case Software -> { - return Localization.lang("Computer software. The standard styles will treat this entry type as an alias for \"Misc\"."); - } - case DATESET -> { - return Localization.lang("A data set or a similar collection of (mostly) raw data."); - } - default -> { - return ""; - } - } - } else { - return ""; - } - } - } diff --git a/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java b/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java index 9344c2faff4..08e3ac006dc 100644 --- a/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java +++ b/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java @@ -427,7 +427,7 @@ public class BiblatexEntryTypeDefinitions { .build(); private static final BibEntryType DATASET = new BibEntryTypeBuilder() - .withType(StandardEntryType.DATESET) + .withType(StandardEntryType.Dataset) .withImportantFields( StandardField.SUBTITLE, StandardField.TITLEADDON, StandardField.HOWPUBLISHED, StandardField.LOCATION, StandardField.DOI, StandardField.EPRINT, StandardField.EPRINTCLASS, StandardField.EPRINTTYPE, StandardField.URL, StandardField.URLDATE) diff --git a/src/main/java/org/jabref/model/entry/types/StandardEntryType.java b/src/main/java/org/jabref/model/entry/types/StandardEntryType.java index 9b2f87d1674..8a01a87cb32 100644 --- a/src/main/java/org/jabref/model/entry/types/StandardEntryType.java +++ b/src/main/java/org/jabref/model/entry/types/StandardEntryType.java @@ -36,7 +36,7 @@ public enum StandardEntryType implements EntryType { Thesis("Thesis"), WWW("WWW"), Software("Software"), - DATESET("DataSet"); + Dataset("Dataset"); From 4a441d9768b7ca3e0df83449297bb2e1b5bf75ea Mon Sep 17 00:00:00 2001 From: dimitra-karadima <44123133+dimitra-karadima@users.noreply.github.com> Date: Tue, 14 Apr 2020 18:32:22 +0300 Subject: [PATCH 06/11] Change to the old school format Necessary change because the new pattern is only available preview in the compiler Co-Authored-By: Christoph --- src/main/java/org/jabref/gui/EntryTypeView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/EntryTypeView.java b/src/main/java/org/jabref/gui/EntryTypeView.java index a6324f5c5b7..74ea068625d 100644 --- a/src/main/java/org/jabref/gui/EntryTypeView.java +++ b/src/main/java/org/jabref/gui/EntryTypeView.java @@ -188,7 +188,9 @@ private void setEntryTypeForReturnAndClose(Optional entryType) { //Biblatex documentation is favored over the bibtex, //since bibtex is a subset of biblatex and biblatex is better documented. public static String getDescription(EntryType selectedType) { - if (selectedType instanceof StandardEntryType entry) { + if (selectedType instanceof StandardEntryType ) { + { + var entry = (StandardEntryType) selectedType; switch (entry) { case Article -> { return Localization.lang("An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title."); From a3050cde7cbfd03a9b180c33bc357624d64e8d0d Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 14 Apr 2020 18:19:50 +0200 Subject: [PATCH 07/11] Update EntryTypeView.java --- src/main/java/org/jabref/gui/EntryTypeView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/gui/EntryTypeView.java b/src/main/java/org/jabref/gui/EntryTypeView.java index 74ea068625d..52dac1b4bfe 100644 --- a/src/main/java/org/jabref/gui/EntryTypeView.java +++ b/src/main/java/org/jabref/gui/EntryTypeView.java @@ -188,10 +188,8 @@ private void setEntryTypeForReturnAndClose(Optional entryType) { //Biblatex documentation is favored over the bibtex, //since bibtex is a subset of biblatex and biblatex is better documented. public static String getDescription(EntryType selectedType) { - if (selectedType instanceof StandardEntryType ) { - { - var entry = (StandardEntryType) selectedType; - switch (entry) { + if (selectedType instanceof StandardEntryType) { + switch ((StandardEntryType) selectedType) { case Article -> { return Localization.lang("An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title."); } From 760cc0555743ccfd318703d0e3560f1b75376d5a Mon Sep 17 00:00:00 2001 From: dimitra-karadima <44123133+dimitra-karadima@users.noreply.github.com> Date: Tue, 14 Apr 2020 23:46:12 +0300 Subject: [PATCH 08/11] Fix errors Add the following change because some tests were failing. --- src/main/resources/l10n/JabRef_en.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index da4a8e29b55..9b28f876e25 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2200,7 +2200,7 @@ User-specific\ relevance\ flag,\ in\ case\ the\ entry\ is\ relevant.=User-specif Remove\ formatter\ for\ %0=Remove formatter for %0 Remove\ formatter\ '%0'=Remove formatter '%0' -An\ article\ in\ a\ journal,\ magazine,\ newspaper,\ or\ other\ periodical\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ title.=An article in a journal, magazine, newspaper, or other periodical which forms aself-contained unit with its own title. +An\ article\ in\ a\ journal,\ magazine,\ newspaper,\ or\ other\ periodical\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ title.=An article in a journal, magazine, newspaper, or other periodical which forms a self-contained unit with its own title. A\ single-volume\ book\ with\ one\ or\ more\ authors\ where\ the\ authors\ share\ credit\ for\ the\ work\ as\ a\ whole.=A single-volume book with one or more authors where the authors share credit for the work as a whole. A\ book-like\ work\ without\ a\ formal\ publisher\ or\ sponsoring\ institution.=A book-like work without a formal publisher or sponsoring institution. A\ single-volume\ collection\ with\ multiple,\ self-contained\ contributions\ by\ distinct\ authors\ which\ have\ their\ own\ title.\ The\ work\ as\ a\ whole\ has\ no\ overall\ author\ but\ it\ will\ usually\ have\ an\ editor.=A single-volume collection with multiple, self-contained contributions by distinct authors which have their own title. The work as a whole has no overall author but it will usually have an editor. @@ -2209,7 +2209,7 @@ A\ part\ of\ a\ book\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ tit A\ contribution\ to\ a\ collection\ which\ forms\ a\ self-contained\ unit\ with\ a\ distinct\ author\ and\ title.=A contribution to a collection which forms a self-contained unit with a distinct author and title. An\ article\ in\ a\ conference\ proceedings.=An article in a conference proceedings. Technical\ or\ other\ documentation,\ not\ necessarily\ in\ printed\ form.=Technical or other documentation, not necessarily in printed form. -Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master's\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master's thesis. +Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master's\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master's thesis. A\ fallback\ type\ for\ entries\ which\ do\ not\ fit\ into\ any\ other\ category.=A fallback type for entries which do not fit into any other category. Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ PhD\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term PhD thesis. A\ single-volume\ conference\ proceedings.\ This\ type\ is\ very\ similar\ to\ "Collection".=A single-volume conference proceedings. This type is very similar to "Collection". From d2df6f7227f886a784993bfc02a2b121f946406c Mon Sep 17 00:00:00 2001 From: dimitra-karadima <44123133+dimitra-karadima@users.noreply.github.com> Date: Wed, 15 Apr 2020 00:25:17 +0300 Subject: [PATCH 09/11] Add one more change Failing unit tests should stop. --- src/main/resources/l10n/JabRef_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 9b28f876e25..e50db980f55 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2209,7 +2209,7 @@ A\ part\ of\ a\ book\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ tit A\ contribution\ to\ a\ collection\ which\ forms\ a\ self-contained\ unit\ with\ a\ distinct\ author\ and\ title.=A contribution to a collection which forms a self-contained unit with a distinct author and title. An\ article\ in\ a\ conference\ proceedings.=An article in a conference proceedings. Technical\ or\ other\ documentation,\ not\ necessarily\ in\ printed\ form.=Technical or other documentation, not necessarily in printed form. -Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master's\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master's thesis. +Similar\ to\ "Thesis"\ except\ that\ the type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master's\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master's thesis. A\ fallback\ type\ for\ entries\ which\ do\ not\ fit\ into\ any\ other\ category.=A fallback type for entries which do not fit into any other category. Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ PhD\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term PhD thesis. A\ single-volume\ conference\ proceedings.\ This\ type\ is\ very\ similar\ to\ "Collection".=A single-volume conference proceedings. This type is very similar to "Collection". From 2ea22fba0e77a4af426704b7625f322729f40804 Mon Sep 17 00:00:00 2001 From: dimitra-karadima <44123133+dimitra-karadima@users.noreply.github.com> Date: Wed, 15 Apr 2020 01:44:04 +0300 Subject: [PATCH 10/11] Resolve unit test from failing --- src/main/resources/l10n/JabRef_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index e50db980f55..bf85dc26e6d 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2209,7 +2209,7 @@ A\ part\ of\ a\ book\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ tit A\ contribution\ to\ a\ collection\ which\ forms\ a\ self-contained\ unit\ with\ a\ distinct\ author\ and\ title.=A contribution to a collection which forms a self-contained unit with a distinct author and title. An\ article\ in\ a\ conference\ proceedings.=An article in a conference proceedings. Technical\ or\ other\ documentation,\ not\ necessarily\ in\ printed\ form.=Technical or other documentation, not necessarily in printed form. -Similar\ to\ "Thesis"\ except\ that\ the type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master's\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master's thesis. +Similar\ to\ "Thesis"\ except\ that\ the type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master thesis. A\ fallback\ type\ for\ entries\ which\ do\ not\ fit\ into\ any\ other\ category.=A fallback type for entries which do not fit into any other category. Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ PhD\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term PhD thesis. A\ single-volume\ conference\ proceedings.\ This\ type\ is\ very\ similar\ to\ "Collection".=A single-volume conference proceedings. This type is very similar to "Collection". From 02d4022627fb26b6f1e04b69149c76688e46c4be Mon Sep 17 00:00:00 2001 From: dimitra-karadima <44123133+dimitra-karadima@users.noreply.github.com> Date: Wed, 15 Apr 2020 09:38:07 +0300 Subject: [PATCH 11/11] Change one more line Trying to stop failing unit tests --- src/main/resources/l10n/JabRef_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index bf85dc26e6d..0dba12d4e08 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2209,7 +2209,7 @@ A\ part\ of\ a\ book\ which\ forms\ a\ self-contained\ unit\ with\ its\ own\ tit A\ contribution\ to\ a\ collection\ which\ forms\ a\ self-contained\ unit\ with\ a\ distinct\ author\ and\ title.=A contribution to a collection which forms a self-contained unit with a distinct author and title. An\ article\ in\ a\ conference\ proceedings.=An article in a conference proceedings. Technical\ or\ other\ documentation,\ not\ necessarily\ in\ printed\ form.=Technical or other documentation, not necessarily in printed form. -Similar\ to\ "Thesis"\ except\ that\ the type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master thesis. +Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ Master\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term Master thesis. A\ fallback\ type\ for\ entries\ which\ do\ not\ fit\ into\ any\ other\ category.=A fallback type for entries which do not fit into any other category. Similar\ to\ "Thesis"\ except\ that\ the\ type\ field\ is\ optional\ and\ defaults\ to\ the\ localised\ term\ PhD\ thesis.=Similar to "Thesis" except that the type field is optional and defaults to the localised term PhD thesis. A\ single-volume\ conference\ proceedings.\ This\ type\ is\ very\ similar\ to\ "Collection".=A single-volume conference proceedings. This type is very similar to "Collection".