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


Java StdFileTypes.PLAIN_TEXT属性代码示例

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


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

示例1: SoyLayeredHighlighter

public SoyLayeredHighlighter(
    @Nullable Project project,
    @Nullable VirtualFile virtualFile,
    @NotNull EditorColorsScheme colors) {
  // Creating main highlighter.
  super(new SoySyntaxHighlighter(), colors);

  // Highlighter for the outer language.
  FileType type = null;
  if (project == null || virtualFile == null) {
    type = StdFileTypes.PLAIN_TEXT;
  } else {
    Language language = TemplateDataLanguageMappings.getInstance(project).getMapping(virtualFile);
    if (language != null) type = language.getAssociatedFileType();
    if (type == null) type = SoyLanguage.getDefaultTemplateLang();
  }

  SyntaxHighlighter outerHighlighter =
      SyntaxHighlighterFactory.getSyntaxHighlighter(type, project, virtualFile);

  registerLayer(OTHER, new LayerDescriptor(outerHighlighter, ""));
}
 
开发者ID:google,项目名称:bamboo-soy,代码行数:22,代码来源:SoyLayeredHighlighter.java

示例2: JetLayeredSyntaxHighlighter

public JetLayeredSyntaxHighlighter(Project project, EditorColorsScheme scheme, FileType ptype, VirtualFile virtualFile) {
    super(new JetSyntaxHighlighter(), scheme);

    // highlighter for outer ide
    FileType type = null;
    if (project == null || virtualFile == null) {
        type = StdFileTypes.PLAIN_TEXT;
    } else {
        Language language = TemplateDataLanguageMappings.getInstance(project).getMapping(virtualFile);
        if (language != null) type = language.getAssociatedFileType();
        if (type == null) type = JetLanguage.getDefaultTemplateLang();
    }

    SyntaxHighlighter outerHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(type, project, virtualFile);
    registerLayer(TEXT, new LayerDescriptor(outerHighlighter, ""));
}
 
开发者ID:jhsx,项目名称:GoJetPlugin,代码行数:16,代码来源:JetLayeredSyntaxHighlighter.java

示例3: RythmLayeredSyntaxHighlighter

public RythmLayeredSyntaxHighlighter(Project project, EditorColorsScheme scheme, FileType ptype, VirtualFile virtualFile) {
    super(new RythmSyntaxHighlighter(), scheme);

    FileType type = null;

    //Test for Java implementation
    FileType type1 = null;

    if (project == null || virtualFile == null) {
        type = StdFileTypes.PLAIN_TEXT;
    } else {
        Language language = TemplateDataLanguageMappings.getInstance(project).getMapping(virtualFile);
        if (language != null) type = language.getAssociatedFileType();
        if (type == null) {
            type = RythmLanguage.getDefaultTemplateLang();

            //Test for Java implementation
            //type1 = RythmLanguage.getLanguage();
        }

    }

    SyntaxHighlighter outerHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(type, project, virtualFile);
    registerLayer(TEXT, new LayerDescriptor(outerHighlighter, ""));


    //Test for Java implementation
   /* SyntaxHighlighter middleHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(type1, project, virtualFile);
    registerLayer(TEXT, new LayerDescriptor(middleHighlighter, ""));
   */

}
 
开发者ID:scireum-incubator,项目名称:rythm_plugin,代码行数:32,代码来源:RythmLayeredSyntaxHighlighter.java

示例4: FormDataTableCellEditor

public FormDataTableCellEditor(Project project, JBDebuggerFormTable.ItemInfo itemInfo) {
    component = new JPanel(new BorderLayout());
    editor = new EditorTextField("", project, StdFileTypes.PLAIN_TEXT);
    component.add(editor, BorderLayout.CENTER);
    combobox = new ComboBoxWithWidePopup<>(ContainerUtil.ar("Text", "File"));
    combobox.setSelectedItem(StringUtil.isEmpty(itemInfo.type) ? "Text" : itemInfo.type);
    combobox.setFocusable(false);
    combobox.addItemListener(e -> {
        if (e.getStateChange() == ItemEvent.SELECTED) {
            itemInfo.type = e.getItem().toString();
        }
    });
    component.add(combobox, BorderLayout.EAST);
}
 
开发者ID:FingerArt,项目名称:ApiDebugger,代码行数:14,代码来源:FormDataTableCellEditor.java

示例5: EditorComboWithBrowseButton

public EditorComboWithBrowseButton(final ActionListener browseActionListener,
                                   final String text,
                                   @NotNull final Project project,
                                   final String recentsKey) {
  super(new EditorComboBox(text, project, StdFileTypes.PLAIN_TEXT), browseActionListener);
  final List<String> recentEntries = RecentsManager.getInstance(project).getRecentEntries(recentsKey);
  if (recentEntries != null) {
    setHistory(ArrayUtil.toStringArray(recentEntries));
  }
  if (text != null && text.length() > 0) {
    prependItem(text);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:EditorComboWithBrowseButton.java

示例6: LanguageTextField

public LanguageTextField(@Nullable Language language,
                         @Nullable Project project,
                         @NotNull String value,
                         @NotNull DocumentCreator documentCreator,
                         boolean oneLineMode) {
  super(documentCreator.createDocument(value, language, project), project,
        language != null ? language.getAssociatedFileType() : StdFileTypes.PLAIN_TEXT, language == null, oneLineMode);

  myLanguage = language;
  myProject = project;

  setEnabled(language != null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:LanguageTextField.java


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