protected JPopupMenu doCreateMenu() {

		JPopupMenu menu = new JPopupMenu();
		ButtonGroup buttonGroup = new ButtonGroup();
		for (ButtonState<T> state : buttonStates) {

			JCheckBoxMenuItem item = new JCheckBoxMenuItem(state.getMenuText());
			item.setToolTipText(state.getDescription());
			item.getAccessibleContext().setAccessibleDescription(state.getDescription());
			item.setSelected(state == currentButtonState);
			buttonGroup.add(item);

			// a UI that handles alignment issues and allows for tabulating presentation
			item.setUI(DockingMenuItemUI.createUI(item));
			item.addActionListener(e -> {
				setCurrentButtonState(state);
			});

			menu.add(item);
		}
		return menu;
	}
Show a popup containing all the actions below the button

@return the popup menu that was shown
Ghidra/Framework/Docking/src/main/java/docking/menu/MultiStateButton.java