use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.
the class SpiderDialog method targetSelected.
@Override
public void targetSelected(String field, Target node) {
List<String> ctxNames = new ArrayList<>();
if (node != null) {
// The user has selected a new node
this.target = node;
if (node.getStartNode() != null) {
Session session = Model.getSingleton().getSession();
List<Context> contexts = session.getContextsForNode(node.getStartNode());
for (Context context : contexts) {
ctxNames.add(context.getName());
}
} else if (node.getContext() != null) {
ctxNames.add(node.getContext().getName());
}
}
this.setComboFields(FIELD_CONTEXT, ctxNames, "");
this.getField(FIELD_CONTEXT).setEnabled(ctxNames.size() > 0);
}
use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.
the class PopupContextMenuItemHolder method resetMenu.
private void resetMenu() {
final List<JMenuItem> mainPopupMenuItems = View.getSingleton().getPopupList();
// Remove existing popup menu items
if (visibleItself)
this.removeAll();
else {
for (ExtensionPopupMenuItem menu : getSubmenuItems()) {
mainPopupMenuItems.remove(menu);
}
subMenuItems.clear();
}
// Add a popup menu item for each existing context
Session session = Model.getSingleton().getSession();
List<Context> contexts = session.getContexts();
for (Context context : contexts) {
ExtensionPopupMenuItem piicm;
if (visibleItself) {
piicm = getPopupContextMenu(context, this.getText());
this.add(piicm);
} else {
piicm = getPopupContextMenu(context, this.parentName);
piicm.setMenuIndex(this.getMenuIndex());
mainPopupMenuItems.add(piicm);
subMenuItems.add(piicm);
}
}
}
use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.
the class PopupExcludeFromSpiderMenu method performAction.
@Override
public void performAction(SiteNode sn) {
try {
Session session = Model.getSingleton().getSession();
session.getExcludeFromSpiderRegexs().add(new StructuralSiteNode(sn).getRegexPattern());
} catch (DatabaseException e) {
// Ignore
}
}
use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.
the class PopupContextMenuItemFactory method isEnableForComponent.
@Override
public boolean isEnableForComponent(Component invoker) {
final List<JMenuItem> mainPopupMenuItems = View.getSingleton().getPopupList();
for (ExtensionPopupMenuItem menu : subMenus) {
mainPopupMenuItems.remove(menu);
}
subMenus.clear();
// Add the existing contexts
Session session = Model.getSingleton().getSession();
List<Context> contexts = session.getContexts();
for (Context context : contexts) {
ExtensionPopupMenuItem piicm = getContextMenu(context, this.parentMenu);
piicm.setMenuIndex(this.getMenuIndex());
mainPopupMenuItems.add(piicm);
this.subMenus.add(piicm);
}
return false;
}
use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.
the class SessionExcludeFromProxyPanel method initParam.
@Override
public void initParam(Object obj) {
Session session = (Session) obj;
regexesPanel.setRegexes(session.getExcludeFromProxyRegexs());
regexesPanel.setRemoveWithoutConfirmation(!Model.getSingleton().getOptionsParam().getViewParam().isConfirmRemoveProxyExcludeRegex());
}
Aggregations