Java 类com.intellij.psi.impl.source.codeStyle.PsiBasedFormatterModelWithShiftIndentInside 实例源码

项目:intellij-ce-playground    文件:JavaFormattingModelBuilder.java   
@Override
@NotNull
  public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  final FileElement fileElement = TreeUtil.getFileElement((TreeElement)SourceTreeToPsiMap.psiElementToTree(element));
  LOG.assertTrue(fileElement != null, "File element should not be null for " + element);
  CommonCodeStyleSettings commonSettings = settings.getCommonSettings(JavaLanguage.INSTANCE);
  JavaCodeStyleSettings customJavaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
  Block block = AbstractJavaBlock.newJavaBlock(fileElement, commonSettings, customJavaSettings);
  FormattingDocumentModelImpl model = FormattingDocumentModelImpl.createOn(element.getContainingFile());
  return new PsiBasedFormatterModelWithShiftIndentInside (element.getContainingFile(), block, model);
}
项目:tools-idea    文件:JavaFormattingModelBuilder.java   
@Override
@NotNull
  public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  final FileElement fileElement = TreeUtil.getFileElement((TreeElement)SourceTreeToPsiMap.psiElementToTree(element));
  LOG.assertTrue(fileElement != null, "File element should not be null for " + element);
  CommonCodeStyleSettings javaSettings = settings.getCommonSettings(JavaLanguage.INSTANCE);
  Block block = AbstractJavaBlock.createJavaBlock(fileElement, javaSettings);
  FormattingDocumentModelImpl model = FormattingDocumentModelImpl.createOn(element.getContainingFile());
  return new PsiBasedFormatterModelWithShiftIndentInside (element.getContainingFile(), block, model);
}
项目:consulo-java    文件:JavaFormattingModelBuilder.java   
@Override
@NotNull
@RequiredReadAction
public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings)
{
    final FileElement fileElement = TreeUtil.getFileElement((TreeElement) SourceTreeToPsiMap.psiElementToTree(element));
    LOG.assertTrue(fileElement != null, "File element should not be null for " + element);
    CommonCodeStyleSettings commonSettings = settings.getCommonSettings(JavaLanguage.INSTANCE);
    JavaCodeStyleSettings customJavaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
    Block block = AbstractJavaBlock.newJavaBlock(fileElement, commonSettings, customJavaSettings);
    FormattingDocumentModelImpl model = FormattingDocumentModelImpl.createOn(element.getContainingFile());
    return new PsiBasedFormatterModelWithShiftIndentInside(element.getContainingFile(), block, model);
}