BuildView (@NotNull Component component) { Component parent = component; while ((parent = parent.getParent()) != null) { if (parent instanceof BuildView) { return (BuildView)parent; } } return null; }