public static void registerComponentLoadedListener(Component component,
			ComponentLoadedListener listener) {

		component.addHierarchyListener(new HierarchyListener() {
			@Override
			public void hierarchyChanged(HierarchyEvent e) {

				long changeFlags = e.getChangeFlags();
				if (HierarchyEvent.DISPLAYABILITY_CHANGED != (changeFlags &
					HierarchyEvent.DISPLAYABILITY_CHANGED)) {
					return;
				}

				// check for the first time we are put together
				boolean isDisplayable = component.isDisplayable();
				if (!isDisplayable) {
					return;
				}

				component.removeHierarchyListener(this);
				DockingWindowManager dwm = getInstance(component);
				ComponentProvider provider = null;
				if (dwm != null) {
					provider = dwm.getComponentProvider(component);
				}

				listener.componentLoaded(dwm, provider);
			}
		});
	}
Registers a callback to be notified when the given component has been parented to a docking
window manager

@param component the component that will be parented in a docking window system
@param listener the listener to be notified the component was parented
Ghidra/Framework/Docking/src/main/java/docking/DockingWindowManager.java