use of com.intellij.application.options.codeStyle.CodeStyleSettingsListener 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;
}
Aggregations