Ignore:
Timestamp:
2015-10-20T16:49:10+02:00 (4 years ago)
Author:
Don-vip
Message:

move UserCancelException class in tools package and use it where applicable

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r8856 r8919  
    2727import org.openstreetmap.josm.command.SequenceCommand;
    2828import org.openstreetmap.josm.corrector.ReverseWayTagCorrector;
    29 import org.openstreetmap.josm.corrector.UserCancelException;
    3029import org.openstreetmap.josm.data.osm.Node;
    3130import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    3938import org.openstreetmap.josm.tools.Pair;
    4039import org.openstreetmap.josm.tools.Shortcut;
     40import org.openstreetmap.josm.tools.UserCancelException;
    4141
    4242/**
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r8870 r8919  
    3030import org.openstreetmap.josm.command.DeleteCommand;
    3131import org.openstreetmap.josm.command.SequenceCommand;
    32 import org.openstreetmap.josm.corrector.UserCancelException;
    3332import org.openstreetmap.josm.data.UndoRedoHandler;
    3433import org.openstreetmap.josm.data.coor.EastNorth;
     
    4645import org.openstreetmap.josm.tools.Pair;
    4746import org.openstreetmap.josm.tools.Shortcut;
     47import org.openstreetmap.josm.tools.UserCancelException;
    4848import org.openstreetmap.josm.tools.Utils;
    4949
  • trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java

    r8513 r8919  
    2424import org.openstreetmap.josm.command.DeleteCommand;
    2525import org.openstreetmap.josm.command.SequenceCommand;
    26 import org.openstreetmap.josm.corrector.UserCancelException;
    2726import org.openstreetmap.josm.data.coor.EastNorth;
    2827import org.openstreetmap.josm.data.coor.LatLon;
     
    4039import org.openstreetmap.josm.tools.ImageProvider;
    4140import org.openstreetmap.josm.tools.Shortcut;
     41import org.openstreetmap.josm.tools.UserCancelException;
    4242
    4343/**
  • trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java

    r8855 r8919  
    2121import org.openstreetmap.josm.corrector.ReverseWayNoTagCorrector;
    2222import org.openstreetmap.josm.corrector.ReverseWayTagCorrector;
    23 import org.openstreetmap.josm.corrector.UserCancelException;
    2423import org.openstreetmap.josm.data.osm.Node;
    2524import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    2726import org.openstreetmap.josm.gui.Notification;
    2827import org.openstreetmap.josm.tools.Shortcut;
     28import org.openstreetmap.josm.tools.UserCancelException;
    2929import org.openstreetmap.josm.tools.Utils;
    3030
  • trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java

    r8918 r8919  
    4141import org.openstreetmap.josm.tools.GBC;
    4242import org.openstreetmap.josm.tools.MultiMap;
     43import org.openstreetmap.josm.tools.UserCancelException;
    4344import org.openstreetmap.josm.tools.Utils;
    4445import org.openstreetmap.josm.tools.WindowGeometry;
     
    6667        try {
    6768            saveSession();
    68         } catch (CancelException ignore) {
     69        } catch (UserCancelException ignore) {
    6970            if (Main.isTraceEnabled()) {
    7071                Main.trace(ignore.getMessage());
     
    7475
    7576    /**
    76      * Denotes that the user has cancelled the save process.
     77     * Attempts to save the session.
     78     * @throws UserCancelException when the user has cancelled the save process.
    7779     * @since 8913
    7880     */
    79     public static class CancelException extends Exception {
    80     }
    81 
    82     /**
    83      * Attempts to save the session.
    84      * @throws CancelException when the user has cancelled the save process.
    85      * @since 8913
    86      */
    87     public void saveSession() throws CancelException {
     81    public void saveSession() throws UserCancelException {
    8882        if (!isEnabled()) {
    8983            return;
     
    9387        dlg.showDialog();
    9488        if (dlg.getValue() != 1) {
    95             throw new CancelException();
     89            throw new UserCancelException();
    9690        }
    9791
     
    118112
    119113        if (fc == null) {
    120             throw new CancelException();
     114            throw new UserCancelException();
    121115        }
    122116
     
    142136            file = new File(file.getPath() + (zip ? ".joz" : ".jos"));
    143137            if (!SaveActionBase.confirmOverwrite(file)) {
    144                 throw new CancelException();
     138                throw new UserCancelException();
    145139            }
    146140        }
Note: See TracChangeset for help on using the changeset viewer.