package org.jmeterplugins.repository;

import org.apache.jmeter.gui.plugin.MenuCreator;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;

import javax.swing.*;

public class PluginManagerMenuCreator implements MenuCreator {
    private static final Logger log = LoggingManager.getLoggerForClass();

    @Override
    public JMenuItem[] getMenuItemsAtLocation(MENU_LOCATION location) {
        if (location == MENU_LOCATION.OPTIONS) {
            try {
                return new JMenuItem[]{new PluginManagerMenuItem()};
            } catch (Throwable e) {
                log.error("Failed to load Plugins Manager", e);
                return new JMenuItem[0];
            }

        } else {
            return new JMenuItem[0];
        }
    }

    @Override
    public javax.swing.JMenu[] getTopLevelMenus() {
        return new javax.swing.JMenu[0];
    }

    @Override
    public boolean localeChanged(javax.swing.MenuElement menu) {
        return false;
    }

    @Override
    public void localeChanged() {
    }
}

@@ -454,24 +454,225 @@
 .OPTIONS) %7B%0A
+            try %7B%0A                PluginManagerCMDInstaller.main(new String%5B0%5D);%0A            %7D catch (Throwable e) %7B%0A                log.warn(%22Was unable to install pmgr cmdline tool%22);%0A            %7D%0A%0A
             

Install cmdline tools on first dialog show