Injectable (final Language language) { return new Injectable() { @Override public @NotNull String getId() { return language.getID(); } @Override public @NotNull String getDisplayName() { return language.getDisplayName(); } @Override public @Nullable String getAdditionalDescription() { final FileType ft = language.getAssociatedFileType(); return ft != null ? " (" + ft.getDescription() + ")" : null; } @Override public @NotNull Icon getIcon() { final FileType ft = language.getAssociatedFileType(); return ft != null && ft.getIcon() != null ? ft.getIcon() : EmptyIcon.ICON_16; } @Override public Language getLanguage() { return language; } }; }