Java Code Examples for com.intellij.psi.codeStyle.CodeStyleSettings#IndentOptions

The following examples show how to use com.intellij.psi.codeStyle.CodeStyleSettings#IndentOptions . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BashFormatterTestCase.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
protected void setSettings(Project project) {
    Assert.assertNull(myTempSettings);
    CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
    myTempSettings = settings.clone();

    CodeStyleSettings.IndentOptions gr = myTempSettings.getIndentOptions(BashFileType.BASH_FILE_TYPE);
    Assert.assertNotSame(gr, settings.OTHER_INDENT_OPTIONS);
    gr.INDENT_SIZE = 2;
    gr.CONTINUATION_INDENT_SIZE = 4;
    gr.TAB_SIZE = 2;
    myTempSettings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = 3;

    CodeStyleSettingsManager.getInstance(project).setTemporarySettings(myTempSettings);
}
 
Example 2
Source File: HaxeFormatterTest.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
@Override
public void setTestStyleSettings() {
  Project project = getProject();
  CodeStyleSettings currSettings = CodeStyleSettingsManager.getSettings(project);
  assertNotNull(currSettings);
  CodeStyleSettings tempSettings = currSettings.clone();
  CodeStyleSettings.IndentOptions indentOptions = tempSettings.getIndentOptions(HaxeFileType.HAXE_FILE_TYPE);
  assertNotNull(indentOptions);
  defineStyleSettings(tempSettings);
  CodeStyleSettingsManager.getInstance(project).setTemporarySettings(tempSettings);
}
 
Example 3
Source File: HaxeCodeInsightFixtureTestCase.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
public void setTestStyleSettings(int indent) {
  Project project = getProject();
  CodeStyleSettings currSettings = CodeStyleSettingsManager.getSettings(project);
  assertNotNull(currSettings);
  CodeStyleSettings tempSettings = currSettings.clone();
  CodeStyleSettings.IndentOptions indentOptions = tempSettings.getIndentOptions(HaxeFileType.HAXE_FILE_TYPE);
  indentOptions.INDENT_SIZE = indent;
  assertNotNull(indentOptions);
  CodeStyleSettingsManager.getInstance(project).setTemporarySettings(tempSettings);
}
 
Example 4
Source File: XQueryFormattingModelBuilderTest.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
private void setTestStyleSettings() {
    CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(getProject());
    CodeStyleSettings currSettings = settingsManager.getCurrentSettings();
    Assert.assertNotNull(currSettings);
    myTemporarySettings = currSettings.clone();
    CodeStyleSettings.IndentOptions indentOptions = myTemporarySettings.getIndentOptions(XQueryFileType.INSTANCE);
    Assert.assertNotNull(indentOptions);
    settingsManager.setTemporarySettings(myTemporarySettings);
}