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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations