use of com.intellij.psi.codeStyle.CodeStyleScheme in project intellij-community by JetBrains.
the class CodeStyleSchemesActions method duplicateScheme.
@Override
protected void duplicateScheme(@NotNull CodeStyleScheme scheme, @NotNull String newName) {
if (!getModel().isProjectScheme(scheme)) {
CodeStyleScheme newScheme = getModel().createNewScheme(newName, getCurrentScheme());
getModel().addScheme(newScheme, true);
}
}
use of com.intellij.psi.codeStyle.CodeStyleScheme in project intellij-community by JetBrains.
the class CodeStyleSchemesModel method isSchemeListModified.
public boolean isSchemeListModified() {
CodeStyleSchemes schemes = CodeStyleSchemes.getInstance();
if (getProjectSettings().USE_PER_PROJECT_SETTINGS != myUsePerProjectSettings)
return true;
if (!myUsePerProjectSettings && getSelectedScheme() != schemes.findPreferredScheme(getProjectSettings().PREFERRED_PROJECT_CODE_STYLE)) {
return true;
}
Set<CodeStyleScheme> configuredSchemesSet = new HashSet<>(getSchemes());
return !configuredSchemesSet.equals(new THashSet<>(CodeStyleSchemesImpl.getSchemeManager().getAllSchemes()));
}
use of com.intellij.psi.codeStyle.CodeStyleScheme in project intellij-community by JetBrains.
the class CodeStyleSchemesModel method exportProjectScheme.
public CodeStyleScheme exportProjectScheme(@NotNull String name) {
CodeStyleScheme newScheme = createNewScheme(name, myProjectScheme);
((CodeStyleSchemeImpl) newScheme).setCodeStyleSettings(getCloneSettings(myProjectScheme));
addScheme(newScheme, false);
return newScheme;
}
use of com.intellij.psi.codeStyle.CodeStyleScheme in project intellij-community by JetBrains.
the class CodeStyleSchemesPanel method onCombo.
private void onCombo() {
CodeStyleScheme selected = getSelectedScheme();
if (selected != null) {
if (myModel.isProjectScheme(selected)) {
myModel.setUsePerProjectSettings(true);
} else {
myModel.selectScheme(selected, this);
myModel.setUsePerProjectSettings(false);
}
}
}
use of com.intellij.psi.codeStyle.CodeStyleScheme in project intellij-community by JetBrains.
the class CodeStyleSchemesPanel method createSchemeActions.
@Override
protected AbstractSchemeActions<CodeStyleScheme> createSchemeActions() {
return new CodeStyleSchemesActions(this) {
@Override
protected void onSchemeChanged(@Nullable CodeStyleScheme scheme) {
if (!myIsReset) {
ApplicationManager.getApplication().invokeLater(() -> onCombo());
}
}
@Override
protected void renameScheme(@NotNull CodeStyleScheme scheme, @NotNull String newName) {
CodeStyleSchemeImpl newScheme = new CodeStyleSchemeImpl(newName, false, scheme);
myModel.addScheme(newScheme, false);
myModel.removeScheme(scheme);
myModel.selectScheme(newScheme, null);
}
};
}
Aggregations