Verified Owner
Top Inners Fields Constructors Methods
org.jabref.gui.mergeentries.threewaymerge

public Class FieldRowViewModel

extends Object
Class Inheritance
Imports
javafx.beans.binding.Bindings, .BooleanBinding, javafx.beans.property.BooleanProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, org.jabref.gui.mergeentries.threewaymerge.fieldsmerger.FieldMerger, .FieldMergerFactory, org.jabref.logic.bibtex.comparator.plausibility.PlausibilityComparatorFactory, org.jabref.logic.util.strings.StringUtil, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, .FieldTextMapper, .InternalField, org.jabref.model.entry.types.EntryTypeFactory, com.tobiasdiez.easybind.EasyBind, org.jspecify.annotations.Nullable, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
public static enum

Field Summary

Modifier and TypeField and Description
private final Field
private final FieldMergerFactory
private final BooleanBinding
private final BooleanProperty
private final BibEntry
private final StringProperty
private final Logger
private final BibEntry
private final StringProperty
private @Nullable FieldRowViewModel.MergedValues
mergedValues

Values captured the first time this row's fields were merged, so that unmerge can put them back and a later merge can reapply the same result.

private final BibEntry
private final StringProperty
private final ObjectProperty<FieldRowViewModel.Selection>
private boolean
showingMergedValue

Whether the merged value is currently shown, as opposed to the two original values.

Constructor Summary

AccessConstructor and Description
public
FieldRowViewModel(Field field, BibEntry leftEntry, BibEntry rightEntry, BibEntry mergedEntry, FieldMergerFactory fieldMergerFactory)

Method Summary

Modifier and TypeMethod and Description
public void
public Field
public BibEntry
public String
public BibEntry
public String
public BibEntry
public String
public FieldRowViewModel.Selection
public BooleanBinding
public boolean
public boolean
public BooleanProperty
public StringProperty
public StringProperty
public void
public StringProperty
public ObjectProperty<FieldRowViewModel.Selection>
public void
public void
public void
public void
public void
setIsFieldsMerged(boolean isFieldsMerged)

public void
setLeftFieldValue(String leftFieldValue)

public void
setMergedFieldValue(String mergedFieldValue)

public void
setRightFieldValue(String rightFieldValue)

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fieldback to summary
private final Field field
fieldMergerFactoryback to summary
private final FieldMergerFactory fieldMergerFactory
hasEqualLeftAndRightback to summary
private final BooleanBinding hasEqualLeftAndRight
isFieldsMergedback to summary
private final BooleanProperty isFieldsMerged
leftEntryback to summary
private final BibEntry leftEntry
leftFieldValueback to summary
private final StringProperty leftFieldValue
LOGGERback to summary
private final Logger LOGGER
mergedEntryback to summary
private final BibEntry mergedEntry
mergedFieldValueback to summary
private final StringProperty mergedFieldValue
mergedValuesback to summary
private @Nullable FieldRowViewModel.MergedValues mergedValues

Values captured the first time this row's fields were merged, so that unmerge can put them back and a later merge can reapply the same result. Null until the first merge.

rightEntryback to summary
private final BibEntry rightEntry
rightFieldValueback to summary
private final StringProperty rightFieldValue
selectionback to summary
private final ObjectProperty<FieldRowViewModel.Selection> selection
showingMergedValueback to summary
private boolean showingMergedValue

Whether the merged value is currently shown, as opposed to the two original values.

Constructor Detail

FieldRowViewModelback to summary
public FieldRowViewModel(Field field, BibEntry leftEntry, BibEntry rightEntry, BibEntry mergedEntry, FieldMergerFactory fieldMergerFactory)

Method Detail

