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


Java ExecutionManager类代码示例

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


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


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