com.intellij.execution.ui.ConsoleView Java Examples

The following examples show how to use com.intellij.execution.ui.ConsoleView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FreelineUtil.java    From freeline with BSD 3-Clause "New" or "Revised" License 7 votes vote down vote up
private static void processConsole(Project project, ProcessHandler processHandler) {
    ConsoleView consoleView = FreeUIManager.getInstance(project).getConsoleView(project);
    consoleView.clear();
    consoleView.attachToProcess(processHandler);

    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    ToolWindow toolWindow;
    toolWindow = toolWindowManager.getToolWindow(TOOL_ID);

    // if already exist tool window then show it
    if (toolWindow != null) {
        toolWindow.show(null);
        return;
    }

    toolWindow = toolWindowManager.registerToolWindow(TOOL_ID, true, ToolWindowAnchor.BOTTOM);
    toolWindow.setTitle("free....");
    toolWindow.setStripeTitle("Free Console");
    toolWindow.setShowStripeButton(true);
    toolWindow.setIcon(PluginIcons.ICON_TOOL_WINDOW);
    toolWindow.getContentManager().addContent(new ContentImpl(consoleView.getComponent(), "Build", true));
    toolWindow.show(null);
}
 
Example #2
Source File: LaunchState.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@NotNull
protected ExecutionResult setUpConsoleAndActions(@NotNull FlutterApp app) throws ExecutionException {
  final ConsoleView console = createConsole(getEnvironment().getExecutor());
  if (console != null) {
    app.setConsole(console);
    console.attachToProcess(app.getProcessHandler());
  }

  // Add observatory actions.
  // These actions are effectively added only to the Run tool window.
  // For Debug see FlutterDebugProcess.registerAdditionalActions()
  final Computable<Boolean> observatoryAvailable = () -> !app.getProcessHandler().isProcessTerminated() &&
                                                         app.getConnector().getBrowserUrl() != null;
  final List<AnAction> actions = new ArrayList<>(Arrays.asList(
    super.createActions(console, app.getProcessHandler(), getEnvironment().getExecutor())));
  actions.add(new Separator());
  actions.add(new OpenDevToolsAction(app.getConnector(), observatoryAvailable));

  return new DefaultExecutionResult(console, app.getProcessHandler(), actions.toArray(new AnAction[0]));
}
 
Example #3
Source File: RoboVmPlugin.java    From robovm-idea with GNU General Public License v2.0 6 votes vote down vote up
private static void log(final Project project, final ConsoleViewContentType type, String format, Object... args) {
    final String s = String.format(format, args) + "\n";
    UIUtil.invokeLaterIfNeeded(new Runnable() {
        @Override
        public void run() {
            ConsoleView consoleView = project == null ? null : consoleViews.get(project);
            if (consoleView != null) {
                for (UnprintedMessage unprinted : unprintedMessages) {
                    consoleView.print(unprinted.string, unprinted.type);
                }
                unprintedMessages.clear();
                consoleView.print(s, type);
            } else {
                unprintedMessages.add(new UnprintedMessage(s, type));
                if (type == ConsoleViewContentType.ERROR_OUTPUT) {
                    System.err.print(s);
                } else {
                    System.out.print(s);
                }
            }
        }
    });
}
 
