Search in sources :

Example 26 with ZapMenuItem

use of org.zaproxy.zap.view.ZapMenuItem in project zaproxy by zaproxy.

the class ExtensionKeyboard method initAllMenuItems.

private void initAllMenuItems(JMenu menu) {
    for (Component c : menu.getMenuComponents()) {
        if (c instanceof ZapMenuItem) {
            this.registerMenuItem((ZapMenuItem) c);
        } else if (c instanceof JMenu) {
            initAllMenuItems((JMenu) c);
        } else if (c instanceof JMenuItem) {
            JMenuItem menuItem = (JMenuItem) c;
            logger.debug("Unable to set accelerators on menu " + menuItem.getText());
        }
    }
}
Also used : ZapMenuItem(org.zaproxy.zap.view.ZapMenuItem) Component(java.awt.Component) JMenuItem(javax.swing.JMenuItem) JMenu(javax.swing.JMenu)

Example 27 with ZapMenuItem

use of org.zaproxy.zap.view.ZapMenuItem in project zaproxy by zaproxy.

the class ExtensionFilter method getMenuToolsFilter.

/**
	 * This method initializes menuToolsFilter	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
private ZapMenuItem getMenuToolsFilter() {
    if (menuToolsFilter == null) {
        menuToolsFilter = new ZapMenuItem("menu.tools.filter");
        menuToolsFilter.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                FilterDialog dialog = new FilterDialog(getView().getMainFrame());
                dialog.setAllFilters(filterFactory.getAllFilter());
                dialog.showDialog(false);
                boolean startThread = false;
                for (Filter filter : filterFactory.getAllFilter()) {
                    if (filter.isEnabled()) {
                        startThread = true;
                        break;
                    }
                }
                if (startThread) {
                    if (timerFilterThread == null) {
                        timerFilterThread = new TimerFilterThread(filterFactory.getAllFilter());
                        timerFilterThread.start();
                    }
                } else if (timerFilterThread != null) {
                    timerFilterThread.setStopped();
                    timerFilterThread = null;
                }
            }
        });
    }
    return menuToolsFilter;
}
Also used : ZapMenuItem(org.zaproxy.zap.view.ZapMenuItem)

Example 28 with ZapMenuItem

use of org.zaproxy.zap.view.ZapMenuItem in project zaproxy by zaproxy.

the class ExtensionSearch method getMenuPrev.

private ZapMenuItem getMenuPrev() {
    if (menuPrev == null) {
        menuPrev = new ZapMenuItem("menu.edit.previous");
        menuPrev.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                searchPanel.highlightPrevResult();
            }
        });
    }
    return menuPrev;
}
Also used : ZapMenuItem(org.zaproxy.zap.view.ZapMenuItem)

Example 29 with ZapMenuItem

use of org.zaproxy.zap.view.ZapMenuItem in project zaproxy by zaproxy.

the class ExtensionReport method getMenuItemMdReport.

private ZapMenuItem getMenuItemMdReport() {
    if (menuItemMdReport == null) {
        menuItemMdReport = new ZapMenuItem("menu.report.md.generate");
        menuItemMdReport.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                ReportLastScan report = new ReportLastScan();
                report.generateReport(getView(), getModel(), ReportLastScan.ReportType.MD);
            }
        });
    }
    return menuItemMdReport;
}
Also used : ZapMenuItem(org.zaproxy.zap.view.ZapMenuItem)

Example 30 with ZapMenuItem

use of org.zaproxy.zap.view.ZapMenuItem in project zaproxy by zaproxy.

the class ExtensionReport method getMenuItemHtmlReport.

private ZapMenuItem getMenuItemHtmlReport() {
    if (menuItemHtmlReport == null) {
        menuItemHtmlReport = new ZapMenuItem("menu.report.html.generate");
        menuItemHtmlReport.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                ReportLastScan report = new ReportLastScan();
                report.generateReport(getView(), getModel(), ReportLastScan.ReportType.HTML);
            }
        });
    }
    return menuItemHtmlReport;
}
Also used : ZapMenuItem(org.zaproxy.zap.view.ZapMenuItem)

Aggregations

ZapMenuItem (org.zaproxy.zap.view.ZapMenuItem)42 ActionEvent (java.awt.event.ActionEvent)14 Component (java.awt.Component)3 ActionListener (java.awt.event.ActionListener)2 JMenu (javax.swing.JMenu)2 JMenuItem (javax.swing.JMenuItem)2 Target (org.zaproxy.zap.model.Target)2 File (java.io.File)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 FileAlreadyExistsException (java.nio.file.FileAlreadyExistsException)1 JFileChooser (javax.swing.JFileChooser)1 JList (javax.swing.JList)1 JTree (javax.swing.JTree)1 FileFilter (javax.swing.filechooser.FileFilter)1 TreePath (javax.swing.tree.TreePath)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1 HistoryReference (org.parosproxy.paros.model.HistoryReference)1 SiteNode (org.parosproxy.paros.model.SiteNode)1 HttpMessage (org.parosproxy.paros.network.HttpMessage)1