Expandable (AnActionEvent event) { Object component = event.getData(CONTEXT_COMPONENT); if (component instanceof Expandable) return (Expandable)component; if (component instanceof JComponent container) { Object property = container.getClientProperty(Expandable.class); if (property instanceof Expandable) return (Expandable)property; } return null; }