use of org.parosproxy.paros.extension.ExtensionPopupMenuItem in project zaproxy by zaproxy.
the class PopupUserMenuItemHolder 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 users
Session session = Model.getSingleton().getSession();
List<Context> contexts = session.getContexts();
for (Context context : contexts) {
ContextUserAuthManager manager = extensionUserAuth.getContextUserAuthManager(context.getIndex());
for (User user : manager.getUsers()) {
ExtensionPopupMenuItem piicm;
if (visibleItself) {
piicm = getPopupUserMenu(context, user, this.getText());
this.add(piicm);
} else {
piicm = getPopupUserMenu(context, user, this.parentName);
piicm.setMenuIndex(this.getMenuIndex());
mainPopupMenuItems.add(piicm);
subMenuItems.add(piicm);
}
}
}
}
use of org.parosproxy.paros.extension.ExtensionPopupMenuItem in project zaproxy by zaproxy.
the class PopupMenuItemContextInclude method reCreateSubMenu.
protected void reCreateSubMenu() {
final List<JMenuItem> mainPopupMenuItems = View.getSingleton().getPopupList();
for (ExtensionPopupMenuItem menu : subMenus) {
mainPopupMenuItems.remove(menu);
}
subMenus.clear();
Session session = Model.getSingleton().getSession();
List<Context> contexts = session.getContexts();
for (Context context : contexts) {
ExtensionPopupMenuItem piicm = createPopupIncludeInContextMenu(context);
piicm.setMenuIndex(this.getMenuIndex());
mainPopupMenuItems.add(piicm);
this.subMenus.add(piicm);
}
// Add the 'new context' menu
ExtensionPopupMenuItem piicm = createPopupIncludeInContextMenu();
mainPopupMenuItems.add(piicm);
this.subMenus.add(piicm);
}
use of org.parosproxy.paros.extension.ExtensionPopupMenuItem 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.extension.ExtensionPopupMenuItem 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.extension.ExtensionPopupMenuItem in project zaproxy by zaproxy.
the class PopupMenuItemSiteNodeContextMenuFactory method isButtonEnabledForSiteNode.
@Override
public boolean isButtonEnabledForSiteNode(SiteNode sn) {
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;
}
Aggregations