The entry objects themselves are retained, not their citation keys or ids: undoing a removal and redoing it must put back the same objects, because other parts of the UI hold references to them. A move to id-based lookup would break that silently, so it would have to revisit this record.
source is reported to the model listeners. It matters because restoring entries is not
the same event as adding them: entries re-inserted by an undo must not be auto-assigned to
the group that happens to be selected, which the listener in LibraryTab decides by
looking for EntriesEventSource#UNDO.
| Modifier and Type | Field and Description |
|---|---|
| private final BibDatabase | database
Record Component accessed by database(). |
| private final List | |
| private final EntriesEventSource |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ApplyResult | |
| public BibDatabase | |
| public List | |
| public boolean | equals(Object object)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public UndoableRemoveEntries | |
| public EntriesEventSource | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| database | back to summary |
|---|---|
| private final BibDatabase database Record Component accessed by database(). | |
| entries | back to summary |
|---|---|
| private final List<BibEntry> entries Record Component accessed by entries(). | |
| source | back to summary |
|---|---|
| private final EntriesEventSource source Record Component accessed by source(). | |
| UndoableInsertEntries | back to summary |
|---|---|
| public UndoableInsertEntries(BibDatabase database, List<BibEntry> entries, EntriesEventSource source) | |
| UndoableInsertEntries | back to summary |
|---|---|
| public UndoableInsertEntries(BibDatabase database, List<BibEntry> entries) | |
| UndoableInsertEntries | back to summary |
|---|---|
| public UndoableInsertEntries(BibDatabase database, BibEntry entry) | |
| apply | back to summary |
|---|---|
| public ApplyResult apply() Implements org. Doc from org. Performs this change. Implementations hold whatever they need to act on — an entry, a string, the database — so that recording a change never requires plumbing a context to the call site. A change that describes one value refuses when the library no longer holds that value, because a command writing on a background thread can have moved it on since, and writing over it would produce a library no step on the stack describes. A change that describes a collection or a whole subtree applies unconditionally: comparing all of it on every apply costs more than the case is worth, and a partial comparison would only look like a check. A change describing one modification performs it or throws, and so always returns
| |
| database | back to summary |
|---|---|
| public BibDatabase database() Record Component getter of database. | |
| entries | back to summary |
|---|---|
| public List Record Component getter of entries. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| inverted | back to summary |
|---|---|
| public UndoableRemoveEntries inverted() Implements org. Doc from org. The change that reverses this one. Must be an involution:
| |
| source | back to summary |
|---|---|
| public EntriesEventSource source() Record Component getter of source. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of 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. | |