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


Java ProcessHandler.startNotify方法代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:XDebuggerManagerImpl.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ConsoleViewImplTest.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:RemoteProcessSupport.java

示例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
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:5,代码来源:RNConsoleImpl.java

示例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);
    }
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:50,代码来源:RNUtil.java

示例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;
        }
    }

}
 
开发者ID:mglaman,项目名称:intellij-drupal-run-tests,代码行数:44,代码来源:DrupalDebugRunner.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:61,代码来源:ForkedGroovyc.java


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