本文整理汇总了Java中com.intellij.psi.codeStyle.CodeStyleSettings.writeExternal方法的典型用法代码示例。如果您正苦于以下问题:Java CodeStyleSettings.writeExternal方法的具体用法?Java CodeStyleSettings.writeExternal怎么用?Java CodeStyleSettings.writeExternal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.codeStyle.CodeStyleSettings
的用法示例。
在下文中一共展示了CodeStyleSettings.writeExternal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.intellij.psi.codeStyle.CodeStyleSettings; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
myOldSettings = new Element("dummy2");
settings.writeExternal(myOldSettings);
settings.FIELD_NAME_PREFIX = "my";
settings.STATIC_FIELD_NAME_PREFIX = "our";
}
示例2: testReformatInsertsNewlines
import com.intellij.psi.codeStyle.CodeStyleSettings; //导入方法依赖的package包/类
public void testReformatInsertsNewlines() throws Exception {
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
final Element root = new Element("fake");
settings.writeExternal(root);
try {
settings.getIndentOptions(StdFileTypes.JAVA).USE_TAB_CHARACTER = true;
settings.getIndentOptions(StdFileTypes.JAVA).SMART_TABS = true;
settings.IF_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_ALWAYS;
settings.METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
doTest();
} finally {
settings.readExternal(root);
}
}
示例3: checkSettingsEqual
import com.intellij.psi.codeStyle.CodeStyleSettings; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected static void checkSettingsEqual(CodeStyleSettings expected, CodeStyleSettings settings, String message) throws Exception {
if (expected == null || settings == null) return;
Element oldS = new Element("temp");
expected.writeExternal(oldS);
Element newS = new Element("temp");
settings.writeExternal(newS);
String newString = JDOMUtil.writeElement(newS, "\n");
String oldString = JDOMUtil.writeElement(oldS, "\n");
Assert.assertEquals(message, oldString, newString);
}