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


Java ConsoleView类代码示例

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


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

示例1: showHelperProcessRunContent

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
public static final ConsoleView showHelperProcessRunContent(String header, OSProcessHandler runHandler, Project project, Executor defaultExecutor) {
        ProcessTerminatedListener.attach(runHandler);

        ConsoleViewImpl consoleView = new ConsoleViewImpl(project, true);
        DefaultActionGroup toolbarActions = new DefaultActionGroup();

        JPanel panel = new JPanel((LayoutManager) new BorderLayout());
        panel.add((Component) consoleView.getComponent(), "Center");
        ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("unknown", (ActionGroup) toolbarActions, false);
        toolbar.setTargetComponent(consoleView.getComponent());
        panel.add((Component) toolbar.getComponent(), "West");

        RunContentDescriptor runDescriptor = new RunContentDescriptor((ExecutionConsole) consoleView,
                (ProcessHandler) runHandler, (JComponent) panel, header, AllIcons.RunConfigurations.Application);
        AnAction[]
                consoleActions = consoleView.createConsoleActions();
        toolbarActions.addAll((AnAction[]) Arrays.copyOf(consoleActions, consoleActions.length));
        toolbarActions.add((AnAction) new StopProcessAction("Stop process", "Stop process", (ProcessHandler) runHandler));
        toolbarActions.add((AnAction) new CloseAction(defaultExecutor, runDescriptor, project));

        consoleView.attachToProcess((ProcessHandler) runHandler);
//        ExecutionManager.getInstance(environment.getProject()).getContentManager().showRunContent(environment.getExecutor(), runDescriptor);
        showConsole(project, defaultExecutor, runDescriptor);
        return (ConsoleView) consoleView;
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:26,代码来源:RunnerUtil.java

示例2: doFilter

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:josesamuel,项目名称:logviewer,代码行数:23,代码来源:LogView.java

示例3: 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

示例4: showConsoleToolWindow

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
public void showConsoleToolWindow(final Project project, final ConsoleView... consoles) {
    Integer currentSelectedContentIndex = 0;
    if (toolWindow == null) {
        createNewToolWindow(project);
    } else if (!toolWindow.getTitle().equals("Hybris Console")) {
        final ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow("Hybris Console");
        if (window == null) {
            createNewToolWindow(project);
        } else {
            toolWindow = window;
            currentSelectedContentIndex = getCurrentSelectedTab();
            toolWindow.getContentManager().removeAllContents(false);
        }
    } else {
        currentSelectedContentIndex = getCurrentSelectedTab();
        toolWindow.getContentManager().removeAllContents(false);
    }
    setConsolesInToolWindow(consoles);
    toolWindow.activate(null);
    selectTab(currentSelectedContentIndex);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:22,代码来源:ConsoleToolWindowUtil.java

示例5: XValueHint

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
public XValueHint(@NotNull Project project, @NotNull Editor editor, @NotNull Point point, @NotNull ValueHintType type,
                  @NotNull ExpressionInfo expressionInfo, @NotNull XDebuggerEvaluator evaluator,
                  @NotNull 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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:XValueHint.java

示例6: init

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
public XDebugSessionTab init(@NotNull XDebugProcess process, @NotNull XDebugSessionData sessionData, @Nullable RunContentDescriptor contentToReuse) {
  LOG.assertTrue(myDebugProcess == null);
  myDebugProcess = process;
  mySessionData = sessionData;

  if (myDebugProcess.checkCanInitBreakpoints()) {
    initBreakpoints();
  }

  myDebugProcess.getProcessHandler().addProcessListener(new ProcessAdapter() {
    @Override
    public void processTerminated(final ProcessEvent event) {
      stopImpl();
      myDebugProcess.getProcessHandler().removeProcessListener(this);
    }
  });
  //todo[nik] make 'createConsole()' method return ConsoleView
  myConsoleView = (ConsoleView)myDebugProcess.createConsole();
  if (!myShowTabOnSuspend.get()) {
    initSessionTab(contentToReuse);
  }

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

示例7: run

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:RunContentExecutor.java

示例8: 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

示例9: createConsoleView

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
@NotNull
private static RunContentDescriptor createConsoleView(@NotNull Project project, @NotNull PsiFile psiFile) {
  ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();

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

  final RunContentDescriptor descriptor = new RunContentDescriptor(consoleView, null, panel, psiFile.getName()) {
    @Override
    public boolean isContentReuseProhibited() {
      return true;
    }
  };
  Executor executor = DefaultRunExecutor.getRunExecutorInstance();
  toolbarActions.addAll(consoleView.createConsoleActions());
  toolbarActions.add(new CloseAction(executor, descriptor, project));
  ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor);

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

示例10: createConsole

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
@Override
protected ConsoleView createConsole() {
  if (testUiSession != null) {
    return SmRunnerUtils.getConsoleView(
        configuration.getProject(),
        configuration,
        executionEnvironment.getExecutor(),
        testUiSession);
  }
  // When debugging, we run gdb manually on the debug binary, so the blaze test runners aren't
  // involved.
  CidrGoogleTestConsoleProperties consoleProperties =
      new CidrGoogleTestConsoleProperties(
          configuration,
          executionEnvironment.getExecutor(),
          executionEnvironment.getExecutionTarget());
  return createConsole(configuration.getType(), consoleProperties);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:19,代码来源:BlazeCidrLauncher.java

示例11: execute

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
@Override
public ExecutionResult execute(Executor executor, CommandLinePatcher... patchers) throws ExecutionException {
  final ProcessHandler processHandler = startProcess(patchers);
  final ConsoleView console = createAndAttachConsole(myConfiguration.getProject(), processHandler, executor);

  List<AnAction> actions = Lists
    .newArrayList(createActions(console, processHandler));

  DefaultExecutionResult executionResult =
    new DefaultExecutionResult(console, processHandler, actions.toArray(new AnAction[actions.size()]));

  PyRerunFailedTestsAction rerunFailedTestsAction = new PyRerunFailedTestsAction(console);
  if (console instanceof SMTRunnerConsoleView) {
    rerunFailedTestsAction.init(((BaseTestsOutputConsoleView)console).getProperties());
    rerunFailedTestsAction.setModelProvider(new Getter<TestFrameworkRunningModel>() {
    @Override
    public TestFrameworkRunningModel get() {
      return ((SMTRunnerConsoleView)console).getResultsViewer();
    }
  });
  }

  executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
  return executionResult;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:PythonTestCommandLineStateBase.java

示例12: 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

示例13: 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

示例14: addAdditionalConsoleEditorActions

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
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());
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:9,代码来源:RNUtil.java

示例15: createConsole

import com.intellij.execution.ui.ConsoleView; //导入依赖的package包/类
@Nullable
@Override
protected ConsoleView createConsole(@NotNull Executor executor) throws ExecutionException {
    ConsoleView console = super.createConsole(executor);
    // before run new task,clean log
    if (console != null) {
        console.clear();
    }
    return console;
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:11,代码来源:FreeRunConfiguration.java


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