private void setFocusedComponent(ComponentPlaceholder placeholder) {

		RootNode rootNode = root;
		if (rootNode == null) {
			return; // we have been disposed 
		}

		if (focusedPlaceholder != null) {
			if (focusedPlaceholder == placeholder) {
				return; // ignore if we are already focused
			}

			focusedPlaceholder.setSelected(false);
		}

		focusedPlaceholder = placeholder;

		// put the last focused placeholder at the front of the list for restoring focus work later
		lastFocusedPlaceholders.add(focusedPlaceholder);

		focusedPlaceholder.setSelected(true);
		WindowNode topLevelNode = focusedPlaceholder.getTopLevelNode();
		if (topLevelNode == null) {
			return;
		}

		topLevelNode.setLastFocusedProviderInWindow(focusedPlaceholder);
		rootNode.notifyWindowFocusChanged(topLevelNode);
	}
Builds the window menu containing a menu item for each component.
Ghidra/Framework/Docking/src/main/java/docking/DockingWindowManager.java