Search in sources :

Example 1 with CodeStyleSchemesPanel

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

the class CodeStyleSchemesConfigurable method ensureModel.

CodeStyleSchemesModel ensureModel() {
    if (myModel == null) {
        myModel = new CodeStyleSchemesModel(myProject);
        myRootSchemesPanel = new CodeStyleSchemesPanel(myModel);
        myModel.addListener(new CodeStyleSettingsListener() {

            @Override
            public void currentSchemeChanged(final Object source) {
                if (source != myRootSchemesPanel) {
                    myRootSchemesPanel.onSelectedSchemeChanged();
                }
            }

            @Override
            public void schemeListChanged() {
                myRootSchemesPanel.resetSchemesCombo();
            }

            @Override
            public void beforeCurrentSettingsChanged() {
            }

            @Override
            public void afterCurrentSettingsChanged() {
            }

            @Override
            public void usePerProjectSettingsOptionChanged() {
                myRootSchemesPanel.usePerProjectSettingsOptionChanged();
            }

            @Override
            public void schemeChanged(final CodeStyleScheme scheme) {
                if (scheme == myModel.getSelectedScheme())
                    myRootSchemesPanel.onSelectedSchemeChanged();
            }
        });
    }
    return myModel;
}
Also used : CodeStyleSchemesPanel(com.intellij.application.options.codeStyle.CodeStyleSchemesPanel) CodeStyleScheme(com.intellij.psi.codeStyle.CodeStyleScheme) CodeStyleSchemesModel(com.intellij.application.options.codeStyle.CodeStyleSchemesModel) CodeStyleSettingsListener(com.intellij.application.options.codeStyle.CodeStyleSettingsListener)

Aggregations

CodeStyleSchemesModel (com.intellij.application.options.codeStyle.CodeStyleSchemesModel)1 CodeStyleSchemesPanel (com.intellij.application.options.codeStyle.CodeStyleSchemesPanel)1 CodeStyleSettingsListener (com.intellij.application.options.codeStyle.CodeStyleSettingsListener)1 CodeStyleScheme (com.intellij.psi.codeStyle.CodeStyleScheme)1