Changeset 7750 in josm
- Timestamp:
- 2014-11-26T21:44:56+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r7608 r7750 64 64 import org.openstreetmap.josm.gui.dialogs.DialogsPanel; 65 65 import org.openstreetmap.josm.gui.dialogs.FilterDialog; 66 import org.openstreetmap.josm.gui.dialogs.HistoryDialog;67 66 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 68 67 import org.openstreetmap.josm.gui.dialogs.MapPaintDialog; … … 239 238 addToggleDialog(new CommandStackDialog()); 240 239 addToggleDialog(new UserListDialog()); 241 addToggleDialog(new HistoryDialog(), true);242 240 addToggleDialog(conflictDialog = new ConflictDialog()); 243 241 addToggleDialog(validatorDialog = new ValidatorDialog()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r7657 r7750 64 64 import org.openstreetmap.josm.gui.PopupMenuHandler; 65 65 import org.openstreetmap.josm.gui.SideButton; 66 import org.openstreetmap.josm.gui.history.HistoryBrowserDialogManager; 66 67 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 67 68 import org.openstreetmap.josm.gui.util.GuiHelper; … … 86 87 private SelectAction actSelect = new SelectAction(); 87 88 private SearchAction actSearch = new SearchAction(); 89 private ShowHistoryAction actShowHistory = new ShowHistoryAction(); 88 90 private ZoomToJOSMSelectionAction actZoomToJOSMSelection = new ZoomToJOSMSelectionAction(); 89 91 private ZoomToListSelection actZoomToListSelection = new ZoomToListSelection(); … … 104 106 lstPrimitives.setSelectionModel(selectionModel); 105 107 lstPrimitives.setCellRenderer(new OsmPrimitivRenderer()); 106 lstPrimitives.setTransferHandler(null); // Fix #6290. Drag & Drop is not supported anyway and Copy/Paste is better propagated to main window 108 // Fix #6290. Drag & Drop is not supported anyway and Copy/Paste is better propagated to main window 109 lstPrimitives.setTransferHandler(null); 110 111 lstPrimitives.getSelectionModel().addListSelectionListener(actSelect); 112 lstPrimitives.getSelectionModel().addListSelectionListener(actShowHistory); 107 113 108 114 // the select action 109 115 final SideButton selectButton = new SideButton(actSelect); 110 lstPrimitives.getSelectionModel().addListSelectionListener(actSelect);111 116 selectButton.createArrow(new ActionListener() { 112 117 @Override … … 126 131 127 132 createLayout(lstPrimitives, true, Arrays.asList(new SideButton[] { 128 selectButton, searchButton 133 selectButton, searchButton, new SideButton(actShowHistory) 129 134 })); 130 135 } … … 280 285 */ 281 286 static class SearchAction extends AbstractAction implements EditLayerChangeListener { 287 /** 288 * Constructs a new {@code SearchAction}. 289 */ 282 290 public SearchAction() { 283 291 putValue(NAME, tr("Search")); … … 293 301 } 294 302 295 p ublicvoid updateEnabledState() {303 protected void updateEnabledState() { 296 304 setEnabled(Main.main != null && Main.main.hasEditLayer()); 297 305 } … … 308 316 */ 309 317 class SelectAction extends AbstractAction implements ListSelectionListener { 318 /** 319 * Constructs a new {@code SelectAction}. 320 */ 310 321 public SelectAction() { 311 322 putValue(NAME, tr("Select")); … … 324 335 } 325 336 326 public void updateEnabledState() { 337 protected void updateEnabledState() { 338 setEnabled(!model.getSelected().isEmpty()); 339 } 340 341 @Override 342 public void valueChanged(ListSelectionEvent e) { 343 updateEnabledState(); 344 } 345 } 346 347 /** 348 * The action for showing history information of the current history item. 349 */ 350 class ShowHistoryAction extends AbstractAction implements ListSelectionListener { 351 /** 352 * Constructs a new {@code ShowHistoryAction}. 353 */ 354 public ShowHistoryAction() { 355 putValue(NAME, tr("History")); 356 putValue(SHORT_DESCRIPTION, tr("Display the history of the selected objects.")); 357 putValue(SMALL_ICON, ImageProvider.get("dialogs", "history")); 358 updateEnabledState(); 359 } 360 361 @Override 362 public void actionPerformed(ActionEvent e) { 363 Collection<OsmPrimitive> sel = model.getSelected(); 364 if (sel.isEmpty())return; 365 HistoryBrowserDialogManager.getInstance().showHistory(sel); 366 } 367 368 protected void updateEnabledState() { 327 369 setEnabled(!model.getSelected().isEmpty()); 328 370 } … … 377 419 * 378 420 */ 379 class ZoomToListSelection extends AbstractAction implements ListSelectionListener{ 421 class ZoomToListSelection extends AbstractAction implements ListSelectionListener { 422 /** 423 * Constructs a new {@code ZoomToListSelection}. 424 */ 380 425 public ZoomToListSelection() { 381 426 putValue(NAME, tr("Zoom to selected element(s)")); … … 397 442 } 398 443 399 p ublicvoid updateEnabledState() {444 protected void updateEnabledState() { 400 445 setEnabled(!model.getSelected().isEmpty()); 401 446 }
Note:
See TracChangeset
for help on using the changeset viewer.