void (@NotNull Component component) { if (component instanceof Frame) { // it makes sense for a frame only FrameState state = findFrameState(component); if (state == null) { component.addComponentListener(new Listener()); } } }