Ignore:
Timestamp:
2018-08-11T23:33:58+02:00 (16 months ago)
Author:
Don-vip
Message:

see #15229 - deprecate Main*.undoRedo - make UndoRedoHandler a singleton

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r13764 r14134  
    1818 * If you want to change a data set, you can use {@link #add(Command)} to execute a command on it and make that command undoable.
    1919 */
    20 public class UndoRedoHandler {
     20public final class UndoRedoHandler {
    2121
    2222    /**
     
    3434    private final LinkedList<CommandQueuePreciseListener> preciseListenerCommands = new LinkedList<>();
    3535
     36    private static class InstanceHolder {
     37        static final UndoRedoHandler INSTANCE = new UndoRedoHandler();
     38    }
     39
     40    /**
     41     * Returns the unique instance.
     42     * @return the unique instance
     43     * @since 14134
     44     */
     45    public static UndoRedoHandler getInstance() {
     46        return InstanceHolder.INSTANCE;
     47    }
     48
    3649    /**
    3750     * Constructs a new {@code UndoRedoHandler}.
    3851     */
    39     public UndoRedoHandler() {
    40         // Do nothing
     52    private UndoRedoHandler() {
     53        // Hide constructor
    4154    }
    4255
Note: See TracChangeset for help on using the changeset viewer.