本文整理匯總了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;
}