@Override public void apply() throws ConfigurationException { if (!myApplyCompleted) { try { super.apply(); for (CodeStyleScheme scheme : new ArrayList<CodeStyleScheme>(myModel.getSchemes())) { final boolean isDefaultModified = CodeStyleSchemesModel.cannotBeModified(scheme) && isSchemeModified(scheme); if (isDefaultModified) { CodeStyleScheme newscheme = myModel.createNewScheme(null, scheme); CodeStyleSettings settingsWillBeModified = scheme.getCodeStyleSettings(); CodeStyleSettings notModifiedSettings = settingsWillBeModified.clone(); ((CodeStyleSchemeImpl)scheme).setCodeStyleSettings(notModifiedSettings); ((CodeStyleSchemeImpl)newscheme).setCodeStyleSettings(settingsWillBeModified); myModel.addScheme(newscheme, false); if (myModel.getSelectedScheme() == scheme) { myModel.selectScheme(newscheme, this); } } } for (CodeStyleConfigurableWrapper panel : myPanels) { panel.applyPanel(); } myModel.apply(); EditorFactory.getInstance().refreshAllEditors(); } finally { myApplyCompleted = true; } } }
public CodeStyleScheme exportProjectScheme(@NotNull String name) { CodeStyleScheme newScheme = createNewScheme(name, myProjectScheme); ((CodeStyleSchemeImpl)newScheme).setCodeStyleSettings(getCloneSettings(myProjectScheme)); addScheme(newScheme, false); return newScheme; }
public CodeStyleScheme exportProjectScheme(final String name) { CodeStyleScheme newScheme = createNewScheme(name, myProjectScheme); ((CodeStyleSchemeImpl)newScheme).setCodeStyleSettings(getCloneSettings(myProjectScheme)); addScheme(newScheme, false); return newScheme; }
public CodeStyleScheme exportProjectScheme(@Nonnull String name) { CodeStyleScheme newScheme = createNewScheme(name, myProjectScheme); ((CodeStyleSchemeImpl)newScheme).setCodeStyleSettings(getCloneSettings(myProjectScheme)); addScheme(newScheme, false); return newScheme; }
public CodeStyleSchemesModel(Project project) { myProject = project; myProjectScheme = new CodeStyleSchemeImpl(PROJECT_SCHEME_NAME, false, CodeStyleSchemes.getInstance().getDefaultScheme()); reset(); myDefault = CodeStyleSchemes.getInstance().getDefaultScheme(); }
static SchemesManager<CodeStyleScheme, CodeStyleSchemeImpl> getSchemesManager() { return ((CodeStyleSchemesImpl) CodeStyleSchemes.getInstance()).getSchemesManager(); }