- Timestamp:
- 2015-10-20T16:49:10+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r8856 r8919 27 27 import org.openstreetmap.josm.command.SequenceCommand; 28 28 import org.openstreetmap.josm.corrector.ReverseWayTagCorrector; 29 import org.openstreetmap.josm.corrector.UserCancelException;30 29 import org.openstreetmap.josm.data.osm.Node; 31 30 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 39 38 import org.openstreetmap.josm.tools.Pair; 40 39 import org.openstreetmap.josm.tools.Shortcut; 40 import org.openstreetmap.josm.tools.UserCancelException; 41 41 42 42 /** -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r8870 r8919 30 30 import org.openstreetmap.josm.command.DeleteCommand; 31 31 import org.openstreetmap.josm.command.SequenceCommand; 32 import org.openstreetmap.josm.corrector.UserCancelException;33 32 import org.openstreetmap.josm.data.UndoRedoHandler; 34 33 import org.openstreetmap.josm.data.coor.EastNorth; … … 46 45 import org.openstreetmap.josm.tools.Pair; 47 46 import org.openstreetmap.josm.tools.Shortcut; 47 import org.openstreetmap.josm.tools.UserCancelException; 48 48 import org.openstreetmap.josm.tools.Utils; 49 49 -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r8513 r8919 24 24 import org.openstreetmap.josm.command.DeleteCommand; 25 25 import org.openstreetmap.josm.command.SequenceCommand; 26 import org.openstreetmap.josm.corrector.UserCancelException;27 26 import org.openstreetmap.josm.data.coor.EastNorth; 28 27 import org.openstreetmap.josm.data.coor.LatLon; … … 40 39 import org.openstreetmap.josm.tools.ImageProvider; 41 40 import org.openstreetmap.josm.tools.Shortcut; 41 import org.openstreetmap.josm.tools.UserCancelException; 42 42 43 43 /** -
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r8855 r8919 21 21 import org.openstreetmap.josm.corrector.ReverseWayNoTagCorrector; 22 22 import org.openstreetmap.josm.corrector.ReverseWayTagCorrector; 23 import org.openstreetmap.josm.corrector.UserCancelException;24 23 import org.openstreetmap.josm.data.osm.Node; 25 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 27 26 import org.openstreetmap.josm.gui.Notification; 28 27 import org.openstreetmap.josm.tools.Shortcut; 28 import org.openstreetmap.josm.tools.UserCancelException; 29 29 import org.openstreetmap.josm.tools.Utils; 30 30 -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r8918 r8919 41 41 import org.openstreetmap.josm.tools.GBC; 42 42 import org.openstreetmap.josm.tools.MultiMap; 43 import org.openstreetmap.josm.tools.UserCancelException; 43 44 import org.openstreetmap.josm.tools.Utils; 44 45 import org.openstreetmap.josm.tools.WindowGeometry; … … 66 67 try { 67 68 saveSession(); 68 } catch (CancelException ignore) { 69 } catch (UserCancelException ignore) { 69 70 if (Main.isTraceEnabled()) { 70 71 Main.trace(ignore.getMessage()); … … 74 75 75 76 /** 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. 77 79 * @since 8913 78 80 */ 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 { 88 82 if (!isEnabled()) { 89 83 return; … … 93 87 dlg.showDialog(); 94 88 if (dlg.getValue() != 1) { 95 throw new CancelException(); 89 throw new UserCancelException(); 96 90 } 97 91 … … 118 112 119 113 if (fc == null) { 120 throw new CancelException(); 114 throw new UserCancelException(); 121 115 } 122 116 … … 142 136 file = new File(file.getPath() + (zip ? ".joz" : ".jos")); 143 137 if (!SaveActionBase.confirmOverwrite(file)) { 144 throw new CancelException(); 138 throw new UserCancelException(); 145 139 } 146 140 } -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayNoTagCorrector.java
r8408 r8919 15 15 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 16 16 import org.openstreetmap.josm.gui.DefaultNameFormatter; 17 import org.openstreetmap.josm.tools.UserCancelException; 17 18 import org.openstreetmap.josm.tools.Utils; 18 19 -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java
r8846 r8919 21 21 import org.openstreetmap.josm.data.osm.TagCollection; 22 22 import org.openstreetmap.josm.data.osm.Way; 23 import org.openstreetmap.josm.tools.UserCancelException; 23 24 24 25 /** -
trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java
r8846 r8919 32 32 import org.openstreetmap.josm.tools.GBC; 33 33 import org.openstreetmap.josm.tools.ImageProvider; 34 import org.openstreetmap.josm.tools.UserCancelException; 34 35 35 36 /** -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
r8871 r8919 34 34 import org.openstreetmap.josm.command.ChangePropertyCommand; 35 35 import org.openstreetmap.josm.command.Command; 36 import org.openstreetmap.josm.corrector.UserCancelException;37 36 import org.openstreetmap.josm.data.osm.Node; 38 37 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 48 47 import org.openstreetmap.josm.tools.CheckParameterUtil; 49 48 import org.openstreetmap.josm.tools.ImageProvider; 49 import org.openstreetmap.josm.tools.UserCancelException; 50 50 import org.openstreetmap.josm.tools.Utils; 51 51 import org.openstreetmap.josm.tools.Utils.Function; -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
r8918 r8919 52 52 import org.openstreetmap.josm.tools.GBC; 53 53 import org.openstreetmap.josm.tools.ImageProvider; 54 import org.openstreetmap.josm.tools.UserCancelException; 54 55 import org.openstreetmap.josm.tools.Utils; 55 56 import org.openstreetmap.josm.tools.WindowGeometry; … … 375 376 setUserAction(UserAction.PROCEED); 376 377 closeDialog(); 377 } catch (CancelException ignore) { 378 } catch (UserCancelException ignore) { 378 379 if (Main.isTraceEnabled()) { 379 380 Main.trace(ignore.getMessage()); -
trunk/src/org/openstreetmap/josm/tools/UserCancelException.java
r8917 r8919 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm. corrector;2 package org.openstreetmap.josm.tools; 3 3 4 /** 5 * Exception thrown when an operation is canceled by user. 6 * @since 1001 (creation) 7 * @since 8919 (move into this package) 8 */ 4 9 public class UserCancelException extends Exception { 5 10 11 /** 12 * Constructs a new {@code UserCancelException}. 13 */ 14 public UserCancelException() { 15 super(); 16 } 17 18 /** 19 * Constructs a new {@code UserCancelException} with the specified detail message and cause. 20 * 21 * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method). 22 * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). 23 * (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) 24 */ 25 public UserCancelException(String message, Throwable cause) { 26 super(message, cause); 27 } 28 29 /** 30 * Constructs a new {@code UserCancelException} with the specified detail message. 31 * 32 * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method). 33 */ 34 public UserCancelException(String message) { 35 super(message); 36 } 37 38 /** 39 * Constructs a new {@code UserCancelException} with the specified cause. 40 * 41 * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). 42 * (A <tt>null</tt> value is permitted, and indicates that the cause is nonexistent or unknown.) 43 */ 44 public UserCancelException(Throwable cause) { 45 super(cause); 46 } 6 47 }
Note:
See TracChangeset
for help on using the changeset viewer.