diff --git a/.gitattributes b/.gitattributes index 78589f2ffde..0d611d32058 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,4 +5,3 @@ gradlew eol=lf # ensure that line endings of *.java and *.properties are normalized *.properties text *.java text - diff --git a/src/main/java/net/sf/jabref/gui/groups/UndoableAddOrRemoveGroup.java b/src/main/java/net/sf/jabref/gui/groups/UndoableAddOrRemoveGroup.java index 61c75b693f1..6d6a0d9708b 100644 --- a/src/main/java/net/sf/jabref/gui/groups/UndoableAddOrRemoveGroup.java +++ b/src/main/java/net/sf/jabref/gui/groups/UndoableAddOrRemoveGroup.java @@ -17,12 +17,11 @@ import java.util.List; -import javax.swing.undo.AbstractUndoableEdit; - +import net.sf.jabref.gui.undo.AbstractUndoableJabRefEdit; import net.sf.jabref.logic.groups.GroupTreeNode; import net.sf.jabref.logic.l10n.Localization; -class UndoableAddOrRemoveGroup extends AbstractUndoableEdit { +class UndoableAddOrRemoveGroup extends AbstractUndoableJabRefEdit { /** The root of the global groups tree */ private final GroupTreeNodeViewModel m_groupsRootHandle; @@ -78,12 +77,9 @@ public UndoableAddOrRemoveGroup(GroupTreeNodeViewModel groupsRoot, m_pathToNode = editedNode.getNode().getIndexedPathFromRoot(); } - @Override - public String getUndoPresentationName() { - return Localization.lang("Undo") + ": " + getName(); - } - private String getName() { + @Override + public String getPresentationName() { switch (m_editType) { case ADD_NODE: return Localization.lang("add group"); @@ -97,10 +93,6 @@ private String getName() { return "? (" + Localization.lang("unknown edit") + ")"; } - @Override - public String getRedoPresentationName() { - return Localization.lang("Redo") + ": " + getName(); - } @Override public void undo() { diff --git a/src/main/java/net/sf/jabref/gui/groups/UndoableChangeAssignment.java b/src/main/java/net/sf/jabref/gui/groups/UndoableChangeAssignment.java index f6da00c00e2..3fb5e03508f 100644 --- a/src/main/java/net/sf/jabref/gui/groups/UndoableChangeAssignment.java +++ b/src/main/java/net/sf/jabref/gui/groups/UndoableChangeAssignment.java @@ -20,8 +20,7 @@ import java.util.Optional; import java.util.Set; -import javax.swing.undo.AbstractUndoableEdit; - +import net.sf.jabref.gui.undo.AbstractUndoableJabRefEdit; import net.sf.jabref.logic.groups.GroupTreeNode; import net.sf.jabref.logic.l10n.Localization; import net.sf.jabref.model.entry.BibEntry; @@ -29,18 +28,18 @@ /** * @author jzieren */ -public class UndoableChangeAssignment extends AbstractUndoableEdit { +public class UndoableChangeAssignment extends AbstractUndoableJabRefEdit { private final List previousAssignments; private final List newAssignments; /** * The path to the edited node */ - private List pathToNode; + private final List pathToNode; /** * The root of the global groups tree */ - private GroupTreeNode root; + private final GroupTreeNode root; /** * @param node The node whose assignments were edited. @@ -53,14 +52,10 @@ public UndoableChangeAssignment(GroupTreeNodeViewModel node, Set previ this.pathToNode = node.getNode().getIndexedPathFromRoot(); } - @Override - public String getUndoPresentationName() { - return Localization.lang("Undo") + ": " + Localization.lang("change assignment of entries"); - } @Override - public String getRedoPresentationName() { - return Localization.lang("Redo") + ": " + Localization.lang("change assignment of entries"); + public String getPresentationName() { + return Localization.lang("change assignment of entries"); } @Override diff --git a/src/main/java/net/sf/jabref/gui/groups/UndoableModifyGroup.java b/src/main/java/net/sf/jabref/gui/groups/UndoableModifyGroup.java index 419bd049a2b..7b87280dfdc 100644 --- a/src/main/java/net/sf/jabref/gui/groups/UndoableModifyGroup.java +++ b/src/main/java/net/sf/jabref/gui/groups/UndoableModifyGroup.java @@ -17,13 +17,12 @@ import java.util.List; -import javax.swing.undo.AbstractUndoableEdit; - +import net.sf.jabref.gui.undo.AbstractUndoableJabRefEdit; import net.sf.jabref.logic.groups.AbstractGroup; import net.sf.jabref.logic.groups.GroupTreeNode; import net.sf.jabref.logic.l10n.Localization; -class UndoableModifyGroup extends AbstractUndoableEdit { +class UndoableModifyGroup extends AbstractUndoableJabRefEdit { private final GroupSelector groupSelector; private final AbstractGroup m_oldGroupBackup; @@ -49,15 +48,8 @@ public UndoableModifyGroup(GroupSelector gs, GroupTreeNodeViewModel groupsRoot, } @Override - public String getUndoPresentationName() { - return Localization.lang("Undo") + ": " - + Localization.lang("modify group"); - } - - @Override - public String getRedoPresentationName() { - return Localization.lang("Redo") + ": " - + Localization.lang("modify group"); + public String getPresentationName() { + return Localization.lang("modify group"); } @Override diff --git a/src/main/java/net/sf/jabref/gui/groups/UndoableModifySubtree.java b/src/main/java/net/sf/jabref/gui/groups/UndoableModifySubtree.java index 29a1cb7f7ab..1d1d9e9c224 100644 --- a/src/main/java/net/sf/jabref/gui/groups/UndoableModifySubtree.java +++ b/src/main/java/net/sf/jabref/gui/groups/UndoableModifySubtree.java @@ -18,12 +18,10 @@ import java.util.List; import java.util.Vector; -import javax.swing.undo.AbstractUndoableEdit; - +import net.sf.jabref.gui.undo.AbstractUndoableJabRefEdit; import net.sf.jabref.logic.groups.GroupTreeNode; -import net.sf.jabref.logic.l10n.Localization; -public class UndoableModifySubtree extends AbstractUndoableEdit { +public class UndoableModifySubtree extends AbstractUndoableJabRefEdit { /** A backup of the groups before the modification */ private final GroupTreeNode m_groupRoot; @@ -50,14 +48,8 @@ public UndoableModifySubtree(GroupTreeNodeViewModel groupRoot, } @Override - public String getUndoPresentationName() { - return Localization.lang("Undo") + ": " + m_name; - - } - - @Override - public String getRedoPresentationName() { - return Localization.lang("Redo") + ": " + m_name; + public String getPresentationName() { + return m_name; } @Override diff --git a/src/main/java/net/sf/jabref/gui/groups/UndoableMoveGroup.java b/src/main/java/net/sf/jabref/gui/groups/UndoableMoveGroup.java index 82be1092243..ae9d0ef90c8 100644 --- a/src/main/java/net/sf/jabref/gui/groups/UndoableMoveGroup.java +++ b/src/main/java/net/sf/jabref/gui/groups/UndoableMoveGroup.java @@ -18,8 +18,7 @@ import java.util.List; import java.util.Objects; -import javax.swing.undo.AbstractUndoableEdit; - +import net.sf.jabref.gui.undo.AbstractUndoableJabRefEdit; import net.sf.jabref.logic.groups.GroupTreeNode; import net.sf.jabref.logic.groups.MoveGroupChange; import net.sf.jabref.logic.l10n.Localization; @@ -28,7 +27,7 @@ * @author jzieren * */ -class UndoableMoveGroup extends AbstractUndoableEdit { +class UndoableMoveGroup extends AbstractUndoableJabRefEdit { private final GroupTreeNodeViewModel root; private final List pathToNewParent; @@ -47,13 +46,8 @@ public UndoableMoveGroup(GroupTreeNodeViewModel root, MoveGroupChange moveChange } @Override - public String getUndoPresentationName() { - return Localization.lang("Undo") + ": " + Localization.lang("move group"); - } - - @Override - public String getRedoPresentationName() { - return Localization.lang("Redo") + ": " + Localization.lang("move group"); + public String getPresentationName() { + return Localization.lang("move group"); } @Override