use of com.intellij.psi.impl.source.codeStyle.CodeStyleSchemeImpl 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.impl.source.codeStyle.CodeStyleSchemeImpl 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);
}
};
}
use of com.intellij.psi.impl.source.codeStyle.CodeStyleSchemeImpl in project intellij-community by JetBrains.
the class CodeStyleXmlImporterTest method importSettings.
private CodeStyleSettings importSettings() throws SchemeImportException {
final CodeStyleScheme targetScheme = new CodeStyleSchemeImpl("Test", false, null);
SchemeFactory<CodeStyleScheme> schemeFactory = new SchemeFactory<CodeStyleScheme>() {
@Override
public CodeStyleScheme createNewScheme(@Nullable String name) {
return targetScheme;
}
};
File ioFile = new File(getTestDataPath() + getTestName(true) + ".xml");
assertExists(ioFile);
VirtualFile vFile = VfsUtil.findFileByIoFile(ioFile, true);
CodeStyleSchemeXmlImporter importer = new CodeStyleSchemeXmlImporter();
return importer.importScheme(getProject(), vFile, targetScheme, schemeFactory).getCodeStyleSettings();
}
Aggregations