Example #4
Source File: XValueHint.java    From consulo with Apache License 2.0 6 votes vote down vote up
public XValueHint(@Nonnull Project project, @Nonnull Editor editor, @Nonnull Point point, @Nonnull ValueHintType type,
                  @Nonnull ExpressionInfo expressionInfo, @Nonnull XDebuggerEvaluator evaluator,
                  @Nonnull XDebugSession session) {
  super(project, editor, point, type, expressionInfo.getTextRange());

  myEvaluator = evaluator;
  myDebugSession = session;
  myExpression = XDebuggerEvaluateActionHandler.getExpressionText(expressionInfo, editor.getDocument());
  myValueName = XDebuggerEvaluateActionHandler.getDisplayText(expressionInfo, editor.getDocument());
  myExpressionInfo = expressionInfo;

  VirtualFile file;
  ConsoleView consoleView = ConsoleViewImpl.CONSOLE_VIEW_IN_EDITOR_VIEW.get(editor);
  if (consoleView instanceof LanguageConsoleView) {
    LanguageConsoleView console = ((LanguageConsoleView)consoleView);
    file = console.getHistoryViewer() == editor ? console.getVirtualFile() : null;
  }
  else {
    file = FileDocumentManager.getInstance().getFile(editor.getDocument());
  }

  myExpressionPosition = file != null ? XDebuggerUtil.getInstance().createPositionByOffset(file, expressionInfo.getTextRange().getStartOffset()) : null;
}
 
Example #5
Source File: GaugeCommandLineState.java    From Intellij-Plugin with Apache License 2.0 6 votes vote down vote up
@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    addProjectClasspath();
    if (GaugeVersion.isGreaterOrEqual(GaugeRunConfiguration.TEST_RUNNER_SUPPORT_VERSION, false)
            && GaugeSettingsService.getSettings().useIntelliJTestRunner()) {
        ProcessHandler handler = startProcess();
        GaugeConsoleProperties properties = new GaugeConsoleProperties(config, "Gauge", executor, handler);
        ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("Gauge", handler, properties);
        DefaultExecutionResult result = new DefaultExecutionResult(console, handler, createActions(console, handler));
        if (ActionManager.getInstance().getAction("RerunFailedTests") != null) {
            AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(console);
            if (action != null) {
                action.setModelProvider(((SMTRunnerConsoleView) console)::getResultsViewer);
                result.setRestartActions(action);
            }
        }
        return result;
    }
    return super.execute(executor, runner);
}
 
Example #6
Source File: RunContentExecutor.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void run() {
  FileDocumentManager.getInstance().saveAllDocuments();

  // Use user-provided console if exist. Create new otherwise
  ConsoleView view = (myUserProvidedConsole != null ? myUserProvidedConsole :  createConsole(myProject));
  view.attachToProcess(myProcess);
  if (myAfterCompletion != null) {
    myProcess.addProcessListener(new ProcessAdapter() {
      @Override
      public void processTerminated(ProcessEvent event) {
        SwingUtilities.invokeLater(myAfterCompletion);
      }
    });
  }
  myProcess.startNotify();
}
 
Example #7
Source File: RNUtil.java    From react-native-console with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public static void addAdditionalConsoleEditorActions(final ConsoleView console, final Content consoleContent) {
    final DefaultActionGroup consoleActions = new DefaultActionGroup();
        for (AnAction action : console.createConsoleActions()) {
            consoleActions.add(action);
        }

    consoleContent.setActions(consoleActions, ActionPlaces.RUNNER_TOOLBAR, console.getComponent());
}
 
Example #8
Source File: DuneCompiler.java    From reasonml-idea-plugin with MIT License 6 votes vote down vote up
@Nullable
@Override
public ConsoleView getConsoleView() {
    ORToolWindowProvider windowProvider = ORToolWindowProvider.getInstance(project);
    ToolWindow duneToolWindow = windowProvider.getDuneToolWindow();
    Content windowContent = duneToolWindow.getContentManager().getContent(0);
    if (windowContent == null) {
        return null;
    }
    SimpleToolWindowPanel component = (SimpleToolWindowPanel) windowContent.getComponent();
    JComponent panelComponent = component.getComponent();
    if (panelComponent == null) {
        return null;
    }
    return (ConsoleView) panelComponent.getComponent(0);
}
 
Example #9
Source File: LogView.java    From logviewer with Apache License 2.0 6 votes vote down vote up
/**
 * Filters the console
 */
