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


Java ConsoleView.print方法代码示例

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


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

示例1: printMessageToConsole

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的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: actionPerformed

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  RunContentDescriptor descriptor = StopAction.getRecentlyStartedContentDescriptor(e.getDataContext());
  ProcessHandler activeProcessHandler = descriptor != null ? descriptor.getProcessHandler() : null;
  if (activeProcessHandler == null || activeProcessHandler.isProcessTerminated()) return;

  try {
    OutputStream input = activeProcessHandler.getProcessInput();
    if (input != null) {
      ConsoleView console = e.getData(LangDataKeys.CONSOLE_VIEW);
      if (console != null) {
        console.print("^D\n", ConsoleViewContentType.SYSTEM_OUTPUT);
      }
      input.close();
    }
  }
  catch (IOException ignored) {
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:EOFAction.java

示例3: initConsoleUi

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
@Override
protected ConsoleView initConsoleUi() {
  ConsoleView consoleView = super.initConsoleUi();

  String avdHome = System.getenv("ANDROID_SDK_HOME");
  if (!StringUtil.isEmpty(avdHome)) {
    consoleView.print(
      "\n" +
      "Note: The environment variable $ANDROID_SDK_HOME is set, and the emulator uses that variable to locate AVDs.\n" +
      "This may result in the emulator failing to start if it cannot find the AVDs in the folder pointed to by the\n" +
      "given environment variable.\n" +
      "ANDROID_SDK_HOME=" + avdHome + "\n\n",
      ConsoleViewContentType.NORMAL_OUTPUT);
  }

  return consoleView;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:EmulatorRunner.java

示例4: reportAdbLogMessage

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
private static void reportAdbLogMessage(Log.LogLevel logLevel, String tag, String message, @NotNull ConsoleView consoleView) {
  if (message == null) {
    return;
  }
  if (logLevel == null) {
    logLevel = Log.LogLevel.INFO;
  }

  if (logLevel == Log.LogLevel.ERROR || logLevel == Log.LogLevel.ASSERT) {
    AdbErrors.reportError(message, tag);
  }

  final ConsoleViewContentType contentType = toConsoleViewContentType(logLevel);
  if (contentType == null) {
    return;
  }

  final String fullMessage = tag != null ? tag + ": " + message : message;
  consoleView.print(fullMessage + '\n', contentType);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AndroidToolWindowFactory.java

示例5: initConsoleUi

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
protected ConsoleView initConsoleUi() {
  ConsoleView consoleView = createConsoleView();
  consoleView.print(myCommandLine.getCommandLineString() + '\n', ConsoleViewContentType.USER_INPUT);
  consoleView.attachToProcess(myProcessHandler);

  JPanel panel = new JPanel(new BorderLayout());

  DefaultActionGroup toolbarActions = new DefaultActionGroup();
  ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarActions, false);
  panel.add(actionToolbar.getComponent(), BorderLayout.WEST);
  panel.add(consoleView.getComponent(), BorderLayout.CENTER);
  actionToolbar.setTargetComponent(panel);

  toolbarActions.addAll(consoleView.createConsoleActions());
  fillToolBarActions(toolbarActions);
  panel.updateUI();

  Executor defaultExecutor = DefaultRunExecutor.getRunExecutorInstance();
  final RunContentDescriptor contentDescriptor = new RunContentDescriptor(consoleView, myProcessHandler, panel, myTitle);
  showConsole(defaultExecutor, contentDescriptor);

  myProcessHandler.addProcessListener(new ConsoleListener(myProject, defaultExecutor, myProcessHandler));
  myProcessHandler.startNotify();
  return consoleView;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ExternalToolRunner.java

示例6: updateConsoleWindow

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
public void updateConsoleWindow(
    final String text,
    final ConsoleViewContentType type,
    final ConsoleView currentConsole
) {
    currentConsole.print(text, type);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:ExecuteConsole.java

示例7: printMessageToConsole

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
public static void printMessageToConsole(@NotNull Project project, @NotNull String s,
                                         @NotNull ConsoleViewContentType contentType) {
    activateConsoleToolWindow(project);
    final ConsoleView consoleView = project.getUserData(CONSOLE_VIEW_KEY);

    if (consoleView != null) {
        consoleView.print(s + '\n', contentType);
    }
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:10,代码来源:LuaSystemUtil.java

示例8: printWithHighlighting

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
public static void printWithHighlighting(@NotNull ConsoleView console, @NotNull String text, @NotNull SyntaxHighlighter highlighter) {
  Lexer lexer = highlighter.getHighlightingLexer();
  lexer.start(text, 0, text.length(), 0);

  IElementType tokenType;
  while ((tokenType = lexer.getTokenType()) != null) {
    console.print(lexer.getTokenText(), getContentTypeForToken(tokenType, highlighter));
    lexer.advance();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ConsoleViewUtil.java

示例9: printAsFileType

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
public static void printAsFileType(@NotNull ConsoleView console, @NotNull String text, @NotNull FileType fileType) {
  SyntaxHighlighter highlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, null, null);
  if (highlighter != null) {
    printWithHighlighting(console, text, highlighter);
  }
  else {
    console.print(text, ConsoleViewContentType.NORMAL_OUTPUT);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ConsoleViewUtil.java

示例10: printMessageToConsole

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的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

示例11: printMessageToConsole

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
public static void printMessageToConsole(@NotNull Project project, @NotNull String s, @NotNull ConsoleViewContentType contentType) {
  final ConsoleView consoleView = project.getUserData(CONSOLE_VIEW_KEY);

  if (consoleView != null) {
    consoleView.print(s + '\n', contentType);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AndroidUtils.java

示例12: fillAllConsolesWithTheSameContent

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
protected void fillAllConsolesWithTheSameContent(final String content) {
    for (ConsoleView consoleView : consoleViewList) {
        consoleView.print(content, ConsoleViewContentType.NORMAL_OUTPUT);
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:6,代码来源:ExecuteConsole.java

示例13: printStacktrace

import com.intellij.execution.ui.ConsoleView; //导入方法依赖的package包/类
public static void printStacktrace(final ConsoleView consoleView, final String unscrambledTrace) {
  consoleView.clear();
  consoleView.print(unscrambledTrace+"\n", ConsoleViewContentType.ERROR_OUTPUT);
  consoleView.scrollTo(0);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:AnalyzeStacktraceUtil.java


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