private JMenu getMenuForSelection(MenuElement[] selectedPath) {
		for (MenuElement element : selectedPath) {
			if (element instanceof JMenu) {
				return (JMenu) element;
			}
		}
		return null;
	}
Builds the window menu containing a menu item for each component.
Ghidra/Framework/Docking/src/main/java/docking/DockingWindowManager.java