Search in sources :

Example 11 with ZapMenuItem

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

the class MainMenuBar method getMenuFileNewSession.

private JMenuItem getMenuFileNewSession() {
    if (menuFileNewSession == null) {
        menuFileNewSession = new ZapMenuItem("menu.file.newSession", View.getSingleton().getMenuShortcutKeyStroke(KeyEvent.VK_N, 0, false));
        menuFileNewSession.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                try {
                    getMenuFileControl().newSession(true);
                    if (Model.getSingleton().getSession().isNewState()) {
                        toggleSnapshotState(false);
                    }
                } catch (Exception e1) {
                    View.getSingleton().showWarningDialog(Constant.messages.getString(// ZAP: i18n
                    "menu.file.newSession.error"));
                    logger.error(e1.getMessage(), e1);
                }
            }
        });
    }
    return menuFileNewSession;
}
Also used : ZapMenuItem(org.zaproxy.zap.view.ZapMenuItem) ActionEvent(java.awt.event.ActionEvent)

Example 12 with ZapMenuItem

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

the class MainMenuBar method getMenuFileSnapshot.

private JMenuItem getMenuFileSnapshot() {
    if (menuFileSnapshot == null) {
        menuFileSnapshot = new ZapMenuItem("menu.file.snapshotSession");
        menuFileSnapshot.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                if (!Model.getSingleton().getSession().isNewState()) {
                    getMenuFileControl().saveSnapshot();
                } else {
                    View.getSingleton().showWarningDialog(Constant.messages.getString("menu.file.snapshotSession.error"));
                }
            }
        });
        toggleSnapshotState(false);
    }
    return menuFileSnapshot;
}
Also used : ZapMenuItem(org.zaproxy.zap.view.ZapMenuItem) ActionEvent(java.awt.event.ActionEvent)

Example 13 with ZapMenuItem

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

the class MainMenuBar method getMenuContextImport.

private ZapMenuItem getMenuContextImport() {
    if (menuFileContextImport == null) {
        menuFileContextImport = new ZapMenuItem("menu.file.context.import");
        menuFileContextImport.addActionListener(new java.awt.event.ActionListener() {

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

Example 14 with ZapMenuItem

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

the class MainMenuBar method getMenuFileOpen.

private JMenuItem getMenuFileOpen() {
    if (menuFileOpen == null) {
        menuFileOpen = new ZapMenuItem("menu.file.openSession", View.getSingleton().getMenuShortcutKeyStroke(KeyEvent.VK_O, 0, false));
        menuFileOpen.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                getMenuFileControl().openSession();
                if (!Model.getSingleton().getSession().isNewState()) {
                    toggleSnapshotState(true);
                }
            }
        });
    }
    return menuFileOpen;
}
Also used : ZapMenuItem(org.zaproxy.zap.view.ZapMenuItem) ActionEvent(java.awt.event.ActionEvent)

Example 15 with ZapMenuItem

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

the class MainMenuBar method getMenuFileProperties.

private ZapMenuItem getMenuFileProperties() {
    if (menuFileProperties == null) {
        menuFileProperties = new ZapMenuItem("menu.file.properties", View.getSingleton().getMenuShortcutKeyStroke(KeyEvent.VK_P, KeyEvent.ALT_DOWN_MASK, false));
        menuFileProperties.setText(// ZAP: i18n
        Constant.messages.getString("menu.file.properties"));
        menuFileProperties.addActionListener(new java.awt.event.ActionListener() {

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

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