OptionsPanelInfo (@NotNull OptComponent component, @NotNull OptionController controller) { final OptionsPanelInfo result = new OptionsPanelInfo(); result.type = component.getClass().getSimpleName(); result.value = component instanceof OptControl control ? controller.getOption(control.bindId()) : null; if (component instanceof OptDropdown dropdown) { if (result.value != null) { OptDropdown.Option option = dropdown.findOption(result.value); result.value = option == null ? null : option.label().label(); } result.content = ContainerUtil.map(dropdown.options(), opt -> opt.label().label()); } LocMessage text = getMyText(component); result.text = text == null ? null : text.label(); if (component instanceof OptDescribedComponent describedComponent) { HtmlChunk description = describedComponent.description(); result.description = description == null ? null : description.toString(); } List<OptionsPanelInfo> children = new ArrayList<>(); for (OptComponent child : component.children()) { children.add(retrievePanelStructure(child, controller)); } if (!children.isEmpty()) { result.children = children; } return result; }