本文整理汇总了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);
}
}
}
});
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
}
}
示例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) {
}
}
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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();
}
}