private synchronized void doFilter(ProgressIndicator progressIndicator) {
    final ConsoleView console = getConsole();
    String allLInes = getOriginalDocument().toString();
    final String[] lines = allLInes.split("\n");
    if (console != null) {
        console.clear();
    }
    myLogFilterModel.processingStarted();
    int size = lines.length;
    float current = 0;
    for (String line : lines) {
        printMessageToConsole(line);
        current++;
        progressIndicator.setFraction(current / size);
    }
    if (console != null) {
        ((ConsoleViewImpl) console).requestScrollingToEnd();
    }
}
 
Example #10
Source File: LogView.java    From logviewer with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
                }
            }
        }
    }
}
 
Example #11
Source File: TestLaunchState.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Nullable
@Override
protected ConsoleView createConsole(@NotNull Executor executor) throws ExecutionException {
  if (!testConsoleEnabled) {
    return super.createConsole(executor);
  }

  // Create a console showing a test tree.
  final Project project = getEnvironment().getProject();
  final DartUrlResolver resolver = DartUrlResolver.getInstance(project, testFileOrDir);
  final ConsoleProps props = ConsoleProps.forPub(config, executor, resolver);
  final BaseTestsOutputConsoleView console = SMTestRunnerConnectionUtil.createConsole(ConsoleProps.pubFrameworkName, props);

  final Module module = ModuleUtil.findModuleForFile(testFileOrDir, project);
  console.addMessageFilter(new DartConsoleFilter(project, getTestFileOrDir()));
  final String baseDir = getBaseDir();
  if (baseDir != null) {
    console.addMessageFilter(new DartRelativePathsConsoleFilter(project, baseDir));
  }
  console.addMessageFilter(new UrlFilter());

  return console;
}
 
Example #12
Source File: DaemonConsoleView.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Sets up a launcher to use a DaemonConsoleView.
 */
public static void install(@NotNull CommandLineState launcher, @NotNull ExecutionEnvironment env, @NotNull VirtualFile workDir) {
  // Create our own console builder.
  //
  // We need to filter input to this console without affecting other consoles, so we cannot use
  // a consoleFilterInputProvider.
  final GlobalSearchScope searchScope = SearchScopeProvider.createSearchScope(env.getProject(), env.getRunProfile());
  final TextConsoleBuilder builder = new TextConsoleBuilderImpl(env.getProject(), searchScope) {
    @NotNull
    @Override
    protected ConsoleView createConsole() {
      return new DaemonConsoleView(env.getProject(), searchScope);
    }
  };

  // Set up basic console filters. (More may be added later.)
  // TODO(devoncarew): Do we need this filter? What about DartConsoleFilter (for package: uris)?
  builder.addFilter(new DartRelativePathsConsoleFilter(env.getProject(), workDir.getPath()));
  launcher.setConsoleBuilder(builder);
}
 
Example #13
Source File: ConsoleViewUtil.java    From consulo with Apache License 2.0 6 votes vote down vote up
public static void printWithHighlighting(@Nonnull ConsoleView console, @Nonnull String text, @Nonnull SyntaxHighlighter highlighter, Runnable doOnNewLine) {
  Lexer lexer = highlighter.getHighlightingLexer();
  lexer.start(text, 0, text.length(), 0);

  IElementType tokenType;
  while ((tokenType = lexer.getTokenType()) != null) {
    ConsoleViewContentType contentType = getContentTypeForToken(tokenType, highlighter);
    StringTokenizer eolTokenizer = new StringTokenizer(lexer.getTokenText(), "\n", true);
    while (eolTokenizer.hasMoreTokens()) {
      String tok = eolTokenizer.nextToken();
      console.print(tok, contentType);
      if (doOnNewLine != null && "\n".equals(tok)) {
        doOnNewLine.run();
      }
    }

    lexer.advance();
  }
}
 
Example #14
Source File: DaemonConsoleView.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Sets up a launcher to use a DaemonConsoleView.
 */
