• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExecutionManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: select

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
public void select() {
  if (ApplicationManager.getApplication().isUnitTestMode()) return;

  UIUtil.invokeLaterIfNeeded(new Runnable() {
    @Override
    public void run() {
      if (myRunContentDescriptor != null) {
        ToolWindow toolWindow = ExecutionManager.getInstance(myProject).getContentManager()
          .getToolWindowByDescriptor(myRunContentDescriptor);
        Content content = myRunContentDescriptor.getAttachedContent();
        if (toolWindow == null || content == null) return;
        ContentManager manager = toolWindow.getContentManager();
        if (ArrayUtil.contains(content, manager.getContents()) && !manager.isSelected(content)) {
          manager.setSelectedContent(content);
        }
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DebuggerSessionTabBase.java


示例2: removeSession

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
public void removeSession(@NotNull final XDebugSessionImpl session) {
  XDebugSessionTab sessionTab = session.getSessionTab();
  mySessions.remove(session.getDebugProcess().getProcessHandler());
  if (sessionTab != null) {
    RunContentDescriptor descriptor = sessionTab.getRunContentDescriptor();
    if (descriptor != null) {
      // in test-mode RunContentWithExecutorListener.contentRemoved events are not sent (see RunContentManagerImpl.showRunContent)
      // so we make sure the mySessions and mySessionData are cleared correctly when session is disposed
      Disposer.register(descriptor, new Disposable() {
        @Override
        public void dispose() {
          mySessions.remove(session.getDebugProcess().getProcessHandler());
        }
      });
    }

    if (!myProject.isDisposed() && !ApplicationManager.getApplication().isUnitTestMode() && XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().isHideDebuggerOnProcessTermination()) {
      ExecutionManager.getInstance(myProject).getContentManager().hideRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), descriptor);
    }
  }
  if (myActiveSession.compareAndSet(session, null)) {
    onActiveSessionChanged();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:XDebuggerManagerImpl.java


示例3: getActiveStoppableDescriptors

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@NotNull
private static List<RunContentDescriptor> getActiveStoppableDescriptors(final DataContext dataContext) {
  final Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if (project == null) {
    return Collections.emptyList();
  }
  final List<RunContentDescriptor> runningProcesses = ExecutionManager.getInstance(project).getContentManager().getAllDescriptors();
  if (runningProcesses.isEmpty()) {
    return Collections.emptyList();
  }
  final List<RunContentDescriptor> activeDescriptors = new ArrayList<RunContentDescriptor>();
  for (RunContentDescriptor descriptor : runningProcesses) {
    if (canBeStopped(descriptor)) {
      activeDescriptors.add(descriptor);
    }
  }
  return activeDescriptors;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:StopAction.java


示例4: createConsoleView

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


示例5: actionPerformed

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
  List<RunContentDescriptor> descriptors = ContainerUtil.newArrayList(REGISTRY);
  for (RunContentDescriptor descriptor : descriptors) {
    if (Disposer.isDisposed(descriptor)) {
      REGISTRY.remove(descriptor);
    }
    else {
      Project project = e.getProject();
      if (project != null) {
        RunContentManager runContentManager = ExecutionManager.getInstance(project).getContentManager();
        // check if the descriptor belongs to the current project
        if (runContentManager.getToolWindowByDescriptor(descriptor) != null) {
          ExecutionUtil.restart(descriptor);
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:RerunTestsAction.java


示例6: stopApplication

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
/**
 * Stops the applications via the descriptor of configuration.  This gets called when the application finishes on the client side without maniually closing it.
 *
 * @param javaExitCode
 */
public void stopApplication(@NotNull int javaExitCode) {
    final RunManagerImpl runManager = (RunManagerImpl) RunManager.getInstance(project);
    final Collection<RunnerAndConfigurationSettings> allConfigurations = runManager.getSortedConfigurations();
    List<RunContentDescriptor> allDescriptors = ExecutionManager.getInstance(project).getContentManager().getAllDescriptors();
    boolean exitMsgDisplay = false;
    for (RunnerAndConfigurationSettings runConfiguration : allConfigurations) {
        if (runConfiguration.getConfiguration().getFactory().getType() instanceof EmbeddedLinuxJVMConfigurationType) {
            for (RunContentDescriptor descriptor : allDescriptors) {
                if (runConfiguration.getName().equals(descriptor.getDisplayName())) {
                    try {
                        if (!exitMsgDisplay) {
                            consoleView.print(EmbeddedLinuxJVMBundle.message("exit.code.message", javaExitCode), ConsoleViewContentType.SYSTEM_OUTPUT);
                            exitMsgDisplay = true;
                        }
                        descriptor.setProcessHandler(null);
                    } catch (Exception e) {

                    }
                }
            }

        }

    }
}
 
开发者ID:asebak,项目名称:embeddedlinux-jvmdebugger-intellij,代码行数:31,代码来源:JavaStatusChecker.java


示例7: getHandler

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@Nullable
private static ProcessHandler getHandler(final DataContext dataContext) {
  final RunContentDescriptor contentDescriptor = RunContentManager.RUN_CONTENT_DESCRIPTOR.getData(dataContext);
  final ProcessHandler processHandler;
  if (contentDescriptor != null) {
    // toolwindow case
    processHandler = contentDescriptor.getProcessHandler();
  }
  else {
    // main menu toolbar
    final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
    final RunContentDescriptor selectedContent =
      project == null ? null : ExecutionManager.getInstance(project).getContentManager().getSelectedContent();
    processHandler = selectedContent == null ? null : selectedContent.getProcessHandler();
  }
  return processHandler;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:StopAction.java


示例8: getActiveDescriptors

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@NotNull
private static List<RunContentDescriptor> getActiveDescriptors(final DataContext dataContext) {
  final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
  if (project == null) {
    return Collections.emptyList();
  }
  final List<RunContentDescriptor> runningProcesses = ExecutionManager.getInstance(project).getContentManager().getAllDescriptors();
  if (runningProcesses.isEmpty()) {
    return Collections.emptyList();
  }
  final List<RunContentDescriptor> activeDescriptors = new ArrayList<RunContentDescriptor>();
  for (RunContentDescriptor descriptor : runningProcesses) {
    final ProcessHandler processHandler = descriptor.getProcessHandler();
    if (processHandler != null && !processHandler.isProcessTerminating() && !processHandler.isProcessTerminated()) {
      activeDescriptors.add(descriptor);
    }
  }
  return activeDescriptors;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:StopAction.java


示例9: showConsole

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
protected void showConsole(Executor defaultExecutor,
		@NotNull RunContentDescriptor myDescriptor,
		final Component toFocus)
{
	// Show in run toolwindow
	ExecutionManager.getInstance(myProject).getContentManager().showRunContent(defaultExecutor, myDescriptor);

	// Request focus
	final ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(defaultExecutor.getId());
	window.activate(new Runnable()
	{
		public void run()
		{
			IdeFocusManager.getInstance(myProject).requestFocus(toFocus, true);
		}
	});
}
 
开发者ID:consulo,项目名称:consulo-terminal,代码行数:18,代码来源:AbstractTerminalRunner.java


示例10: getActiveStoppableDescriptors

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@Nonnull
private static List<RunContentDescriptor> getActiveStoppableDescriptors(final DataContext dataContext) {
  final Project project = dataContext.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return Collections.emptyList();
  }
  final List<RunContentDescriptor> runningProcesses = ExecutionManager.getInstance(project).getContentManager().getAllDescriptors();
  if (runningProcesses.isEmpty()) {
    return Collections.emptyList();
  }
  final List<RunContentDescriptor> activeDescriptors = new ArrayList<>();
  for (RunContentDescriptor descriptor : runningProcesses) {
    if (canBeStopped(descriptor)) {
      activeDescriptors.add(descriptor);
    }
  }
  return activeDescriptors;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:StopAction.java


示例11: createConsoleView

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@Nonnull
private static RunContentDescriptor createConsoleView(@Nonnull Project project, @Nonnull 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:consulo,项目名称:consulo,代码行数:25,代码来源:RunIdeConsoleAction.java


示例12: hasRunningProcess

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
private static boolean hasRunningProcess(Project project) {
  for (ProcessHandler handler : ExecutionManager.getInstance(project).getRunningProcesses()) {
    if (!handler.isProcessTerminated() && !ALLOW_AUTOMAKE.get(handler, Boolean.FALSE)) { // active process
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BuildManager.java


示例13: actionPerformed

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final RunContentDescriptor contentDescriptor = getContentDescriptor();
  if (contentDescriptor == null) {
    return;
  }
  final boolean removedOk = ExecutionManager.getInstance(myProject).getContentManager().removeRunContent(getExecutor(), contentDescriptor);
  if (removedOk) {
    myContentDescriptor = null;
    myExecutor = null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:CloseAction.java


示例14: hasEnabledAutoTests

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
private boolean hasEnabledAutoTests() {
  RunContentManager contentManager = ExecutionManager.getInstance(myProject).getContentManager();
  for (RunContentDescriptor descriptor : contentManager.getAllDescriptors()) {
    if (isAutoTestEnabledForDescriptor(descriptor)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AutoTestManager.java


示例15: restartAllAutoTests

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
private void restartAllAutoTests(int modificationStamp) {
  RunContentManager contentManager = ExecutionManager.getInstance(myProject).getContentManager();
  boolean active = false;
  for (RunContentDescriptor descriptor : contentManager.getAllDescriptors()) {
    if (isAutoTestEnabledForDescriptor(descriptor)) {
      restartAutoTest(descriptor, modificationStamp, myDocumentWatcher);
      active = true;
    }
  }
  if (!active) {
    myDocumentWatcher.deactivate();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AutoTestManager.java


示例16: getAction

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
private static boolean getAction(@NotNull AnActionEvent e, boolean execute) {
  Project project = e.getProject();
  if (project == null) {
    return false;
  }

  RunContentDescriptor contentDescriptor = ExecutionManager.getInstance(project).getContentManager().getSelectedContent();
  if (contentDescriptor == null) {
    return false;
  }

  JComponent component = contentDescriptor.getComponent();
  if (component == null) {
    return false;
  }

  ExecutionEnvironment environment = LangDataKeys.EXECUTION_ENVIRONMENT.getData(DataManager.getInstance().getDataContext(component));
  if (environment == null) {
    return false;
  }

  AnAction[] actions = contentDescriptor.getRestartActions();
  if (actions.length == 0) {
    return false;
  }

  for (AnAction action : actions) {
    if (action instanceof AbstractRerunFailedTestsAction) {
      if (execute) {
        ((AbstractRerunFailedTestsAction)action).execute(e, environment);
      }
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:RerunFailedTestsAction.java


示例17: toFront

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
public void toFront(boolean focus, @Nullable final Runnable onShowCallback) {
  if (ApplicationManager.getApplication().isUnitTestMode()) return;

  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      if (myRunContentDescriptor != null) {
        ToolWindow toolWindow = ExecutionManager.getInstance(myProject).getContentManager()
          .getToolWindowByDescriptor(myRunContentDescriptor);
        if (toolWindow != null) {
          if (!toolWindow.isVisible()) {
            toolWindow.show(onShowCallback);
          }
          //noinspection ConstantConditions
          toolWindow.getContentManager().setSelectedContent(myRunContentDescriptor.getAttachedContent());
        }
      }
    }
  });

  if (focus) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        boolean focusWnd = Registry.is("debugger.mayBringFrameToFrontOnBreakpoint");
        ProjectUtil.focusProjectWindow(myProject, focusWnd);
        if (!focusWnd) {
          AppIcon.getInstance().requestAttention(myProject, true);
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:DebuggerSessionTabBase.java


示例18: getRecentlyStartedContentDescriptor

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@Nullable
static RunContentDescriptor getRecentlyStartedContentDescriptor(@NotNull DataContext dataContext) {
  final RunContentDescriptor contentDescriptor = LangDataKeys.RUN_CONTENT_DESCRIPTOR.getData(dataContext);
  if (contentDescriptor != null) {
    // toolwindow case
    return contentDescriptor;
  }
  else {
    // main menu toolbar
    final Project project = CommonDataKeys.PROJECT.getData(dataContext);
    return project == null ? null : ExecutionManager.getInstance(project).getContentManager().getSelectedContent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:StopAction.java


示例19: getEnvironment

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@Nullable
protected ExecutionEnvironment getEnvironment(@NotNull AnActionEvent event) {
  ExecutionEnvironment environment = event.getData(LangDataKeys.EXECUTION_ENVIRONMENT);
  if (environment == null) {
    Project project = event.getProject();
    RunContentDescriptor contentDescriptor = project == null ? null : ExecutionManager.getInstance(project).getContentManager().getSelectedContent();
    if (contentDescriptor != null) {
      JComponent component = contentDescriptor.getComponent();
      if (component != null) {
        environment = LangDataKeys.EXECUTION_ENVIRONMENT.getData(DataManager.getInstance().getDataContext(component));
      }
    }
  }
  return environment;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:FakeRerunAction.java


示例20: contentAdded

import com.intellij.execution.ExecutionManager; //导入依赖的package包/类
@Override
public void contentAdded(Collection<ConsoleViewContentType> types) {
  if (myProject.isDisposed() || myUi.isDisposed())
    return;
  for (ConsoleViewContentType type : types) {
    if ((type == ConsoleViewContentType.NORMAL_OUTPUT) && myRunConfigurationBase.isShowConsoleOnStdOut()
        || (type == ConsoleViewContentType.ERROR_OUTPUT) && myRunConfigurationBase.isShowConsoleOnStdErr()) {
      ExecutionManager.getInstance(myProject).getContentManager().toFrontRunContent(myExecutor, myRunContentDescriptor);
      myUi.selectAndFocus(myUi.findContent(ExecutionConsole.CONSOLE_CONTENT_ID), false, false);
      return;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:RunContentBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CalligraphyTypefaceSpan类代码示例发布时间:2022-05-22
下一篇:
Java IndicesAliasesRequestBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap