use of com.intellij.psi.codeStyle.CodeStyleSettingsProvider in project intellij-community by JetBrains.
the class XmlCodeStyleMainPanel method initTabs.
@Override
protected void initTabs(CodeStyleSettings settings) {
addIndentOptionsTab(settings);
addTab(new CodeStyleXmlPanel(settings));
addTab(new XmlArrangementPanel(settings));
for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
if (provider.getLanguage() == XMLLanguage.INSTANCE && !provider.hasSettingsPage()) {
createTab(provider);
}
}
}
use of com.intellij.psi.codeStyle.CodeStyleSettingsProvider in project intellij-community by JetBrains.
the class Utils method getLanguageSettings.
@Nullable
public static CustomCodeStyleSettings getLanguageSettings(@NotNull CodeStyleSettings settings, @NotNull Language language) {
for (CodeStyleSettingsProvider provider : CodeStyleSettingsProvider.EXTENSION_POINT_NAME.getExtensions()) {
if (language.equals(provider.getLanguage())) {
CustomCodeStyleSettings modelSettings = provider.createCustomSettings(settings);
if (modelSettings == null)
continue;
CustomCodeStyleSettings customSettings = settings.getCustomSettings(modelSettings.getClass());
if (customSettings != null) {
return customSettings;
}
}
}
logError("Failed to load CustomCodeStyleSettings for " + language);
return null;
}
use of com.intellij.psi.codeStyle.CodeStyleSettingsProvider in project intellij-community by JetBrains.
the class JavaCodeStyleMainPanel method initTabs.
@Override
protected void initTabs(CodeStyleSettings settings) {
super.initTabs(settings);
addTab(new JavaDocFormattingPanel(settings));
addTab(new CodeStyleImportsPanelWrapper(settings));
addTab(new JavaArrangementPanel(settings));
for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
if (provider.getLanguage() == JavaLanguage.INSTANCE && !provider.hasSettingsPage()) {
createTab(provider);
}
}
}
use of com.intellij.psi.codeStyle.CodeStyleSettingsProvider in project intellij-community by JetBrains.
the class CodeStyleSchemesConfigurable method buildConfigurables.
@Override
protected Configurable[] buildConfigurables() {
myPanels = new ArrayList<>();
final List<CodeStyleSettingsProvider> providers = Arrays.asList(Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME));
Collections.sort(providers, (p1, p2) -> {
if (!p1.getPriority().equals(p2.getPriority())) {
return p1.getPriority().compareTo(p2.getPriority());
}
String name1 = p1.getConfigurableDisplayName();
if (name1 == null)
name1 = "";
String name2 = p2.getConfigurableDisplayName();
if (name2 == null)
name2 = "";
return name1.compareToIgnoreCase(name2);
});
for (final CodeStyleSettingsProvider provider : providers) {
if (provider.hasSettingsPage()) {
CodeStyleConfigurableWrapper e = ConfigurableFactory.Companion.getInstance().createCodeStyleConfigurable(provider, ensureModel(), this);
myPanels.add(e);
}
}
int size = myPanels.size();
Configurable[] result = new Configurable[size > 0 ? size - 1 : 0];
for (int i = 0; i < result.length; i++) {
result[i] = myPanels.get(i + 1);
}
return result;
}
use of com.intellij.psi.codeStyle.CodeStyleSettingsProvider in project intellij-community by JetBrains.
the class GroovyCodeStyleMainPanel method initTabs.
@Override
protected void initTabs(CodeStyleSettings settings) {
super.initTabs(settings);
addTab(new GrCodeStyleImportsPanelWrapper(settings));
for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
if (provider.getLanguage() == GroovyLanguage.INSTANCE && !provider.hasSettingsPage()) {
createTab(provider);
}
}
}
Aggregations