Ignore:
Timestamp:
2017-09-17T12:44:57+02:00 (20 months ago)
Author:
simon04
Message:

fix #14578 - Open external history viewers

Popup menu is added to version info of history dialog and changeset manager.

Location:
trunk/src/org/openstreetmap/josm/gui/history
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java

    r12743 r12871  
    1616
    1717import javax.swing.AbstractAction;
     18import javax.swing.AbstractButton;
    1819import javax.swing.JButton;
    1920import javax.swing.JComponent;
     
    2324import javax.swing.event.ChangeEvent;
    2425import javax.swing.event.ChangeListener;
     26import javax.swing.plaf.basic.BasicArrowButton;
    2527
    2628import org.openstreetmap.josm.Main;
     
    109111        pnlUserAndChangeset.add(lblUser, GBC.eol().insets(5, 0, 0, 0).weight(1, 0));
    110112
     113        final JPanel changesetPanel = new JPanel(new BorderLayout());
    111114        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));
    113125
    114126        lblChangeset = new UrlLabel("", 2);
Note: See TracChangeset for help on using the changeset viewer.