public static void install(@NotNull CommandLineState launcher, @NotNull ExecutionEnvironment env, @NotNull VirtualFile workDir) {
  // Create our own console builder.
  //
  // We need to filter input to this console without affecting other consoles, so we cannot use
  // a consoleFilterInputProvider.
  final GlobalSearchScope searchScope = SearchScopeProvider.createSearchScope(env.getProject(), env.getRunProfile());
  final TextConsoleBuilder builder = new TextConsoleBuilderImpl(env.getProject(), searchScope) {
    @NotNull
    @Override
    protected ConsoleView createConsole() {
      return new DaemonConsoleView(env.getProject(), searchScope);
    }
  };

  // Set up basic console filters. (More may be added later.)
  // TODO(devoncarew): Do we need this filter? What about DartConsoleFilter (for package: uris)?
  builder.addFilter(new DartRelativePathsConsoleFilter(env.getProject(), workDir.getPath()));
  launcher.setConsoleBuilder(builder);
}
 
Example #15
Source File: TestLaunchState.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Nullable
@Override
protected ConsoleView createConsole(@NotNull Executor executor) throws ExecutionException {
  if (!testConsoleEnabled) {
    return super.createConsole(executor);
  }

  // Create a console showing a test tree.
  final Project project = getEnvironment().getProject();
  final DartUrlResolver resolver = DartUrlResolver.getInstance(project, testFileOrDir);
  final ConsoleProps props = ConsoleProps.forPub(config, executor, resolver);
  final BaseTestsOutputConsoleView console = SMTestRunnerConnectionUtil.createConsole(ConsoleProps.pubFrameworkName, props);

  final Module module = ModuleUtil.findModuleForFile(testFileOrDir, project);
  console.addMessageFilter(new DartConsoleFilter(project, getTestFileOrDir()));
  final String baseDir = getBaseDir();
  if (baseDir != null) {
    console.addMessageFilter(new DartRelativePathsConsoleFilter(project, baseDir));
  }
  console.addMessageFilter(new UrlFilter());

  return console;
}
 
Example #16
Source File: FlutterConsole.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@NotNull
static FlutterConsole create(@NotNull Project project, @Nullable Module module) {
  final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
  builder.setViewer(true);
  if (module != null) {
    builder.addFilter(new FlutterConsoleFilter(module));
  }
  final ConsoleView view = builder.getConsole();

  final SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false, true);
  panel.setContent(view.getComponent());

  final String title = module != null ? "[" + module.getName() + "] Flutter" : "Flutter";
  final Content content = ContentFactory.SERVICE.getInstance().createContent(panel.getComponent(), title, true);
  Disposer.register(content, view);

  return new FlutterConsole(view, content, project, module);
}
 
Example #17
Source File: Unity3dTestDebuggerRunner.java    From consulo-unity3d with Apache License 2.0 6 votes vote down vote up
@Override
@RequiredUIAccess
protected RunContentDescriptor doExecute(@Nonnull RunProfileState state, @Nonnull ExecutionEnvironment env) throws ExecutionException
{
	UnityProcess editorProcess = UnityEditorCommunication.findEditorProcess();
	if(editorProcess == null)
	{
		throw new ExecutionException("Editor is not responding");
	}
	FileDocumentManager.getInstance().saveAllDocuments();

	ExecutionResult executionResult = state.execute(env.getExecutor(), this);
	if(executionResult == null)
	{
		return null;
	}
	return Unity3dAttachRunner.runContentDescriptor(executionResult, env, editorProcess, (ConsoleView) executionResult.getExecutionConsole(), true);
}
 
Example #18
Source File: EOFAction.java    From consulo with Apache License 2.0 6 votes vote down vote up
@RequiredUIAccess
@Override
public void actionPerformed(@Nonnull 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) {
  }
}
 
Example #19
Source File: TestsOutputConsolePrinter.java    From consulo with Apache License 2.0 5 votes vote down vote up
/**
 * @deprecated left for JSTestDriver compatibility
 */
