本文整理汇总了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, ""));
}
示例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, ""));
}
示例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, ""));
*/
}
示例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);
}
示例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);
}
}
示例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);
}