Changeset 16573 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2020-06-08T21:02:35+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/command
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r16436 r16573 463 463 } 464 464 465 return newSequenceCommand(tr("Delete"), cmds);465 return SequenceCommand.wrapIfNeeded(tr("Delete"), cmds); 466 466 } 467 467 -
trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
r14283 r16573 73 73 public SequenceCommand(String name, Command... sequenz) { 74 74 this(name, Arrays.asList(sequenz)); 75 } 76 77 /** 78 * Convenient constructor, if the commands are known at compile time. 79 * @param name The description text to be used for the sequence command, if one is created. 80 * @param sequenz The sequence that should be executed. 81 * @return Either a SequenceCommand, or the only command in the potential sequence 82 * @since 16573 83 */ 84 public static Command wrapIfNeeded(String name, Command... sequenz) { 85 if (sequenz.length == 1) { 86 return sequenz[0]; 87 } 88 return new SequenceCommand(name, sequenz); 89 } 90 91 /** 92 * Convenient constructor, if the commands are known at compile time. 93 * @param name The description text to be used for the sequence command, if one is created. 94 * @param sequenz The sequence that should be executed. 95 * @return Either a SequenceCommand, or the only command in the potential sequence 96 * @since 16573 97 */ 98 public static Command wrapIfNeeded(String name, Collection<Command> sequenz) { 99 if (sequenz.size() == 1) { 100 return sequenz.iterator().next(); 101 } 102 return new SequenceCommand(name, sequenz); 75 103 } 76 104
Note:
See TracChangeset
for help on using the changeset viewer.