@Deprecated
public TestsOutputConsolePrinter(final ConsoleView console, final TestConsoleProperties properties, final AbstractTestProxy unboundOutputRoot) {
  myConsole = console;
  myProperties = properties;
  myUnboundOutputRoot = unboundOutputRoot;
  myProperties.addListener(TestConsoleProperties.SCROLL_TO_STACK_TRACE, myPropertyListener);
}
 
Example #20
Source File: LogConsoleBase.java    From consulo with Apache License 2.0 5 votes vote down vote up
private synchronized void doFilter() {
  if (myDisposed) {
    return;
  }
  final ConsoleView console = getConsoleNotNull();
  console.clear();
  myModel.processingStarted();

  final String[] lines = myOriginalDocument.toString().split("\n");
  int offset = 0;
  boolean caretPositioned = false;

  for (String line : lines) {
    final int printed = printMessageToConsole(line);
    if (printed > 0) {
      if (!caretPositioned) {
        if (Comparing.strEqual(myLineUnderSelection, line)) {
          caretPositioned = true;
          offset += myLineOffset != -1 ? myLineOffset : 0;
        }
        else {
          offset += printed;
        }
      }
    }
  }

  // we need this, because, document can change before actual scrolling, so offset may be already not at the end
  if (caretPositioned) {
    console.scrollTo(offset);
  }
  else {
    ((ConsoleViewImpl)console).requestScrollingToEnd();
  }
}
 
Example #21
Source File: BlazeAndroidBinaryConsoleProvider.java    From intellij with Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
public ConsoleView createAndAttach(
    @NotNull Disposable parent, @NotNull ProcessHandler handler, @NotNull Executor executor)
    throws ExecutionException {
  final TextConsoleBuilder builder =
      TextConsoleBuilderFactory.getInstance().createBuilder(project);
  ConsoleView console = builder.getConsole();
  console.attachToProcess(handler);
  return console;
}
 
Example #22
Source File: RunContentExecutor.java    From consulo with Apache License 2.0 5 votes vote down vote up
private ConsoleView createConsole(@Nonnull Project project) {
  TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
  consoleBuilder.filters(myFilterList);
  final ConsoleView console = consoleBuilder.getConsole();

  if (myHelpId != null) {
    console.setHelpId(myHelpId);
  }
  Executor executor = DefaultRunExecutor.getRunExecutorInstance();
  DefaultActionGroup actions = new DefaultActionGroup();

  final JComponent consolePanel = createConsolePanel(console, actions);
  RunContentDescriptor descriptor = new RunContentDescriptor(console, myProcess, consolePanel, myTitle);

  Disposer.register(descriptor, this);
  Disposer.register(descriptor, console);

  actions.add(new RerunAction(consolePanel));
  actions.add(new StopAction());
  actions.add(new CloseAction(executor, descriptor, myProject));

  ExecutionManager.getInstance(myProject).getContentManager().showRunContent(executor, descriptor);

  if (myActivateToolWindow) {
    activateToolWindow();
  }

  return console;
}
 
Example #23
Source File: PantsMakeBeforeRun.java    From intellij-pants-plugin with Apache License 2.0 5 votes vote down vote up
private void prepareIDE(Project project) {
  ApplicationManager.getApplication().invokeAndWait(() -> {
    /* Clear message window. */
    ConsoleView executionConsole = PantsConsoleManager.getConsole(project);
    executionConsole.getComponent().setVisible(true);
    executionConsole.clear();
    ToolWindowManagerEx.getInstance(project).getToolWindow(PantsConstants.PANTS_CONSOLE_NAME).activate(null);
  }, ModalityState.NON_MODAL);
}
 
