Verified Owner
Top Description Fields Methods
org.jabref.logic.undo

public Interface UndoSuspension

extends AutoCloseable
Known Direct Implementers
org.jabref.logic.undo.JabRefUndoManager.Suspension
Annotations
@NullMarked
Imports
org.jspecify.annotations.NullMarked

Undo and redo, suspended for one library while a command applies changes it has not yet handed to the journal.

Taking a change back over the top of writes that are not yet recorded produces a library state no undo step describes, so UndoManager#suspendUndo opens one of these for as long as that window is open, and the undo UI declines meanwhile. It is not a lock: two commands may write to one library at the same time, and undo returns once the last of them has handed over.

Closing is idempotent and may happen on any thread, so a task that can finish through more than one path — success, failure, cancellation — may close on all of them.

Field Summary

Modifier and TypeField and Description
public static final UndoSuspension
NONE

Held by work that is already inside another suspension, where ending one early would reopen the window.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.lang.AutoCloseable.close.

Ends the suspension.

Field Detail

NONEback to summary
public static final UndoSuspension NONE

Held by work that is already inside another suspension, where ending one early would reopen the window. Closing it does nothing.

Method Detail

closeback to summary
public void close()

Redeclares java.lang.AutoCloseable.close.

Ends the suspension. Never throws, so it is safe in a finally and in try-with-resources.

Annotations
@Override