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


Java RunContentDescriptor.getExecutionConsole方法代码示例

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


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

示例1: executeQuery

import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
private static void executeQuery(@NotNull Project project,
                                 @NotNull VirtualFile file,
                                 @NotNull Editor editor,
                                 @NotNull IdeScriptEngine engine) {
  String command = getCommand(editor);
  String profile = getProfile(file);
  RunContentDescriptor descriptor = getConsoleView(project, file);
  ConsoleViewImpl consoleView = (ConsoleViewImpl)descriptor.getExecutionConsole();

  prepareEngine(project, engine, descriptor);
  try {
    //myHistoryController.getModel().addToHistory(command);
    consoleView.print("> " + command, ConsoleViewContentType.USER_INPUT);
    consoleView.print("\n", ConsoleViewContentType.USER_INPUT);
    Object o = engine.eval(profile == null ? command : profile + "\n" + command);
    consoleView.print("=> " + o, ConsoleViewContentType.NORMAL_OUTPUT);
    consoleView.print("\n", ConsoleViewContentType.NORMAL_OUTPUT);
  }
  catch (Throwable e) {
    //noinspection ThrowableResultOfMethodCallIgnored
    Throwable ex = ExceptionUtil.getRootCause(e);
    consoleView.print(ex.getClass().getSimpleName() + ": " + ex.getMessage(), ConsoleViewContentType.ERROR_OUTPUT);
    consoleView.print("\n", ConsoleViewContentType.ERROR_OUTPUT);
  }
  selectContent(descriptor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:RunIdeConsoleAction.java

示例2: getDebugSession

import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
@Override
@Nullable
public XDebugSession getDebugSession(@NotNull ExecutionConsole executionConsole) {
  for (final XDebugSessionImpl debuggerSession : mySessions.values()) {
    XDebugSessionTab sessionTab = debuggerSession.getSessionTab();
    if (sessionTab != null) {
      RunContentDescriptor contentDescriptor = sessionTab.getRunContentDescriptor();
      if (contentDescriptor != null && executionConsole == contentDescriptor.getExecutionConsole()) {
        return debuggerSession;
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:XDebuggerManagerImpl.java

示例3: getConsoleView

import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
@NotNull
private static RunContentDescriptor getConsoleView(@NotNull Project project, @NotNull VirtualFile file) {
  PsiFile psiFile = ObjectUtils.assertNotNull(PsiManager.getInstance(project).findFile(file));
  WeakReference<RunContentDescriptor> ref = psiFile.getCopyableUserData(DESCRIPTOR_KEY);
  RunContentDescriptor descriptor = ref == null ? null : ref.get();
  if (descriptor == null || descriptor.getExecutionConsole() == null) {
    descriptor = createConsoleView(project, psiFile);
    psiFile.putCopyableUserData(DESCRIPTOR_KEY, new WeakReference<RunContentDescriptor>(descriptor));
  }
  return descriptor;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:RunIdeConsoleAction.java

示例4: fetchConsoleAndSetToField

import com.intellij.execution.ui.RunContentDescriptor; //导入方法依赖的package包/类
/**
 * Fetches console from process descriptor and sets it to {@link #myConsole}.
 * If override, always set console!
 *
 * @param descriptor process descriptor
 */
protected void fetchConsoleAndSetToField(@NotNull final RunContentDescriptor descriptor) {
  myConsole = (ConsoleViewImpl)descriptor.getExecutionConsole();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ConfigurationBasedProcessRunner.java


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