本文整理汇总了Java中com.intellij.execution.ui.ConsoleViewContentType.getConsoleViewType方法的典型用法代码示例。如果您正苦于以下问题:Java ConsoleViewContentType.getConsoleViewType方法的具体用法?Java ConsoleViewContentType.getConsoleViewType怎么用?Java ConsoleViewContentType.getConsoleViewType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.ui.ConsoleViewContentType
的用法示例。
在下文中一共展示了ConsoleViewContentType.getConsoleViewType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printMessageToConsole
import com.intellij.execution.ui.ConsoleViewContentType; //导入方法依赖的package包/类
/**
* Prints the message to console
*/
private void printMessageToConsole(String line) {
final ConsoleView console = getConsole();
final LogFilterModel.MyProcessingResult processingResult = myLogFilterModel.processLine(line);
if (processingResult.isApplicable()) {
final Key key = processingResult.getKey();
if (key != null) {
ConsoleViewContentType type = ConsoleViewContentType.getConsoleViewType(key);
if (type != null) {
final String messagePrefix = processingResult.getMessagePrefix();
if (messagePrefix != null) {
String formattedPrefix = logFormatter.formatPrefix(messagePrefix);
if (console != null) {
console.print(formattedPrefix, type);
}
}
String formattedMessage = logFormatter.formatMessage(line);
if (console != null) {
console.print(formattedMessage + "\n", type);
}
}
}
}
}
示例2: printMessageToConsole
import com.intellij.execution.ui.ConsoleViewContentType; //导入方法依赖的package包/类
private int printMessageToConsole(String line) {
final ConsoleView console = getConsoleNotNull();
if (myContentPreprocessor != null) {
List<LogFragment> fragments = myContentPreprocessor.parseLogLine(line + '\n');
for (LogFragment fragment : fragments) {
ConsoleViewContentType consoleViewType = ConsoleViewContentType.getConsoleViewType(fragment.getOutputType());
if (consoleViewType != null) {
String formattedText = myFormatter.formatMessage(fragment.getText());
console.print(formattedText, consoleViewType);
}
}
return line.length() + 1;
}
else {
final LogFilterModel.MyProcessingResult processingResult = myModel.processLine(line);
if (processingResult.isApplicable()) {
final Key key = processingResult.getKey();
if (key != null) {
ConsoleViewContentType type = ConsoleViewContentType.getConsoleViewType(key);
if (type != null) {
final String messagePrefix = processingResult.getMessagePrefix();
if (messagePrefix != null) {
String formattedPrefix = myFormatter.formatPrefix(messagePrefix);
console.print(formattedPrefix, type);
}
String formattedMessage = myFormatter.formatMessage(line);
console.print(formattedMessage + "\n", type);
return (messagePrefix != null ? messagePrefix.length() : 0) + line.length() + 1;
}
}
}
return 0;
}
}
示例3: outputTypeForAttributes
import com.intellij.execution.ui.ConsoleViewContentType; //导入方法依赖的package包/类
public ConsoleViewContentType outputTypeForAttributes(Key attributes) {
final ConsoleViewContentType outputType;
if (attributes == ProcessOutputTypes.STDERR) {
outputType = ConsoleViewContentType.ERROR_OUTPUT;
}
else if (attributes == ProcessOutputTypes.SYSTEM) {
outputType = ConsoleViewContentType.SYSTEM_OUTPUT;
}
else {
outputType = ConsoleViewContentType.getConsoleViewType(attributes);
}
return outputType;
}
示例4: getContentTypeForToken
import com.intellij.execution.ui.ConsoleViewContentType; //导入方法依赖的package包/类
@NotNull
public static ConsoleViewContentType getContentTypeForToken(@NotNull IElementType tokenType, @NotNull SyntaxHighlighter highlighter) {
TextAttributesKey[] keys = highlighter.getTokenHighlights(tokenType);
return keys.length == 0 ? ConsoleViewContentType.NORMAL_OUTPUT :
ConsoleViewContentType.getConsoleViewType(ColorCache.keys.get(Arrays.asList(keys)));
}
示例5: coloredTextAvailable
import com.intellij.execution.ui.ConsoleViewContentType; //导入方法依赖的package包/类
@Override
public void coloredTextAvailable(String escapedText, @SuppressWarnings("rawtypes") Key key) {
ConsoleViewContentType contentType = ConsoleViewContentType.getConsoleViewType(key);
consoleStream.print(escapedText, contentType);
}