Search in sources :

Example 1 with TabbedLanguageCodeStylePanel

use of com.intellij.application.options.TabbedLanguageCodeStylePanel in project intellij-community by JetBrains.

the class YAMLCodeStyleSettingsProvider method createSettingsPage.

@NotNull
@Override
public Configurable createSettingsPage(final CodeStyleSettings settings, final CodeStyleSettings originalSettings) {
    return new CodeStyleAbstractConfigurable(settings, originalSettings, YAMLLanguage.INSTANCE.getDisplayName()) {

        @Override
        protected CodeStyleAbstractPanel createPanel(final CodeStyleSettings settings) {
            final CodeStyleSettings currentSettings = getCurrentSettings();
            final CodeStyleSettings settings1 = settings;
            return new TabbedLanguageCodeStylePanel(YAMLLanguage.INSTANCE, currentSettings, settings1) {

                @Override
                protected void initTabs(final CodeStyleSettings settings) {
                    addIndentOptionsTab(settings);
                }
            };
        }

        @Override
        public String getHelpTopic() {
            return "reference.settingsdialog.codestyle.yaml";
        }
    };
}
Also used : CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) CodeStyleAbstractConfigurable(com.intellij.application.options.CodeStyleAbstractConfigurable) TabbedLanguageCodeStylePanel(com.intellij.application.options.TabbedLanguageCodeStylePanel) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with TabbedLanguageCodeStylePanel

use of com.intellij.application.options.TabbedLanguageCodeStylePanel in project intellij-community by JetBrains.

the class CodeStyleMainPanel method ensurePanel.

private NewCodeStyleSettingsPanel ensurePanel(final CodeStyleScheme scheme) {
    String name = scheme.getName();
    if (!mySettingsPanels.containsKey(name)) {
        NewCodeStyleSettingsPanel panel = myFactory.createPanel(scheme);
        panel.reset(scheme.getCodeStyleSettings());
        panel.setModel(myModel);
        CodeStyleAbstractPanel settingsPanel = panel.getSelectedPanel();
        if (settingsPanel instanceof TabbedLanguageCodeStylePanel) {
            TabbedLanguageCodeStylePanel tabbedPanel = (TabbedLanguageCodeStylePanel) settingsPanel;
            tabbedPanel.setListener(this);
            String currentTab = myProperties.getValue(getSelectedTabPropertyName(tabbedPanel));
            if (currentTab != null) {
                tabbedPanel.changeTab(currentTab);
            }
        }
        mySettingsPanels.put(name, panel);
        mySettingsPanel.add(scheme.getName(), panel);
    }
    return mySettingsPanels.get(name);
}
Also used : CodeStyleAbstractPanel(com.intellij.application.options.CodeStyleAbstractPanel) TabbedLanguageCodeStylePanel(com.intellij.application.options.TabbedLanguageCodeStylePanel)

Example 3 with TabbedLanguageCodeStylePanel

use of com.intellij.application.options.TabbedLanguageCodeStylePanel in project intellij-community by JetBrains.

the class JsonCodeStyleSettingsProvider method createSettingsPage.

@NotNull
@Override
public Configurable createSettingsPage(CodeStyleSettings settings, CodeStyleSettings originalSettings) {
    return new CodeStyleAbstractConfigurable(settings, originalSettings, "JSON") {

        @Override
        protected CodeStyleAbstractPanel createPanel(CodeStyleSettings settings) {
            final Language language = JsonLanguage.INSTANCE;
            final CodeStyleSettings currentSettings = getCurrentSettings();
            return new TabbedLanguageCodeStylePanel(language, currentSettings, settings) {

                @Override
                protected void initTabs(CodeStyleSettings settings) {
                    addIndentOptionsTab(settings);
                    addSpacesTab(settings);
                    addBlankLinesTab(settings);
                    addWrappingAndBracesTab(settings);
                    addTab(new JsonCodeStylePanel(settings));
                }
            };
        }

        @Nullable
        @Override
        public String getHelpTopic() {
            return "reference.settingsdialog.codestyle.json";
        }
    };
}
Also used : CustomCodeStyleSettings(com.intellij.psi.codeStyle.CustomCodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) Language(com.intellij.lang.Language) JsonLanguage(com.intellij.json.JsonLanguage) CodeStyleAbstractConfigurable(com.intellij.application.options.CodeStyleAbstractConfigurable) TabbedLanguageCodeStylePanel(com.intellij.application.options.TabbedLanguageCodeStylePanel) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

TabbedLanguageCodeStylePanel (com.intellij.application.options.TabbedLanguageCodeStylePanel)3 CodeStyleAbstractConfigurable (com.intellij.application.options.CodeStyleAbstractConfigurable)2 CodeStyleSettings (com.intellij.psi.codeStyle.CodeStyleSettings)2 NotNull (org.jetbrains.annotations.NotNull)2 CodeStyleAbstractPanel (com.intellij.application.options.CodeStyleAbstractPanel)1 JsonLanguage (com.intellij.json.JsonLanguage)1 Language (com.intellij.lang.Language)1 CustomCodeStyleSettings (com.intellij.psi.codeStyle.CustomCodeStyleSettings)1