Changeset 11102 in josm
- Timestamp:
- 2016-10-08T14:04:09+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r10936 r11102 294 294 295 295 switch (ed.showDialog().getValue()) { 296 case 1: ta.copyToClip pboard(); break;296 case 1: ta.copyToClipboard(); break; 297 297 case 2: BugReportSender.reportBug(reportHeader); break; 298 298 default: // Do nothing -
trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportDialog.java
r10819 r11102 111 111 panel.add(new UrlLabel(Main.getJOSMWebsite() + "/newticket"), GBC.std().fill(GBC.HORIZONTAL)); 112 112 JButton copy = new JButton("Copy to clipboard"); 113 copy.addActionListener(e -> textPanel.copyToClip pboard());113 copy.addActionListener(e -> textPanel.copyToClipboard()); 114 114 panel.add(copy, GBC.eol().anchor(GBC.EAST)); 115 115 content.add(panel, GBC.eop().fill()); -
trunk/src/org/openstreetmap/josm/tools/bugreport/DebugTextDisplay.java
r10695 r11102 65 65 * Copies the debug text to the clipboard. This includes the code tags for trac. 66 66 * @return <code>true</code> if copy was successful 67 * @since 11102 (typo) 67 68 */ 68 public boolean copyToClip pboard() {69 public boolean copyToClipboard() { 69 70 return ClipboardUtils.copyString(String.format(CODE_PATTERN, text)); 70 71 } -
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r10580 r11102 10 10 import java.io.InputStream; 11 11 import java.util.Arrays; 12 import java.util.Collection; 12 13 import java.util.Comparator; 13 14 15 import org.openstreetmap.josm.command.Command; 14 16 import org.openstreetmap.josm.data.osm.Node; 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 18 import org.openstreetmap.josm.data.osm.OsmUtils; 16 19 import org.openstreetmap.josm.data.osm.Relation; … … 245 248 return relation; 246 249 } 250 251 /** 252 * Creates a new empty command. 253 * @return a new empty command 254 */ 255 public static Command newCommand() { 256 return new Command() { 257 @Override 258 public String getDescriptionText() { 259 return ""; 260 } 261 262 @Override 263 public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, 264 Collection<OsmPrimitive> added) { 265 // Do nothing 266 } 267 }; 268 } 247 269 } -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
r11024 r11102 7 7 import org.junit.Rule; 8 8 import org.junit.Test; 9 import org.openstreetmap.josm.Main; 10 import org.openstreetmap.josm.TestUtils; 11 import org.openstreetmap.josm.command.Command; 12 import org.openstreetmap.josm.data.osm.DataSet; 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 9 14 import org.openstreetmap.josm.testutils.JOSMTestRules; 10 15 … … 24 29 25 30 /** 26 * Unit test of {@link CommandStackDialog} class .31 * Unit test of {@link CommandStackDialog} class - empty case. 27 32 */ 28 33 @Test 29 public void testCommandStackDialog () {34 public void testCommandStackDialogEmpty() { 30 35 CommandStackDialog dlg = new CommandStackDialog(); 31 36 dlg.showDialog(); … … 34 39 assertFalse(dlg.isVisible()); 35 40 } 41 42 /** 43 * Unit test of {@link CommandStackDialog} class - not empty case. 44 */ 45 @Test 46 public void testCommandStackDialogNotEmpty() { 47 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "", null); 48 Main.getLayerManager().addLayer(layer); 49 try { 50 Command cmd1 = TestUtils.newCommand(); 51 Command cmd2 = TestUtils.newCommand(); 52 Main.main.undoRedo.add(cmd1); 53 Main.main.undoRedo.add(cmd2); 54 Main.main.undoRedo.undo(1); 55 56 assertFalse(Main.main.undoRedo.commands.isEmpty()); 57 assertFalse(Main.main.undoRedo.redoCommands.isEmpty()); 58 59 CommandStackDialog dlg = new CommandStackDialog(); 60 dlg.showDialog(); 61 assertTrue(dlg.isVisible()); 62 dlg.hideDialog(); 63 assertFalse(dlg.isVisible()); 64 } finally { 65 Main.main.undoRedo.clean(); 66 Main.getLayerManager().removeLayer(layer); 67 } 68 } 36 69 }
Note:
See TracChangeset
for help on using the changeset viewer.