Skip to content

Commit 67790bc

Browse files
committed
Add descriptions for more fields
1 parent a6ec7aa commit 67790bc

File tree

3 files changed

+185
-26
lines changed

3 files changed

+185
-26
lines changed

Diff for: src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java

+123-18
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.jabref.model.entry.field.Field;
1010
import org.jabref.model.entry.field.InternalField;
1111
import org.jabref.model.entry.field.StandardField;
12+
import org.jabref.model.strings.StringUtil;
1213

1314
public class FieldNameLabel extends Label {
1415

@@ -18,39 +19,143 @@ public FieldNameLabel(Field field) {
1819
setPadding(new Insets(4, 0, 0, 0));
1920
setAlignment(Pos.CENTER);
2021
setPrefHeight(Double.POSITIVE_INFINITY);
21-
setTip(field);
22+
23+
String description = getDescription(field);
24+
if (StringUtil.isNotBlank(description)) {
25+
Tooltip tooltip = new Tooltip();
26+
tooltip.setText(description);
27+
this.setTooltip(tooltip);
28+
}
2229
}
2330

24-
public void setTip(Field field) {
25-
Tooltip tip = new Tooltip();
31+
public String getDescription(Field field) {
2632
if (field.isStandardField()) {
2733
StandardField standardField = (StandardField) field;
2834
switch (standardField) {
35+
case ADDENDUM:
36+
return Localization.lang("Miscellaneous bibliographic data usually printed at the end of the entry.");
37+
case AFTERWORD:
38+
return Localization.lang("Author(s) of an afterword to the work.");
39+
case ANNOTATOR:
40+
return Localization.lang("Author(s) of annotations to the work.");
2941
case AUTHOR:
30-
tip.setText(Localization.lang("The name(s) of the author(s), in the format described in the LaTeX book. Remember, all names are separated with the and keyword, and not commas."));
31-
break;
42+
return Localization.lang("Author(s) of the work.");
43+
case BOOKTITLE:
44+
return Localization.lang("Title of the main publication this work is part of.");
45+
case CHAPTER:
46+
return Localization.lang("Chapter or section or any other unit of a work.");
47+
case COMMENTATOR:
48+
return Localization.lang("Author(s) of a commentary to the work.") + "\n" +
49+
Localization.lang("Note that this field is intended for commented editions which have a commentator in addition to the author. If the work is a stand-alone commentary, the commentator should be given in the author field.");
50+
case DATE:
51+
return Localization.lang("Publication date of the work.");
52+
case DOI:
53+
return Localization.lang("Digital Object Identifier of the work.");
54+
case EDITION:
55+
return Localization.lang("Edition of a printed publication.");
56+
case EDITOR:
57+
return Localization.lang("Editor(s) of the work or the main publication, depending on the type of the entry.");
58+
case EID:
59+
return Localization.lang("Electronic identifier of a work.") + "\n" +
60+
Localization.lang("This field may replace the pages field for journals deviating from the classic pagination scheme of printed journals by only enumerating articles or papers and not pages.");
61+
case EPRINT:
62+
return Localization.lang("Electronic identifier of an online publication.") + "\n" +
63+
Localization.lang("This is roughly comparable to a DOI but specific to a certain archive, repository, service, or system.");
64+
case EPRINTCLASS:
65+
case PRIMARYCLASS:
66+
return Localization.lang("Additional information related to the resource indicated by the eprint field.") + "\n" +
67+
Localization.lang("This could be a section of an archive, a path indicating a service, a classification of some sort.");
68+
case EPRINTTYPE:
69+
case ARCHIVEPREFIX:
70+
return Localization.lang("Type of the eprint identifier, e. g., the name of the archive, repository, service, or system the eprint field refers to.");
71+
case EVENTDATE:
72+
return Localization.lang("Date of a conference, a symposium, or some other event.");
73+
case EVENTTITLE:
74+
return Localization.lang("Title of a conference, a symposium, or some other event.") + "\n"
75+
+ Localization.lang("Note that this field holds the plain title of the event. Things like \"Proceedings of the Fifth XYZ Conference\" go into the titleaddon or booktitleaddon field.");
76+
case EVENTTITLEADDON:
77+
return Localization.lang("Annex to the eventtitle field.") + "\n" +
78+
Localization.lang("Can be used for known event acronyms.");
79+
case FILE:
80+
case PDF:
81+
return Localization.lang("Link(s) to a local PDF or other document of the work.");
82+
case HOWPUBLISHED:
83+
return Localization.lang("Publication notice for unusual publications which do not fit into any of the common categories.");
84+
case INSTITUTION:
85+
case SCHOOL:
86+
return Localization.lang("Name of a university or some other institution.");
87+
case INTRODUCTION:
88+
return Localization.lang("Author(s) of an introduction to the work.");
89+
case ISBN:
90+
return Localization.lang("International Standard Book Number of a book.");
91+
case ISSUE:
92+
return Localization.lang("Issue of a journal.") + "\n" +
93+
Localization.lang("This field is intended for journals whose individual issues are identified by a designation such as \"Spring\" or \"Summer\" rather than the month or a number. Integer ranges and short designators are better written to the number field.");
94+
case ISSUESUBTITLE:
95+
return Localization.lang("Subtitle of a specific issue of a journal or other periodical.");
96+
case ISSUETITLE:
97+
return Localization.lang("Title of a specific issue of a journal or other periodical.");
98+
case JOURNALTITLE:
3299
case JOURNAL:
33-
tip.setText(Localization.lang("Journal name. Abbrevations may be used."));
34-
break;
100+
return Localization.lang("Name of a journal, a newspaper, or some other periodical.");
101+
case LABEL:
102+
return Localization.lang("Designation to be used by the citation style as a substitute for the regular label if any data required to generate the regular label is missing.");
103+
case LIBRARY:
104+
return Localization.lang("Information such as a library name and a call number.");
105+
case LOCATION:
106+
case ADDRESS:
107+
return Localization.lang("The place(s) of publication, i. e., the location of the publisher or institution, depending on the entry type.");
108+
case MAINTITLE:
109+
return Localization.lang("Main title of a multi-volume book, such as \"Collected Works\".");
110+
case MONTH:
111+
return Localization.lang("Publication month.");
112+
case NOTE:
113+
return Localization.lang("Miscellaneous bibliographic data which does not fit into any other field.");
114+
case NUMBER:
115+
return Localization.lang("Number of a journal or the volume/number of a book in a series.");
116+
case ORGANIZATION:
117+
return Localization.lang("Organization(s) that published a manual or an online resource, or sponsored a conference.");
118+
case PAGES:
119+
return Localization.lang("One or more page numbers or page ranges.") + "\n" +
120+
Localization.lang("If the work is published as part of another one, such as an article in a journal or a collection, this field holds the relevant page range in that other work. It may also be used to limit the reference to a specific part of a work (a chapter in a book, for example). For papers in electronic journals with anon-classical pagination setup the eid field may be more suitable.");
121+
case PAGETOTAL:
122+
return Localization.lang("Total number of pages of the work.");
123+
case PUBLISHER:
124+
return Localization.lang("Name(s) of the publisher(s).");
125+
case PUBSTATE:
126+
return Localization.lang("Publication state of the work, e. g., \"in press\".");
127+
case SERIES:
128+
return Localization.lang("Name of a publication series, such as \"Studies in...\", or the number of a journal series.");
129+
case SUBTITLE:
130+
return Localization.lang("Subtitle of the work.");
35131
case TITLE:
36-
tip.setText(Localization.lang("The work's title"));
37-
break;
132+
return Localization.lang("Title of the work.");
133+
case URL:
134+
return Localization.lang("URL of an online publication.");
135+
case URLDATE:
136+
return Localization.lang("Access date of the address specified in the url field.");
137+
case VENUE:
138+
return Localization.lang("Location of a conference, a symposium, or some other event.");
139+
case VERSION:
140+
return Localization.lang("Revision number of a piece of software, a manual, etc.");
141+
case VOLUME:
142+
return Localization.lang("Volume of a multi-volume book or a periodical.");
143+
case VOLUMES:
144+
return Localization.lang("Total number of volumes of a multi-volume work.");
38145
case YEAR:
39-
tip.setText(Localization.lang("The year of publication or, for an unpublished work, the year it was written. Generally it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four nonpunctuation characters are numerals, such as '(about 1984)'."));
40-
break;
41-
default:
42-
return;
146+
return Localization.lang("Year of publication.");
147+
case KEYWORDS:
148+
return Localization.lang("Separated list of keywords.");
43149
}
44150
} else if (field instanceof InternalField) {
45151
InternalField internalField = (InternalField) field;
46152
switch (internalField) {
47153
case KEY_FIELD:
48-
tip.setText(Localization.lang("[First author'last name][Article year], e.g. Jones2020"));
49-
break;
50-
default:
51-
return;
154+
return Localization.lang("Key by which the work may be cited.");
155+
case GROUPS:
156+
return Localization.lang("Name(s) of the (manual) groups the entry belongs to.");
52157
}
53158
}
54-
this.setTooltip(tip);
159+
return "";
55160
}
56161
}

Diff for: src/main/java/org/jabref/model/entry/field/StandardField.java

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public enum StandardField implements Field {
7272
KEY("key"),
7373
KEYWORDS("keywords"),
7474
LANGUAGE("language", FieldProperty.LANGUAGE),
75+
LABEL("label"),
76+
LIBRARY("library"),
7577
LOCATION("location"),
7678
MAINSUBTITLE("mainsubtitle", FieldProperty.BOOK_NAME),
7779
MAINTITLE("maintitle", FieldProperty.BOOK_NAME),

0 commit comments

Comments
 (0)