public void apply() { CodeStyleSettingsManager projectSettingsManager = getProjectSettings(); projectSettingsManager.USE_PER_PROJECT_SETTINGS = myUsePerProjectSettings; projectSettingsManager.PREFERRED_PROJECT_CODE_STYLE = myUsePerProjectSettings || myGlobalSelected == null ? null : myGlobalSelected.getName(); projectSettingsManager.PER_PROJECT_SETTINGS = myProjectScheme.getCodeStyleSettings(); ((CodeStyleSchemesImpl)CodeStyleSchemes.getInstance()).getSchemeManager().setSchemes(mySchemes, myGlobalSelected, null); // We want to avoid the situation when 'real code style' differs from the copy stored here (e.g. when 'real code style' changes // are 'committed' by pressing 'Apply' button). So, we reset the copies here assuming that this method is called on 'Apply' // button processing mySettingsToClone.clear(); }
static SchemesManager<CodeStyleScheme, CodeStyleSchemeImpl> getSchemesManager() { return ((CodeStyleSchemesImpl) CodeStyleSchemes.getInstance()).getSchemesManager(); }