Changeset 12871 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-09-17T12:44:57+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r12636 r12871 23 23 import javax.swing.AbstractAction; 24 24 import javax.swing.BorderFactory; 25 import javax.swing.JButton; 25 26 import javax.swing.JLabel; 26 27 import javax.swing.JOptionPane; … … 38 39 import org.openstreetmap.josm.gui.MainApplication; 39 40 import org.openstreetmap.josm.gui.help.HelpUtil; 41 import org.openstreetmap.josm.gui.history.OpenChangesetPopupMenu; 40 42 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 41 43 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; … … 63 65 private final JosmTextField tfClosedOn = new JosmTextField(20); 64 66 67 private final OpenChangesetPopupMenuAction actOpenChangesetPopupMenu = new OpenChangesetPopupMenuAction(); 65 68 private final DownloadChangesetContentAction actDownloadChangesetContent = new DownloadChangesetContentAction(this); 66 69 private final UpdateChangesetAction actUpdateChangesets = new UpdateChangesetAction(); … … 69 72 private final ZoomInCurrentLayerAction actZoomInCurrentLayerAction = new ZoomInCurrentLayerAction(); 70 73 // CHECKSTYLE.ON: SingleSpaceSeparator 74 75 private JButton btnOpenChangesetPopupMenu; 71 76 72 77 private transient Changeset currentChangeset; … … 77 82 JToolBar tb = new JToolBar(JToolBar.VERTICAL); 78 83 tb.setFloatable(false); 84 85 // -- display changeset 86 btnOpenChangesetPopupMenu = tb.add(actOpenChangesetPopupMenu); 87 actOpenChangesetPopupMenu.initProperties(currentChangeset); 79 88 80 89 // -- remove from cache action … … 259 268 updateView(cs); 260 269 } 270 actOpenChangesetPopupMenu.initProperties(currentChangeset); 261 271 actDownloadChangesetContent.initProperties(); 262 272 actUpdateChangesets.initProperties(currentChangeset); … … 322 332 public void initProperties(Changeset cs) { 323 333 setEnabled(cs != null && !Main.isOffline(OnlineResource.OSM_API)); 334 } 335 } 336 337 /** 338 * The action for opening {@link OpenChangesetPopupMenu} 339 */ 340 class OpenChangesetPopupMenuAction extends AbstractAction { 341 OpenChangesetPopupMenuAction() { 342 putValue(NAME, tr("View changeset")); 343 new ImageProvider("help/internet").getResource().attachImageIcon(this); 344 } 345 346 @Override 347 public void actionPerformed(ActionEvent evt) { 348 if (currentChangeset != null) 349 new OpenChangesetPopupMenu(currentChangeset.getId()).show(btnOpenChangesetPopupMenu); 350 } 351 352 void initProperties(Changeset cs) { 353 setEnabled(cs != null); 324 354 } 325 355 } -
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r12743 r12871 16 16 17 17 import javax.swing.AbstractAction; 18 import javax.swing.AbstractButton; 18 19 import javax.swing.JButton; 19 20 import javax.swing.JComponent; … … 23 24 import javax.swing.event.ChangeEvent; 24 25 import javax.swing.event.ChangeListener; 26 import javax.swing.plaf.basic.BasicArrowButton; 25 27 26 28 import org.openstreetmap.josm.Main; … … 109 111 pnlUserAndChangeset.add(lblUser, GBC.eol().insets(5, 0, 0, 0).weight(1, 0)); 110 112 113 final JPanel changesetPanel = new JPanel(new BorderLayout()); 111 114 changesetButton.setMargin(new Insets(0, 0, 0, 2)); 112 pnlUserAndChangeset.add(changesetButton, GBC.std().fill().weight(0, 0)); 115 changesetPanel.add(changesetButton, BorderLayout.CENTER); 116 final BasicArrowButton arrowButton = new BasicArrowButton(BasicArrowButton.SOUTH); 117 arrowButton.addActionListener(action -> { 118 final OpenChangesetPopupMenu popupMenu = new OpenChangesetPopupMenu(changesetDialogAction.id); 119 popupMenu.insert(changesetDialogAction, 0); 120 ((AbstractButton) popupMenu.getComponent(0)).setText(tr("Open Changeset Manager")); 121 popupMenu.show(arrowButton); 122 }); 123 changesetPanel.add(arrowButton, BorderLayout.EAST); 124 pnlUserAndChangeset.add(changesetPanel, GBC.std().fill().weight(0, 0)); 113 125 114 126 lblChangeset = new UrlLabel("", 2);
Note:
See TracChangeset
for help on using the changeset viewer.