Changeset 15374 in josm


Ignore:
Timestamp:
2019-09-25T18:03:50+02:00 (7 weeks ago)
Author:
Don-vip
Message:

fix #17505 - sort plugins by name in about panel, and display loaded version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r15227 r15374  
    309309
    310310    /**
    311      * Returns the list of currently installed and loaded plugins.
    312      * @return the list of currently installed and loaded plugins
     311     * Returns the list of currently installed and loaded plugins, sorted by name.
     312     * @return the list of currently installed and loaded plugins, sorted by name
    313313     * @since 10982
    314314     */
    315315    public static List<PluginInformation> getPlugins() {
    316         return pluginList.stream().map(PluginProxy::getPluginInformation).collect(Collectors.toList());
     316        return pluginList.stream().map(PluginProxy::getPluginInformation)
     317                .sorted(Comparator.comparing(PluginInformation::getName)).collect(Collectors.toList());
    317318    }
    318319
     
    15621563    public static JPanel getInfoPanel() {
    15631564        JPanel pluginTab = new JPanel(new GridBagLayout());
    1564         for (final PluginProxy p : pluginList) {
    1565             final PluginInformation info = p.getPluginInformation();
     1565        for (final PluginInformation info : getPlugins()) {
    15661566            String name = info.name
    1567             + (info.version != null && !info.version.isEmpty() ? " Version: " + info.version : "");
     1567            + (info.localversion != null && !info.localversion.isEmpty() ? " Version: " + info.localversion : "");
    15681568            pluginTab.add(new JLabel(name), GBC.std());
    15691569            pluginTab.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL));
Note: See TracChangeset for help on using the changeset viewer.