Search in sources :

Example 1 with CodeStyleAbstractPanel

use of com.intellij.application.options.CodeStyleAbstractPanel 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)

Aggregations

CodeStyleAbstractPanel (com.intellij.application.options.CodeStyleAbstractPanel)1 TabbedLanguageCodeStylePanel (com.intellij.application.options.TabbedLanguageCodeStylePanel)1