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

public sealed Interface EntryEditorTabModel

permits BuiltInTab, CustomizedFieldsTab
Known Direct Implementers
org.jabref.gui.entryeditor.EntryEditorTabModel.BuiltInTab, org.jabref.gui.entryeditor.EntryEditorTabModel.CustomizedFieldsTab
Imports
java.util.Comparator, .LinkedHashSet, .List, .Locale, .Map, .Optional, .SequencedSet, .Set, java.util.concurrent.ConcurrentHashMap, java.util.regex.Pattern, .PatternSyntaxException, java.util.stream.Collectors, org.jabref.logic.l10n.Localization, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, .FieldFactory, .UnknownField

Model of the tabs that appear in the entry editor.

BuiltInTab — a fixed tab (the single scroll-list "Main" tab of issue #12711 and the feature tabs) identified by a BuiltIn constant; users only toggle visibility and order. CustomizedFieldsTab — a user-defined tab backed by a named, ordered list of field patterns.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
EntryEditorTabModel.BuiltIn

Every fixed tab in the entry editor, in display order.

public static record
public static record
EntryEditorTabModel.CustomizedFieldsTab

A user-defined tab showing an explicit, ordered list of field patterns.

Method Summary

Modifier and TypeMethod and Description
public static Set<Field>
extractedFieldsOnCustomTabs(List<EntryEditorTabModel> tabModels, BibEntry entry)

Union of the fields resolved by all CustomizedFieldsTabs' extracted patterns in the given tab list.

public default boolean
public boolean
public EntryEditorTabModel
withVisible(boolean visible)

Method Detail

extractedFieldsOnCustomTabsback to summary
public static Set<Field> extractedFieldsOnCustomTabs(List<EntryEditorTabModel> tabModels, BibEntry entry)

Union of the fields resolved by all CustomizedFieldsTabs' extracted patterns in the given tab list. An extracted field is moved to its custom tab: the Main tab uses this to exclude it from its field list and add-chips, so no field is displayed twice. Non-extracted patterns (the default) leave the Main tab untouched.

isPreviewback to summary
public default boolean isPreview()
isVisibleback to summary
public boolean isVisible()
withVisibleback to summary
public EntryEditorTabModel withVisible(boolean visible)
org.jabref.gui.entryeditor back to summary

public final Enum EntryEditorTabModel.BuiltIn

extends Enum<EntryEditorTabModel.BuiltIn>
Class Inheritance

Every fixed tab in the entry editor, in display order.

Field Summary

Modifier and TypeField and Description
public static final EntryEditorTabModel.BuiltIn
public static final EntryEditorTabModel.BuiltIn
public static final EntryEditorTabModel.BuiltIn
public static final EntryEditorTabModel.BuiltIn
private static final Set<EntryEditorTabModel.BuiltIn>
public static final EntryEditorTabModel.BuiltIn
public static final EntryEditorTabModel.BuiltIn
public static final EntryEditorTabModel.BuiltIn
public static final EntryEditorTabModel.BuiltIn
public static final EntryEditorTabModel.BuiltIn
public static final EntryEditorTabModel.BuiltIn

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public boolean
public static EntryEditorTabModel.BuiltIn
public static EntryEditorTabModel.BuiltIn[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

AI_CHATback to summary
public static final EntryEditorTabModel.BuiltIn AI_CHAT
AI_SUMMARYback to summary
public static final EntryEditorTabModel.BuiltIn AI_SUMMARY
ALL_FIELDSback to summary
public static final EntryEditorTabModel.BuiltIn ALL_FIELDS
CITATION_INFORMATIONback to summary
public static final EntryEditorTabModel.BuiltIn CITATION_INFORMATION
FIELD_SETSback to summary
private static final Set<EntryEditorTabModel.BuiltIn> FIELD_SETS
FILE_ANNOTATIONSback to summary
public static final EntryEditorTabModel.BuiltIn FILE_ANNOTATIONS
FULLTEXT_SEARCH_RESULTSback to summary
public static final EntryEditorTabModel.BuiltIn FULLTEXT_SEARCH_RESULTS
LATEX_CITATIONSback to summary
public static final EntryEditorTabModel.BuiltIn LATEX_CITATIONS
PREVIEWback to summary
public static final EntryEditorTabModel.BuiltIn PREVIEW
RELATED_ARTICLESback to summary
public static final EntryEditorTabModel.BuiltIn RELATED_ARTICLES
SOURCEback to summary
public static final EntryEditorTabModel.BuiltIn SOURCE

Constructor Detail

BuiltInback to summary
private BuiltIn()

Method Detail

displayNameback to summary
public String displayName()
isFieldSetback to summary
public boolean isFieldSet()
valueOfback to summary
public static EntryEditorTabModel.BuiltIn valueOf(String name)
valuesback to summary
public static EntryEditorTabModel.BuiltIn[] values()
org.jabref.gui.entryeditor back to summary

public final Record EntryEditorTabModel.BuiltInTab

extends Record
implements EntryEditorTabModel
Class Inheritance
All Implemented Interfaces
org.jabref.gui.entryeditor.EntryEditorTabModel
Record Components
type:EntryEditorTabModel.BuiltIn 
visible:boolean 

Field Summary

Modifier and TypeField and Description
private final EntryEditorTabModel.BuiltIn
type

Record Component accessed by type().

private final boolean
visible

Record Component accessed by visible().

Constructor Summary

AccessConstructor and Description
public
BuiltInTab(EntryEditorTabModel.BuiltIn type, boolean visible)

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 final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public boolean
public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public EntryEditorTabModel.BuiltIn
type()

Record Component getter of type.

public boolean
visible()

Record Component getter of visible.

public EntryEditorTabModel

Field Detail

typeback to summary
private final EntryEditorTabModel.BuiltIn type

Record Component accessed by type().

visibleback to summary
private final boolean visible

Record Component accessed by visible().

Constructor Detail

BuiltInTabback to summary
public BuiltInTab(EntryEditorTabModel.BuiltIn type, boolean visible)

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).
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.

isVisibleback to summary
public boolean isVisible()

Implements org.jabref.gui.entryeditor.EntryEditorTabModel.isVisible.

Annotations
@Override
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 EntryEditorTabModel.BuiltIn type()

Record Component getter of type.

visibleback to summary
public boolean visible()

Record Component getter of visible.

withVisibleback to summary
public EntryEditorTabModel withVisible(boolean visible)

Implements org.jabref.gui.entryeditor.EntryEditorTabModel.withVisible.

Annotations
@Override
org.jabref.gui.entryeditor back to summary

public final Record EntryEditorTabModel.CustomizedFieldsTab

extends Record
implements EntryEditorTabModel
Class Inheritance
All Implemented Interfaces
org.jabref.gui.entryeditor.EntryEditorTabModel
Record Components
name:String 
fieldPatterns:List<String> 
extractedFieldPatterns:Set<String> 

A user-defined tab showing an explicit, ordered list of field patterns. Always shown while its pattern list resolves to at least one field; toggled only by being added to or removed from the tab list, so it carries no visibility flag (unlike BuiltInTab).

A pattern is either a plain field name (always shown, even while unset on the entry) or a regular expression (contains regex metacharacters), which captures every set field of the entry whose name matches it — e.g. comment-.* for all user-specific comment fields.

A pattern in extractedFieldPatterns is additionally extracted: the fields it resolves to leave the Main tab. Patterns are not extracted by default, so a custom tab initially only mirrors its fields.

Field Summary

Modifier and TypeField and Description
private static final Map<String, Optional<Pattern>>
COMPILED_REGEXES

See compiledRegex; empty marks an invalid regex.

private final Set<String>
extractedFieldPatterns

Record Component accessed by extractedFieldPatterns().

private final List<String>
fieldPatterns

Record Component accessed by fieldPatterns().

private static final Set<String>
KNOWN_FIELD_NAMES

Lower-cased names of every registered field (see appearsOnMainTab).

private final String
name

Record Component accessed by name().

private static final Pattern
PLAIN_FIELD_NAME

A pattern without any regex metacharacter is a plain field name.

Constructor Summary

AccessConstructor and Description
public
CustomizedFieldsTab(String name, List<String> fieldPatterns, Set<String> extractedFieldPatterns)

public
CustomizedFieldsTab(String name, List<String> fieldPatterns)

A tab with no extracted patterns (the default for newly configured fields).

Method Summary

Modifier and TypeMethod and Description
public static boolean
appearsOnMainTab(String fieldPattern)

Whether the "Extract field" choice applies to the pattern: only a plain name of a known field is a field the Main tab shows on its own.

private static Optional<Pattern>
compiledRegex(String pattern)

Regex patterns are resolved on every Main-tab and custom-tab rebuild, so the compiled form is cached (the cache stays small: it only ever holds the user's configured patterns).

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

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

public Set<String>
extractedFieldPatterns()

Record Component getter of extractedFieldPatterns.

public List<String>
fieldPatterns()

Record Component getter of fieldPatterns.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public boolean
public String
name()

Record Component getter of name.

private SequencedSet<Field>
resolve(List<String> patterns, BibEntry entry)

public SequencedSet<Field>
resolveExtractedFields(BibEntry entry)

Resolves only the extracted patterns — the fields the Main tab must no longer show.

public SequencedSet<Field>
resolveFields(BibEntry entry)

Resolves fieldPatterns against the given entry, keeping the configured pattern order; the fields captured by one regex pattern are sorted by name.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public EntryEditorTabModel

Field Detail

COMPILED_REGEXESback to summary
private static final Map<String, Optional<Pattern>> COMPILED_REGEXES

See compiledRegex; empty marks an invalid regex.

extractedFieldPatternsback to summary
private final Set<String> extractedFieldPatterns

Record Component accessed by extractedFieldPatterns().

fieldPatternsback to summary
private final List<String> fieldPatterns

Record Component accessed by fieldPatterns().

KNOWN_FIELD_NAMESback to summary
private static final Set<String> KNOWN_FIELD_NAMES

Lower-cased names of every registered field (see appearsOnMainTab).

nameback to summary
private final String name

Record Component accessed by name().

PLAIN_FIELD_NAMEback to summary
private static final Pattern PLAIN_FIELD_NAME

A pattern without any regex metacharacter is a plain field name.

Constructor Detail

CustomizedFieldsTabback to summary
public CustomizedFieldsTab(String name, List<String> fieldPatterns, Set<String> extractedFieldPatterns)
CustomizedFieldsTabback to summary
public CustomizedFieldsTab(String name, List<String> fieldPatterns)

A tab with no extracted patterns (the default for newly configured fields).

Method Detail

appearsOnMainTabback to summary
public static boolean appearsOnMainTab(String fieldPattern)

Whether the "Extract field" choice applies to the pattern: only a plain name of a known field is a field the Main tab shows on its own. A regex pattern or an unknown field name is always extracted — the custom tab is the only place curating such fields — so the preferences UI shows its checkbox checked and disabled.

Checked against the catalog of all registered fields, not via a type-less FieldFactory#parseField(String): type-scoped BibLaTeX software/APA fields (license, article, …) parse as unknown without an entry type but are known fields nonetheless.

compiledRegexback to summary
private static Optional<Pattern> compiledRegex(String pattern)

Regex patterns are resolved on every Main-tab and custom-tab rebuild, so the compiled form is cached (the cache stays small: it only ever holds the user's configured patterns).

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).
extractedFieldPatternsback to summary
public Set<String> extractedFieldPatterns()

Record Component getter of extractedFieldPatterns.

fieldPatternsback to summary
public List<String> fieldPatterns()

Record Component getter of fieldPatterns.

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.

isVisibleback to summary
public boolean isVisible()

Implements org.jabref.gui.entryeditor.EntryEditorTabModel.isVisible.

Annotations
@Override
nameback to summary
public String name()

Record Component getter of name.

resolveback to summary
private SequencedSet<Field> resolve(List<String> patterns, BibEntry entry)
resolveExtractedFieldsback to summary
public SequencedSet<Field> resolveExtractedFields(BibEntry entry)

Resolves only the extracted patterns — the fields the Main tab must no longer show.

resolveFieldsback to summary
public SequencedSet<Field> resolveFields(BibEntry entry)

Resolves fieldPatterns against the given entry, keeping the configured pattern order; the fields captured by one regex pattern are sorted by name. Invalid regexes resolve to nothing.

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.

withVisibleback to summary
public EntryEditorTabModel withVisible(boolean visible)

Implements org.jabref.gui.entryeditor.EntryEditorTabModel.withVisible.

Annotations
@Override