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

public Class MainTableColumnModel

extends Object
Class Inheritance
Annotations
@NullMarked
Imports
java.util.EnumSet, .List, .Objects, javafx.beans.property.DoubleProperty, .ObjectProperty, .ReadOnlyStringWrapper, .SimpleDoubleProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, javafx.scene.control.TableColumn, org.jabref.gui.util.FieldsUtil, org.jabref.logic.l10n.Localization, org.jabref.model.entry.field.FieldFactory, org.jabref.model.metadata.SaveOrder, org.jspecify.annotations.NullMarked, org.slf4j.Logger, .LoggerFactory

Represents the full internal name of a column in the main table. Consists of two parts: The type of the column and a qualifier, like the field name to be displayed in the column.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
public static final Character
private static final Logger
private final StringProperty
private final ObjectProperty<TableColumn.SortType>
private final ObjectProperty<MainTableColumnModel.Type>
private final DoubleProperty

Constructor Summary

AccessConstructor and Description
public
MainTableColumnModel(MainTableColumnModel.Type
the MainTableColumnModel.Type of the column, e.g. "NORMALFIELD" or "EXTRAFILE"
type
,
String
the stored qualifier of the column, e.g. "author/editor"
qualifier
)

This is used by the preferences dialog, to initialize available columns the user can add to the table.

public
MainTableColumnModel(MainTableColumnModel.Type
the MainTableColumnModel.Type of the column, e.g. "GROUPS" or "LINKED_IDENTIFIER"
type
)

This is used by the preferences dialog, to initialize available basic icon columns, the user can add to the table.

public
MainTableColumnModel(MainTableColumnModel.Type
the MainTableColumnModel.Type of the column, e.g. "NORMALFIELD" or "GROUPS"
type
,
String
the stored qualifier of the column, e.g. "author/editor"
qualifier
,
double
the stored width of the column
width
)

This is used by the preference migrations.

Method Summary

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

Overrides java.lang.Object.equals.

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

public String
public String
public String
public List<SortCriterion>
getSortCriteria()

Returns a list of sort cirteria based on the fields the current column displays.

public TableColumn.SortType
public MainTableColumnModel.Type
public double
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isConfigurable()

Returns whether this model may appear in the user-editable entry-table column preferences.

public StringProperty
public static MainTableColumnModel

Returns:

A new MainTableColumnModel
parse
(String
the name of the column, e.g. "field:author", or "author"
rawColumnName
)

This creates a new MainTableColumnModel out of a given string

public ObjectProperty<TableColumn.SortType>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public DoubleProperty
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

COLUMNS_QUALIFIER_DELIMITERback to summary
public static final Character COLUMNS_QUALIFIER_DELIMITER
LOGGERback to summary
private static final Logger LOGGER
qualifierPropertyback to summary
private final StringProperty qualifierProperty
sortTypePropertyback to summary
private final ObjectProperty<TableColumn.SortType> sortTypeProperty
typePropertyback to summary
private final ObjectProperty<MainTableColumnModel.Type> typeProperty
widthPropertyback to summary
private final DoubleProperty widthProperty

Constructor Detail

MainTableColumnModelback to summary
public MainTableColumnModel(MainTableColumnModel.Type type, String qualifier)

This is used by the preferences dialog, to initialize available columns the user can add to the table.

Parameters
type:MainTableColumnModel.Type

the MainTableColumnModel.Type of the column, e.g. "NORMALFIELD" or "EXTRAFILE"

qualifier:String

the stored qualifier of the column, e.g. "author/editor"

MainTableColumnModelback to summary
public MainTableColumnModel(MainTableColumnModel.Type type)

This is used by the preferences dialog, to initialize available basic icon columns, the user can add to the table.

Parameters
type:MainTableColumnModel.Type

the MainTableColumnModel.Type of the column, e.g. "GROUPS" or "LINKED_IDENTIFIER"

MainTableColumnModelback to summary
public MainTableColumnModel(MainTableColumnModel.Type type, String qualifier, double width)

This is used by the preference migrations.

Parameters
type:MainTableColumnModel.Type

the MainTableColumnModel.Type of the column, e.g. "NORMALFIELD" or "GROUPS"

qualifier:String

