diff --git a/platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractConfigurable.java b/platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractConfigurable.java index 793790b0c7bd..58662d694d9b 100644 --- a/platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractConfigurable.java +++ b/platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractConfigurable.java @@ -62,14 +62,16 @@ public abstract class CodeStyleAbstractConfigurable implements Configurable, Opt @Override public void reset() { - if (myPanel != null) { - myPanel.reset(mySettings); - } + reset(mySettings); } public void resetFromClone(){ + reset(myCloneSettings); + } + + public void reset(CodeStyleSettings settings) { if (myPanel != null) { - myPanel.reset(myCloneSettings); + myPanel.reset(settings); } } diff --git a/platform/lang-impl/src/com/intellij/application/options/TabbedLanguageCodeStylePanel.java b/platform/lang-impl/src/com/intellij/application/options/TabbedLanguageCodeStylePanel.java index 35a2ba0a6a00..207e393d40c6 100644 --- a/platform/lang-impl/src/com/intellij/application/options/TabbedLanguageCodeStylePanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/TabbedLanguageCodeStylePanel.java @@ -541,7 +541,16 @@ public abstract class TabbedLanguageCodeStylePanel extends CodeStyleAbstractPane @Override protected void resetImpl(CodeStyleSettings settings) { - myConfigurable.reset(); + if (myConfigurable instanceof CodeStyleAbstractConfigurable) { + // when a predefined style is chosen and the configurable is wrapped in a tab, + // we apply it to CLONED code style settings and then pass them to this method to reset, + // usual reset() won't work in such case + ((CodeStyleAbstractConfigurable)myConfigurable).reset(settings); + } + else { + // todo: support for other configurables + myConfigurable.reset(); + } } }