mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix applying of predefined style when code style configurable is wrapped in a tab
This commit is contained in:
+6
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user