the stored qualifier of the column, e.g. "author/editor"

width:double

the stored width of the column

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

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

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getDisplayNameback to summary
public String getDisplayName()
getNameback to summary
public String getName()
getQualifierback to summary
public String getQualifier()
getSortCriteriaback to summary
public List<SortCriterion> getSortCriteria()

Returns a list of sort cirteria based on the fields the current column displays. In case it is single field, a single SortCriterion is returned. In case of multiple fields, for each field, there is a SortCriterion contained in the list.

Implementation reason: We want to have SortCriterion handle a single field, because the UI allows for handling "plain" fields only.

getSortTypeback to summary
public TableColumn.SortType getSortType()
getTypeback to summary
public MainTableColumnModel.Type getType()
getWidthback to summary
public double getWidth()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
isConfigurableback to summary
public boolean isConfigurable()

Returns whether this model may appear in the user-editable entry-table column preferences.

Internal helper columns such as MATCH_CATEGORY, and typed columns missing their qualifier, are valid implementation details but must not be persisted or reconstructed from user input.

namePropertyback to summary
public StringProperty nameProperty()
parseback to summary
public static MainTableColumnModel parse(String rawColumnName)

This creates a new MainTableColumnModel out of a given string

Parameters
rawColumnName:String

the name of the column, e.g. "field:author", or "author"

Returns:MainTableColumnModel

A new MainTableColumnModel

sortTypePropertyback to summary
public ObjectProperty<TableColumn.SortType> sortTypeProperty()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
widthPropertyback to summary
public DoubleProperty widthProperty()
org.jabref.gui.maintable back to summary

public final Enum MainTableColumnModel.Type

extends Enum<MainTableColumnModel.Type>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
public static final MainTableColumnModel.Type
public static final MainTableColumnModel.Type
public static final MainTableColumnModel.Type
public static final MainTableColumnModel.Type
public static final EnumSet<MainTableColumnModel.Type>
public static final MainTableColumnModel.Type
public static final MainTableColumnModel.Type
public static final MainTableColumnModel.Type
public static final MainTableColumnModel.Type
private final String
public static final MainTableColumnModel.Type
public static final MainTableColumnModel.Type

Constructor Summary

AccessConstructor and Description
private
Type(String name)

private
Type(String name, String displayName)

Method Summary

Modifier and TypeMethod and Description
public static MainTableColumnModel.Type
public String
public String
public String
toString()

Overrides java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration.

public static MainTableColumnModel.Type
public static MainTableColumnModel.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

displayNameback to summary
private final String displayName
EXTRAFILEback to summary
public static final MainTableColumnModel.Type EXTRAFILE
FILESback to summary
public static final MainTableColumnModel.Type FILES
GROUP_ICONSback to summary
public static final MainTableColumnModel.Type GROUP_ICONS
GROUPSback to summary
public static final MainTableColumnModel.Type GROUPS
ICON_COLUMNSback to summary
public static final EnumSet<MainTableColumnModel.Type> ICON_COLUMNS
INDEXback to summary
public static final MainTableColumnModel.Type INDEX
LIBRARY_NAMEback to summary
public static final MainTableColumnModel.Type LIBRARY_NAME
LINKED_IDENTIFIERback to summary
public static final MainTableColumnModel.Type LINKED_IDENTIFIER
MATCH_CATEGORYback to summary
public static final MainTableColumnModel.Type MATCH_CATEGORY
nameback to summary
private final String name

Hides java.lang.Enum.name.

NORMALFIELDback to summary
public static final MainTableColumnModel.Type NORMALFIELD
SPECIALFIELDback to summary
public static final MainTableColumnModel.Type SPECIALFIELD

Constructor Detail

Typeback to summary
private Type(String name)
Typeback to summary
private Type(String name, String displayName)

Method Detail

fromStringback to summary
public static MainTableColumnModel.Type fromString(String text)
getDisplayNameback to summary
public String getDisplayName()
getNameback to summary
public String getName()
toStringback to summary
public String toString()

Overrides java.lang.Enum.toString.

Doc from java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.

Annotations
@Override
valueOfback to summary
public static MainTableColumnModel.Type valueOf(String name)
valuesback to summary
public static MainTableColumnModel.Type[] values()