DropDownLink<InspectionsLevel> (@NotNull LanguageHighlightLevel level, @NotNull UIController controller, @NotNull @Nls String prefix) { return new DropDownLink<>(level.getLevel(), controller.getAvailableLevels(), inspectionsLevel -> { controller.setHighLightLevel(new LanguageHighlightLevel(level.getLangID(), inspectionsLevel)); myContent.revalidate(); Dimension size = myContent.getPreferredSize(); size.width = Math.max(size.width, JBUIScale.scale(296)); myPopup.setSize(size); }, true) { @Override protected @NotNull String itemToString(@NotNull InspectionsLevel item) { return prefix + item; } }; }