public boolean isLastProviderInDetachedWindow(ComponentProvider provider) {

		Window providerWindow = getProviderWindow(provider);
		WindowNode providerNode = root.getNodeForWindow(providerWindow);
		if (!(providerNode instanceof DetachedWindowNode windowNode)) {
			return false;
		}

		return windowNode.getComponentCount() == 1;
	}
Returns true if the given provider is in a non-main window (a {@link DetachedWindowNode})
and is the last component provider in that window.
@param provider the provider
@return true if the last provider in a non-main window
Ghidra/Framework/Docking/src/main/java/docking/DockingWindowManager.java