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


Java ConsoleViewContentType.getConsoleViewType方法代码示例

本文整理汇总了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);
                }
            }
        }
    }
}
 
开发者ID:josesamuel,项目名称:logviewer,代码行数:27,代码来源:LogView.java

示例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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:LogConsoleBase.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PythonConsoleView.java

示例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)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ConsoleViewUtil.java

示例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);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:6,代码来源:ColoredConsoleStream.java


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