docs: private PopupMenuItemSiteNodeContextMenuFactory getPopupFlagLoginRequestMenuFactory() {
  		PopupMenuItemSiteNodeContextMenuFactory popupFlagLoginRequestMenuFactory = new PopupMenuItemSiteNodeContextMenuFactory(
  				Constant.messages.getString("context.flag.popup")) {
  			private static final long serialVersionUID = 8927418764L;
  
  			@Override
  			public PopupMenuItemContext getContextMenu(Context context, String parentMenu) {
  				return new PopupMenuItemContext(context, parentMenu, 
  						Constant.messages.getString(labelPopupMenuKey, context.getName())) {
  
  					private static final long serialVersionUID = 1967885623005183801L;
  					private ExtensionUserManagement usersExtension;
  					private Context uiSharedContext;
  
  					/**
  					 * Make sure the user acknowledges the Users corresponding to this context will
  					 * be deleted.
  					 * 
  					 * @return true, if successful
  					 */
  					private boolean confirmUsersDeletion(Context uiSharedContext) {
  						usersExtension = Control.getSingleton().getExtensionLoader().getExtension(ExtensionUserManagement.class);
  						if (usersExtension != null) {
  							if (usersExtension.getSharedContextUsers(uiSharedContext).size() > 0) {
  								int choice = JOptionPane.showConfirmDialog(this, Constant.messages
  										.getString("authentication.dialog.confirmChange.label"),
  										Constant.messages
  												.getString("authentication.dialog.confirmChange.title"),
  										JOptionPane.OK_CANCEL_OPTION);
  								if (choice == JOptionPane.CANCEL_OPTION) {
  									return false;
  								}
  							}
  						}
  						return true;
  					}
  
  					@Override
  					public void performAction(SiteNode sn) {
  						// Manually create the UI shared contexts so any modifications are done
  						// on an UI shared Context, so changes can be undone by pressing Cancel
  						SessionDialog sessionDialog = View.getSingleton().getSessionDialog();
  						sessionDialog.recreateUISharedContexts(Model.getSingleton().getSession());
  						uiSharedContext = sessionDialog.getUISharedContext(this.getContext().getIndex());
  
  						// Do the work/changes on the UI shared context
  						if (isTypeForMethod(this.getContext().getAuthenticationMethod())) {
  							LOGGER.info("Selected new login request via PopupMenu. Changing existing " + methodName + " instance for Context "
  									+ getContext().getIndex());
  							PostBasedAuthenticationMethod method = (PostBasedAuthenticationMethod) uiSharedContext
  									.getAuthenticationMethod();
  
  							try {
  								method.setLoginRequest(sn);
  							} catch (Exception e) {
  								LOGGER.error("Failed to set login request: " + e.getMessage(), e);
  								return;
  							}
  
  							// Show the session dialog without recreating UI Shared contexts
  							View.getSingleton()
  									.showSessionDialog(
  											Model.getSingleton().getSession(),
  											ContextAuthenticationPanel
  													.buildName(this.getContext().getIndex()), false);
  						} else {
  							LOGGER.info("Selected new login request via PopupMenu. Creating new " + methodName + " instance for Context "
  									+ getContext().getIndex());
  							PostBasedAuthenticationMethod method = createAuthenticationMethod(getContext().getIndex());
  
  							try {
  								method.setLoginRequest(sn);
  							} catch (Exception e) {
  								LOGGER.error("Failed to set login request: " + e.getMessage(), e);
  								return;
  							}
  							if (!confirmUsersDeletion(uiSharedContext)) {
  								LOGGER.debug("Cancelled change of authentication type.");
  								return;
  							}
  							uiSharedContext.setAuthenticationMethod(method);
  
  							// Show the session dialog without recreating UI Shared contexts
  							// NOTE: First init the panels of the dialog so old users data gets
  							// loaded and just then delete the users
  							// from the UI data model, otherwise the 'real' users from the
  							// non-shared context would be loaded
  							// and would override any deletions made.
  							View.getSingleton().showSessionDialog(Model.getSingleton().getSession(),
  									ContextAuthenticationPanel.buildName(this.getContext().getIndex()),
  									false, new Runnable() {
  
  										@Override
  										public void run() {
  											// Removing the users from the 'shared context' (the UI)
  											// will cause their removal at
  											// save as well
  											if (usersExtension != null)
  												usersExtension.removeSharedContextUsers(uiSharedContext);
  										}
  									});
  						}
  					}
  				};
  			}
  
  			@Override
  			public int getParentMenuIndex() {
  				return 3;
  			}
  		};
  		return popupFlagLoginRequestMenuFactory;
  	}