void (@NotNull HierarchyEvent e) { if (isDisposed() || (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) <= 0) { return; } ContextAwareRunnable runnable = () -> { Component c = myComponent.get(); if (isDisposed() || c == null) { return; } if (UIUtil.isShowing(c, false)) { showNotify(); } else { hideNotify(); } }; if (myDeferred) { Application app = ApplicationManager.getApplication(); if (app != null && app.isDispatchThread()) { app.invokeLater(runnable, ModalityState.current()); } else { SwingUtilities.invokeLater(runnable); } } else { runnable.run(); } }