autoSelectBetterValueback to summary
public void autoSelectBetterValue()
getFieldback to summary
public Field getField()
getLeftEntryback to summary
public BibEntry getLeftEntry()
getLeftFieldValueback to summary
public String getLeftFieldValue()
getMergedEntryback to summary
public BibEntry getMergedEntry()
getMergedFieldValueback to summary
public String getMergedFieldValue()
getRightEntryback to summary
public BibEntry getRightEntry()
getRightFieldValueback to summary
public String getRightFieldValue()
getSelectionback to summary
public FieldRowViewModel.Selection getSelection()
hasEqualLeftAndRightBindingback to summary
public BooleanBinding hasEqualLeftAndRightBinding()
hasEqualLeftAndRightValuesback to summary
public boolean hasEqualLeftAndRightValues()
isFieldsMergedback to summary
public boolean isFieldsMerged()
isFieldsMergedPropertyback to summary
public BooleanProperty isFieldsMergedProperty()
leftFieldValuePropertyback to summary
public StringProperty leftFieldValueProperty()
mergedFieldValuePropertyback to summary
public StringProperty mergedFieldValueProperty()
mergeFieldsback to summary
public void mergeFields()
rightFieldValuePropertyback to summary
public StringProperty rightFieldValueProperty()
selectionPropertyback to summary
public ObjectProperty<FieldRowViewModel.Selection> selectionProperty()
selectLeftValueback to summary
public void selectLeftValue()
selectNoneback to summary
public void selectNone()
selectNonEmptyValueback to summary
public void selectNonEmptyValue()
selectRightValueback to summary
public void selectRightValue()
setIsFieldsMergedback to summary
public void setIsFieldsMerged(boolean isFieldsMerged)
setLeftFieldValueback to summary
public void setLeftFieldValue(String leftFieldValue)
setMergedFieldValueback to summary
public void setMergedFieldValue(String mergedFieldValue)
setRightFieldValueback to summary
public void setRightFieldValue(String rightFieldValue)
setSelectionback to summary
public void setSelection(FieldRowViewModel.Selection select)
unmergeFieldsback to summary
public void unmergeFields()
org.jabref.gui.mergeentries.threewaymerge back to summary

private final Record FieldRowViewModel.MergedValues

extends Record
Class Inheritance
Record Components
left:String 
right:String 
merged:String 

Field Summary

Modifier and TypeField and Description
private final String
left

Record Component accessed by left().

private final String
merged

Record Component accessed by merged().

private final String
right

Record Component accessed by right().

Constructor Summary

AccessConstructor and Description
private
MergedValues(String left, String right, String merged)

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 String
left()

Record Component getter of left.

public String
merged()

Record Component getter of merged.

public String
right()

Record Component getter of right.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

leftback to summary
private final String left

Record Component accessed by left().

mergedback to summary
private final String merged

Record Component accessed by merged().

rightback to summary
private final String right

Record Component accessed by right().

Constructor Detail

MergedValuesback to summary
private MergedValues(String left, String right, String merged)

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.

leftback to summary
public String left()

Record Component getter of left.

mergedback to summary
public String merged()

Record Component getter of merged.

rightback to summary
public String right()

Record Component getter of right.

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.

org.jabref.gui.mergeentries.threewaymerge back to summary

public final Enum FieldRowViewModel.Selection

extends Enum<FieldRowViewModel.Selection>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final FieldRowViewModel.Selection
public static final FieldRowViewModel.Selection
NONE

When the user types something into the merged field value and neither the left nor right values match it, NONE is selected

public static final FieldRowViewModel.Selection

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static FieldRowViewModel.Selection
public static FieldRowViewModel.Selection[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

LEFTback to summary
public static final FieldRowViewModel.Selection LEFT
NONEback to summary
public static final FieldRowViewModel.Selection NONE

When the user types something into the merged field value and neither the left nor right values match it, NONE is selected

RIGHTback to summary
public static final FieldRowViewModel.Selection RIGHT

Constructor Detail

Selectionback to summary
private Selection()

Method Detail

valueOfback to summary
public static FieldRowViewModel.Selection valueOf(String name)
valuesback to summary
public static FieldRowViewModel.Selection[] values()