Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.gui.entryeditor

public final Class FieldListSections

extends Object
Class Inheritance
Annotations
@NullMarked
Imports
java.util.Arrays, .Collection, .EnumMap, .LinkedHashSet, .List, .Map, .Optional, .SequencedCollection, .SequencedSet, org.jabref.logic.l10n.Localization, org.jabref.model.entry.field.Field, .SpecialField, .StandardField, .UserSpecificCommentField, org.jspecify.annotations.NullMarked

Partitions the ordered field list of the AllFieldsTab into display sections (Google-Contacts-style grouping, issue #12711). Plain Java (no JavaFX) so the partition logic is unit-testable.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
public static enum
FieldListSections.SectionType

Declaration order == display order in the scroll list.

Field Summary

Modifier and TypeField and Description
private static final SequencedSet<Field>
BIBLIOMETRY_FIELDS

Order = chip/display order in the Bibliometrics section.

private static final SequencedSet<Field>
IDENTIFIER_FIELDS

FieldProperty.IDENTIFIER only marks DOI/EPRINT/PMID, therefore an explicit list.

private static final SequencedSet<Field>
private static final SequencedSet<Field>
META_FIELDS

Membership of the Meta section; a superset of META_CHIP_FIELDS because the timestamp fields are managed automatically, so they are shown when set but not offered as add-chips.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static SequencedSet<Field>
public static SequencedSet<Field>
fieldsOf(FieldListSections.SectionType type)

All fields belonging to the given section (in display order) — the basis for the section's add-chips.

public static List<FieldListSections.Section>
partition(SequencedCollection<Field> orderedFields)

Splits orderedFields into sections, keeping the given order within each section.

public static FieldListSections.SectionType
public static SequencedSet<Field>
subtract(SequencedCollection<Field> candidates, Collection<Field> shown)

The candidates (in their given order) that are not part of shown — the fields offered as add-chips below the list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIBLIOMETRY_FIELDSback to summary
private static final SequencedSet<Field> BIBLIOMETRY_FIELDS

Order = chip/display order in the Bibliometrics section.

IDENTIFIER_FIELDSback to summary
private static final SequencedSet<Field> IDENTIFIER_FIELDS

FieldProperty.IDENTIFIER only marks DOI/EPRINT/PMID, therefore an explicit list. Order = chip/display order in the Identifiers section.

META_CHIP_FIELDSback to summary
private static final SequencedSet<Field> META_CHIP_FIELDS
META_FIELDSback to summary
private static final SequencedSet<Field> META_FIELDS

Membership of the Meta section; a superset of META_CHIP_FIELDS because the timestamp fields are managed automatically, so they are shown when set but not offered as add-chips.

Constructor Detail

FieldListSectionsback to summary
private FieldListSections()

Method Detail

buildMetaChipFieldsback to summary
private static SequencedSet<Field> buildMetaChipFields()
fieldsOfback to summary
public static SequencedSet<Field> fieldsOf(FieldListSections.SectionType type)

All fields belonging to the given section (in display order) — the basis for the section's add-chips. Empty for SectionType#MAIN (its add-chips come from the entry type's optional fields) and SectionType#COMMENTS (user-specific comment fields are dynamic).

partitionback to summary
public static List<FieldListSections.Section> partition(SequencedCollection<Field> orderedFields)

Splits orderedFields into sections, keeping the given order within each section. Empty sections are omitted; section order follows SectionType declaration order.

sectionOfback to summary
public static FieldListSections.SectionType sectionOf(Field field)
subtractback to summary
public static SequencedSet<Field> subtract(SequencedCollection<Field> candidates, Collection<Field> shown)

The candidates (in their given order) that are not part of shown — the fields offered as add-chips below the list.

org.jabref.gui.entryeditor back to summary

public final Record FieldListSections.Section

extends Record
Class Inheritance
Record Components
type:FieldListSections.SectionType 
fields:SequencedSet<Field> 

Field Summary

Modifier and TypeField and Description
private final SequencedSet<Field>
fields

Record Component accessed by fields().

private final FieldListSections.SectionType
type

Record Component accessed by type().

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public SequencedSet<Field>
fields()

Record Component getter of fields.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public FieldListSections.SectionType
type()

Record Component getter of type.

Field Detail

fieldsback to summary
private final SequencedSet<Field> fields

Record Component accessed by fields().

typeback to summary
private final FieldListSections.SectionType type

Record Component accessed by type().

Constructor Detail

Sectionback to summary
public Section(FieldListSections.SectionType type, SequencedSet<Field> fields)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
fieldsback to summary
public SequencedSet<Field> fields()

Record Component getter of fields.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

typeback to summary
public FieldListSections.SectionType type()

Record Component getter of type.

org.jabref.gui.entryeditor back to summary

public final Enum FieldListSections.SectionType

extends Enum<FieldListSections.SectionType>
Class Inheritance

Declaration order == display order in the scroll list.

Field Summary

Modifier and TypeField and Description
public static final FieldListSections.SectionType
BIBLIOMETRY

External metrics about the paper (citation count, ICORE ranking).

public static final FieldListSections.SectionType
public static final FieldListSections.SectionType
public static final FieldListSections.SectionType
public static final FieldListSections.SectionType
MAIN

Everything that is not in one of the special groups; rendered without a header.

public static final FieldListSections.SectionType
META

Fields about the library entry itself rather than the paper: crossref, groups, owner, timestamps, and the special fields (ranking, priority, read status, …).

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Optional<String>
header()

The localized section heading; empty for MAIN.

public static FieldListSections.SectionType
public static FieldListSections.SectionType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BIBLIOMETRYback to summary
public static final FieldListSections.SectionType BIBLIOMETRY

External metrics about the paper (citation count, ICORE ranking).

COMMENTSback to summary
public static final FieldListSections.SectionType COMMENTS
IDENTIFIERSback to summary
public static final FieldListSections.SectionType IDENTIFIERS
MAINback to summary
public static final FieldListSections.SectionType MAIN

Everything that is not in one of the special groups; rendered without a header.

METAback to summary
public static final FieldListSections.SectionType META

Fields about the library entry itself rather than the paper: crossref, groups, owner, timestamps, and the special fields (ranking, priority, read status, …).

Constructor Detail

SectionTypeback to summary
private SectionType()

Method Detail

headerback to summary
public Optional<String> header()

The localized section heading; empty for MAIN.

valueOfback to summary
public static FieldListSections.SectionType valueOf(String name)
valuesback to summary
public static FieldListSections.SectionType[] values()