EditorSearchSession (@Nullable Editor editor) { JComponent headerComponent = editor != null ? editor.getHeaderComponent() : null; SearchReplaceComponent searchReplaceComponent = ObjectUtils.tryCast(headerComponent, SearchReplaceComponent.class); return searchReplaceComponent != null ? SESSION_KEY.getData(searchReplaceComponent) : null; }