当前位置: 首页>>代码示例>>Java>>正文


Java FormattingDocumentModelImpl.createOn方法代码示例

本文整理汇总了Java中com.intellij.psi.formatter.FormattingDocumentModelImpl.createOn方法的典型用法代码示例。如果您正苦于以下问题:Java FormattingDocumentModelImpl.createOn方法的具体用法?Java FormattingDocumentModelImpl.createOn怎么用?Java FormattingDocumentModelImpl.createOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.formatter.FormattingDocumentModelImpl的用法示例。


在下文中一共展示了FormattingDocumentModelImpl.createOn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTemplateLanguageBlock

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@Override
public TemplateLanguageBlock createTemplateLanguageBlock(
    @NotNull ASTNode node,
    @Nullable Wrap wrap,
    @Nullable Alignment alignment,
    @Nullable List<DataLanguageBlockWrapper> foreignChildren,
    @NotNull CodeStyleSettings codeStyleSettings) {
  final FormattingDocumentModelImpl documentModel =
      FormattingDocumentModelImpl.createOn(node.getPsi().getContainingFile());
  if (node.getPsi() instanceof TagElement) {
    return new SoyTagBlock(
        this,
        codeStyleSettings,
        node,
        foreignChildren,
        new HtmlPolicy(codeStyleSettings, documentModel));
  } else if(node.getPsi() instanceof TagBlockElement) {
    return new SoyTagBlockBlock(
        this,
        codeStyleSettings,
        node,
        foreignChildren,
        new HtmlPolicy(codeStyleSettings, documentModel));
  } else if (node.getPsi() instanceof SoyStatementList) {
    return new SoyStatementListBlock(
        this,
        codeStyleSettings,
        node,
        foreignChildren,
        new HtmlPolicy(codeStyleSettings, documentModel));
  } else {
    return new SoyBlock(
      this,
      codeStyleSettings,
      node,
      foreignChildren,
      new HtmlPolicy(codeStyleSettings, documentModel));
  }
}
 
开发者ID:google,项目名称:bamboo-soy,代码行数:40,代码来源:SoyFormattingModelBuilder.java

示例2: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JavaFormattingModelBuilder.java

示例3: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@Override
@NotNull
  public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  final PsiFile psiFile = element.getContainingFile();
  final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile);
  return new XmlFormattingModel(psiFile,
                                                          new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFile),
                                                                       null, null,
                                                                       new HtmlPolicy(settings, documentModel), null, null, false),
                                                          documentModel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:XhtmlFormattingModelBuilder.java

示例4: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@Override
@NotNull
public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  final ASTNode root = TreeUtil.getFileElement((TreeElement)SourceTreeToPsiMap.psiElementToTree(element));
  final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(element.getContainingFile());
  return new XmlFormattingModel(element.getContainingFile(), createBlock(settings, root, documentModel), documentModel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:XmlFormattingModelBuilder.java

示例5: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@Override
@NotNull
  public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  final PsiFile psiFile = element.getContainingFile();
  final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile);
  return new XmlFormattingModel(psiFile,
                                                         new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFile),
                                                                      null, null, new HtmlPolicy(settings, documentModel), null, null, false),
                                                         documentModel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:HtmlFormattingModelBuilder.java

示例6: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:JavaFormattingModelBuilder.java

示例7: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@NotNull
  public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  final PsiFile psiFile = element.getContainingFile();
  final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile);
  return new XmlFormattingModel(psiFile,
                                                          new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFile),
                                                                       null, null,
                                                                       new HtmlPolicy(settings, documentModel), null, null, false),
                                                          documentModel);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:XhtmlFormattingModelBuilder.java

示例8: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@NotNull
public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  final ASTNode root = TreeUtil.getFileElement((TreeElement)SourceTreeToPsiMap.psiElementToTree(element));
  final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(element.getContainingFile());
  return new XmlFormattingModel(element.getContainingFile(),
                                                         new XmlBlock(root, null, null, new XmlPolicy(settings, documentModel), null, null, false),
                                                         documentModel);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:XmlFormattingModelBuilder.java

示例9: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@NotNull
  public FormattingModel createModel(final PsiElement element, final CodeStyleSettings settings) {
  final PsiFile psiFile = element.getContainingFile();
  final FormattingDocumentModelImpl documentModel = FormattingDocumentModelImpl.createOn(psiFile);
  return new XmlFormattingModel(psiFile,
                                                         new XmlBlock(SourceTreeToPsiMap.psiElementToTree(psiFile),
                                                                      null, null, new HtmlPolicy(settings, documentModel), null, null, false),
                                                         documentModel);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:HtmlFormattingModelBuilder.java

示例10: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@NotNull
@Override
public FormattingModel createModel(PsiElement element, CodeStyleSettings settings)
{
	final PsiFile file = element.getContainingFile();
	FormattingDocumentModelImpl model = FormattingDocumentModelImpl.createOn(element.getContainingFile());
	Block rootBlock = new CSharpFormattingBlock(file.getNode(), null, null, settings);
	return new PsiBasedFormattingModel(file, rootBlock, model);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:10,代码来源:CSharpFormattingModelBuilder.java

示例11: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@NotNull
@Override
public FormattingModel createModel(PsiElement element, CodeStyleSettings codeStyleSettings)
{
	final PsiFile file = element.getContainingFile();
	FormattingDocumentModelImpl model = FormattingDocumentModelImpl.createOn(element.getContainingFile());
	Block rootBlock = new CssFormattingBlock(element.getNode(), null, null);
	return new PsiBasedFormattingModel(file, rootBlock, model);
}
 
开发者ID:consulo,项目名称:consulo-css,代码行数:10,代码来源:CssFormattingModelBuilder.java

示例12: createModel

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@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);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:14,代码来源:JavaFormattingModelBuilder.java

示例13: ImportsFormatter

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
public ImportsFormatter(@NotNull CodeStyleSettings settings, @NotNull PsiFile file) {
  myPostProcessor = new PostFormatProcessorHelper(settings);
  myDocumentModel = FormattingDocumentModelImpl.createOn(file);
  myIndentOptions = settings.getIndentOptionsByFile(file);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ImportsFormatter.java

示例14: createFormattingModelForPsiFile

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
@Override
public FormattingModel createFormattingModelForPsiFile(final PsiFile file,
                                                       @NotNull final Block rootBlock,
                                                       final CodeStyleSettings settings) {
  return new PsiBasedFormattingModel(file, rootBlock, FormattingDocumentModelImpl.createOn(file));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:FormatterImpl.java

示例15: ImportsFormatter

import com.intellij.psi.formatter.FormattingDocumentModelImpl; //导入方法依赖的package包/类
public ImportsFormatter(@NotNull CodeStyleSettings settings, @NotNull PsiFile file) {
  myPostProcessor = new PostFormatProcessorHelper(settings);
  myDocumentModel = FormattingDocumentModelImpl.createOn(file);
  myIndentOptions = settings.getIndentOptions(file.getFileType());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:ImportsFormatter.java


注:本文中的com.intellij.psi.formatter.FormattingDocumentModelImpl.createOn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。