Top Description Fields Constructors Methods
org.jabref.gui.undo

public Class UndoableFieldChange

extends AbstractUndoableJabRefEdit
Class Inheritance
Imports
org.jabref.logic.l10n.Localization, org.jabref.model.FieldChange, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, org.jabref.model.strings.StringUtil, org.slf4j.Logger, .LoggerFactory

This class represents a change in any field value. The relevant information is the BibEntry, the field name, the old and the new value. Old/new values can be null.

Field Summary

Modifier and TypeField and Description
private final BibEntry
private final Field
private static final Logger
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
UndoableFieldChange(BibEntry entry, Field field, String oldValue, String newValue)

public

Method Summary

Modifier and TypeMethod and Description
public String
public void
redo()

Overrides javax.swing.undo.AbstractUndoableEdit.redo.

Implements javax.swing.undo.UndoableEdit.redo.

Throws CannotRedoException if canRedo returns false.

public void
undo()

Overrides javax.swing.undo.AbstractUndoableEdit.undo.

Implements javax.swing.undo.UndoableEdit.undo.

Throws CannotUndoException if canUndo returns false.

Inherited from org.jabref.gui.undo.AbstractUndoableJabRefEdit:
getRedoPresentationNamegetUndoPresentationName

Field Detail

entryback to summary
private final BibEntry entry
fieldback to summary
private final Field field
LOGGERback to summary
private static final Logger LOGGER
newValueback to summary
private final String newValue
oldValueback to summary
private final String oldValue

Constructor Detail

UndoableFieldChangeback to summary
public UndoableFieldChange(BibEntry entry, Field field, String oldValue, String newValue)
UndoableFieldChangeback to summary
public UndoableFieldChange(FieldChange change)

Method Detail

getPresentationNameback to summary
public String getPresentationName()

Overrides javax.swing.undo.AbstractUndoableEdit.getPresentationName.

Implements javax.swing.undo.UndoableEdit.getPresentationName.

Doc from javax.swing.undo.AbstractUndoableEdit.getPresentationName.

This default implementation returns "". Used by getUndoPresentationName and getRedoPresentationName to construct the strings they return. Subclasses should override to return an appropriate description of the operation this edit represents.

Returns:String

the empty string ""

Annotations
@Override
redoback to summary
public void redo()

Overrides javax.swing.undo.AbstractUndoableEdit.redo.

Implements javax.swing.undo.UndoableEdit.redo.

Doc from javax.swing.undo.AbstractUndoableEdit.redo.

Throws CannotRedoException if canRedo returns false. Sets hasBeenDone to true. Subclasses should override to redo the operation represented by this edit. Override should begin with a call to super.

Annotations
@Override
undoback to summary
public void undo()

Overrides javax.swing.undo.AbstractUndoableEdit.undo.

Implements javax.swing.undo.UndoableEdit.undo.

Doc from javax.swing.undo.AbstractUndoableEdit.undo.

Throws CannotUndoException if canUndo returns false. Sets hasBeenDone to false. Subclasses should override to undo the operation represented by this edit. Override should begin with a call to super.

Annotations
@Override