protected int getItemCount(JPopupMenu popup) {
		int count = 0;
		int n = popup.getComponentCount();
		for (int i = 0; i < n; i++) {
			Component c = popup.getComponent(i);
			if (isValidItem(c)) {
				count++;
			}
		}
		return count;
	}
The work method of this handler.  This method will only be called when a menu or popup
menu is open.

@param manager the active menu selection manager
@param path the active menu path
Ghidra/Framework/Docking/src/main/java/docking/menu/keys/MenuKeyHandler.java