Example #24
Source File: FlutterApp.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void onAppDebugPort(@NotNull DaemonEvent.AppDebugPort debugInfo) {
  app.setWsUrl(debugInfo.wsUri);

  // Print the conneciton info to the console.
  final ConsoleView console = app.getConsole();
  if (console != null) {
    console.print("Debug service listening on " + debugInfo.wsUri + "\n", ConsoleViewContentType.NORMAL_OUTPUT);
  }

  String uri = debugInfo.baseUri;
  if (uri != null) {
    if (uri.startsWith("file:")) {
      // Convert the file: url to a path.
      try {
        uri = new URL(uri).getPath();
        if (uri.endsWith(File.separator)) {
          uri = uri.substring(0, uri.length() - 1);
        }
      }
      catch (MalformedURLException e) {
        // ignore
      }
    }

    app.setBaseUri(uri);
  }
}
 
Example #25
Source File: BlazePyRunConfigurationRunner.java    From intellij with Apache License 2.0 5 votes vote down vote up
private static TextConsoleBuilder createConsoleBuilder(Project project, Sdk sdk) {
  return new PyDebugConsoleBuilder(project, sdk) {
    @Override
    protected ConsoleView createConsole() {
      PythonDebugLanguageConsoleView consoleView =
          new PythonDebugLanguageConsoleView(project, sdk);
      for (Filter filter : getFilters()) {
        consoleView.addMessageFilter(filter);
      }
      return consoleView;
    }
  };
}
 
Example #26
Source File: FlutterApp.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void onDaemonLog(@NotNull DaemonEvent.DaemonLog message) {
  final ConsoleView console = app.getConsole();
  if (console == null) return;
  if (message.log != null) {
    console.print(message.log + "\n", message.error ? ConsoleViewContentType.ERROR_OUTPUT : ConsoleViewContentType.NORMAL_OUTPUT);
  }
}
 
Example #27
Source File: ConsoleViewUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static void printAsFileType(@Nonnull ConsoleView console, @Nonnull String text, @Nonnull FileType fileType) {
  SyntaxHighlighter highlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, null, null);
  if (highlighter != null) {
    printWithHighlighting(console, text, highlighter);
  }
  else {
    console.print(text, ConsoleViewContentType.NORMAL_OUTPUT);
  }
}
 
Example #28
Source File: UnityDebugProcess.java    From consulo-unity3d with Apache License 2.0 5 votes vote down vote up
public UnityDebugProcess(XDebugSession session, RunProfile runProfile, DebugConnectionInfo debugConnectionInfo, ConsoleView consoleView, boolean insideEditor)
{
	super(session, runProfile, debugConnectionInfo);
	myConsoleView = consoleView;

	if(insideEditor)
	{
		myMessageBusConnection = Unity3dConsoleManager.getInstance().registerProcessor(session.getProject(), list ->
		{
			ConsoleView view = session.getConsoleView();
			if(view == null)
			{
				return;
			}

			for(UnityLogPostHandlerRequest request : list)
			{
				switch(request.getMessageCategory())
				{
					case MessageCategory.ERROR:
						print(request.condition, request.stackTrace, view, ConsoleViewContentType.ERROR_OUTPUT);
						break;
					default:
						print(request.condition, request.stackTrace, view, ConsoleViewContentType.NORMAL_OUTPUT);
						break;
				}
			}
		});
	}
}
 
Example #29
Source File: BlazeCidrLauncher.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
protected ConsoleView createConsole() {
  if (testUiSession != null) {
    return SmRunnerUtils.getConsoleView(
        configuration.getProject(), configuration, env.getExecutor(), testUiSession);
  }
  // when launching GDB directly the blaze test runners aren't involved
  CidrGoogleTestConsoleProperties consoleProperties =
      new CidrGoogleTestConsoleProperties(
          configuration, env.getExecutor(), env.getExecutionTarget());
  return createConsole(configuration.getType(), consoleProperties);
}
 
Example #30
Source File: DWToolWindowFactory.java    From intellij-demandware with MIT License 5 votes vote down vote up
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
    DWConsoleService consoleService = ServiceManager.getService(project, DWConsoleService.class);
    ConsoleView consoleView = consoleService.getConsoleView();
    Content content = toolWindow.getContentManager().getFactory().createContent(consoleView.getComponent(), "", true);
    toolWindow.getContentManager().addContent(content);
}