本文整理汇总了Java中com.intellij.execution.process.ProcessHandler.startNotify方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessHandler.startNotify方法的具体用法?Java ProcessHandler.startNotify怎么用?Java ProcessHandler.startNotify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.process.ProcessHandler
的用法示例。
在下文中一共展示了ProcessHandler.startNotify方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startSessionAndShowTab
import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
@NotNull
@Override
public XDebugSession startSessionAndShowTab(@NotNull String sessionName,
Icon icon,
@Nullable RunContentDescriptor contentToReuse,
boolean showToolWindowOnSuspendOnly,
@NotNull XDebugProcessStarter starter) throws ExecutionException {
XDebugSessionImpl session = startSession(contentToReuse, starter, new XDebugSessionImpl(null, this, sessionName,
icon, showToolWindowOnSuspendOnly));
if (!showToolWindowOnSuspendOnly) {
session.showSessionTab();
}
ProcessHandler handler = session.getDebugProcess().getProcessHandler();
handler.startNotify();
return session;
}
示例2: createConsole
import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
@NotNull
private static ConsoleViewImpl createConsole() {
Project project = getProject();
ConsoleViewImpl console = new ConsoleViewImpl(project,
GlobalSearchScope.allScope(project),
false,
false);
console.getComponent();
ProcessHandler processHandler = new MyProcessHandler();
processHandler.startNotify();
console.attachToProcess(processHandler);
return console;
}
示例3: startProcess
import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
private void startProcess(Target target, Parameters configuration, @NotNull Pair<Target, Parameters> key) {
ProgramRunner runner = new DefaultProgramRunner() {
@Override
@NotNull
public String getRunnerId() {
return "MyRunner";
}
@Override
public boolean canRun(@NotNull String executorId, @NotNull RunProfile profile) {
return true;
}
};
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
ProcessHandler processHandler;
try {
RunProfileState state = getRunProfileState(target, configuration, executor);
ExecutionResult result = state.execute(executor, runner);
//noinspection ConstantConditions
processHandler = result.getProcessHandler();
}
catch (Exception e) {
dropProcessInfo(key, e instanceof ExecutionException? e.getMessage() : ExceptionUtil.getUserStackTrace(e, LOG), null);
return;
}
processHandler.addProcessListener(getProcessListener(key));
processHandler.startNotify();
}
示例4: processConsole
import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
private void processConsole(ProcessHandler processHandler) {
attachToProcess(processHandler);
processHandler.startNotify();// Don't call this, the command content will not be shown
}
示例5: processConsole
import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
private static void processConsole(Project project, ProcessHandler processHandler) {
ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
consoleView.clear();
consoleView.attachToProcess(processHandler);
processHandler.startNotify();
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow;
toolWindow = toolWindowManager.getToolWindow(TOOL_ID);
// if already exist tool window then show it
if (toolWindow != null) {
toolWindow.show(null);// TODO add more tabs here?
return;
}
toolWindow = toolWindowManager.registerToolWindow(TOOL_ID, true, ToolWindowAnchor.BOTTOM);
toolWindow.setTitle("Android....");
toolWindow.setStripeTitle("Android Console");
toolWindow.setShowStripeButton(true);
toolWindow.setIcon(PluginIcons.ICON_TOOL_WINDOW);
JPanel panel = new JPanel((LayoutManager) new BorderLayout());
panel.add((Component) consoleView.getComponent(), "Center");
// Create toolbars
DefaultActionGroup toolbarActions = new DefaultActionGroup();
AnAction[]
consoleActions = consoleView.createConsoleActions();// 必须在 consoleView.getComponent() 调用后组件真正初始化之后调用
toolbarActions.addAll((AnAction[]) Arrays.copyOf(consoleActions, consoleActions.length));
toolbarActions.add((AnAction) new StopProcessAction("Stop process", "Stop process", processHandler));
// toolbarActions.add((AnAction) new CloseAction(defaultExecutor, runDescriptor, project));
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("unknown", (ActionGroup) toolbarActions, false);
toolbar.setTargetComponent(consoleView.getComponent());
panel.add((Component) toolbar.getComponent(), "West");
ContentImpl consoleContent = new ContentImpl(panel, "Build", false);
consoleContent.setManager(toolWindow.getContentManager());
toolbarActions.add(new CloseTabAction(consoleContent));
// addAdditionalConsoleEditorActions(consoleView, consoleContent);
// consoleComponent.setActions();
toolWindow.getContentManager().addContent(consoleContent);
toolWindow.getContentManager().addContent(new ContentImpl(new JButton("Test"), "Build2", false));
toolWindow.show(null);
}
示例6: doExecute
import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
@Override
protected RunContentDescriptor doExecute(@NotNull DrupalRunConfiguration runConfiguration, @NotNull RunProfileState runProfileState, @NotNull ExecutionEnvironment env) throws ExecutionException {
final Project project = runConfiguration.getProject();
PhpProjectDebugConfiguration.State debugConfiguration = PhpProjectDebugConfiguration.getInstance(project).getState();
boolean breakAtFirstLine = (debugConfiguration != null) && debugConfiguration.isBreakAtFirstLine();
final PhpInterpreter interpreter = PhpProjectConfigurationFacade.getInstance(project).getInterpreter();
if(interpreter == null) {
throw new ExecutionException(PhpCommandSettingsBuilder.INTERPRETER_NOT_FOUND_ERROR);
}
final PhpDebugExtension debugExtension = PhpProjectConfigurationFacade.getInstance(runConfiguration.getProject()).getInterpreterDebugExtension();
if(debugExtension == null) {
throw new ExecutionException("Unknown debugger.");
} else {
final PhpDebugServer debugServer = debugExtension.startDebugServer(project);
final PhpDebugConnectionManager connectionsManager = debugExtension.createDebugConnectionManager();
final String sessionId = debugServer.registerSessionHandler(false, connectionsManager);
try {
final PhpCommandSettings commandSettings = PhpCommandSettingsBuilder.create(project, interpreter, true);
Map<String, String> commandLineEnv = debugExtension.getDebugEnv(project, breakAtFirstLine, sessionId);
runConfiguration.buildCommand(commandLineEnv, commandSettings);
final ProcessHandler processHandler = runConfiguration.createProcessHandler(project, commandSettings);
ProcessTerminatedListener.attach(processHandler, project);
XDebugSession debugSession = XDebuggerManager.getInstance(project).startSession(env, new XDebugProcessStarter() {
@NotNull
public XDebugProcess start(@NotNull XDebugSession session) {
PhpScriptDebugRunner.onSessionStart(session, debugServer, sessionId, connectionsManager, project, commandSettings, interpreter, processHandler);
PhpDebugDriver driver = debugExtension.getDebugDriver();
return PhpDebugProcessFactory.forPhpScript(project, session, sessionId, connectionsManager, driver, commandSettings.getPathProcessor());
}
});
debugSession.getConsoleView().attachToProcess(processHandler);
processHandler.startNotify();
return debugSession.getRunContentDescriptor();
} catch (ExecutionException var16) {
debugServer.unregisterSessionHandler(sessionId);
throw var16;
}
}
}
示例7: runGroovyc
import com.intellij.execution.process.ProcessHandler; //导入方法依赖的package包/类
@Override
public GroovycContinuation runGroovyc(Collection<String> compilationClassPath,
boolean forStubs,
JpsGroovySettings settings,
File tempFile,
final GroovycOutputParser parser)
throws Exception {
List<String> classpath = new ArrayList<String>();
if (myOptimizeClassLoading) {
classpath.addAll(GroovyBuilder.getGroovyRtRoots());
classpath.add(ClasspathBootstrap.getResourcePath(Function.class));
classpath.add(ClasspathBootstrap.getResourcePath(UrlClassLoader.class));
classpath.add(ClasspathBootstrap.getResourceFile(THashMap.class).getPath());
} else {
classpath.addAll(compilationClassPath);
}
List<String> vmParams = ContainerUtilRt.newArrayList();
vmParams.add("-Xmx" + System.getProperty("groovyc.heap.size", settings.heapSize) + "m");
vmParams.add("-Dfile.encoding=" + System.getProperty("file.encoding"));
//vmParams.add("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5239");
if ("false".equals(System.getProperty(GroovyRtConstants.GROOVYC_ASM_RESOLVING_ONLY))) {
vmParams.add("-D" + GroovyRtConstants.GROOVYC_ASM_RESOLVING_ONLY + "=false");
}
String configScript = settings.configScript;
if (StringUtil.isNotEmpty(configScript)) {
vmParams.add("-D" + GroovyRtConstants.GROOVYC_CONFIG_SCRIPT + "=" + configScript);
}
String grapeRoot = System.getProperty(GroovycOutputParser.GRAPE_ROOT);
if (grapeRoot != null) {
vmParams.add("-D" + GroovycOutputParser.GRAPE_ROOT + "=" + grapeRoot);
}
final List<String> cmd = ExternalProcessUtil.buildJavaCommandLine(
getJavaExecutable(myChunk),
"org.jetbrains.groovy.compiler.rt.GroovycRunner",
Collections.<String>emptyList(), classpath,
vmParams,
getProgramParams(tempFile, settings, forStubs)
);
final Process process = Runtime.getRuntime().exec(ArrayUtil.toStringArray(cmd));
ProcessHandler handler = new BaseOSProcessHandler(process, null, null) {
@Override
protected Future<?> executeOnPooledThread(Runnable task) {
return SharedThreadPool.getInstance().executeOnPooledThread(task);
}
@Override
public void notifyTextAvailable(String text, Key outputType) {
parser.notifyTextAvailable(text, outputType);
}
};
handler.startNotify();
handler.waitFor();
parser.notifyFinished(process.exitValue());
return null;
}