當前位置: 首頁>>代碼示例>>Java>>正文


Java RunProfileState類代碼示例

本文整理匯總了Java中com.intellij.execution.configurations.RunProfileState的典型用法代碼示例。如果您正苦於以下問題:Java RunProfileState類的具體用法?Java RunProfileState怎麽用?Java RunProfileState使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RunProfileState類屬於com.intellij.execution.configurations包,在下文中一共展示了RunProfileState類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: attachVirtualMachine

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Nullable
protected RunContentDescriptor attachVirtualMachine(final RunProfileState state, final @NotNull ExecutionEnvironment env)
        throws ExecutionException
{

    return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter()
    {
        @NotNull
        public XDebugProcess start(@NotNull XDebugSession session) throws ExecutionException
        {
            WeaveRunnerCommandLine weaveRunnerCommandLine = (WeaveRunnerCommandLine) state;
            final String weaveFile = weaveRunnerCommandLine.getModel().getWeaveFile();
            final Project project = weaveRunnerCommandLine.getEnvironment().getProject();
            final VirtualFile projectFile = project.getBaseDir();
            final String path = project.getBasePath();
            final String relativePath = weaveFile.substring(path.length());
            final VirtualFile fileByRelativePath = projectFile.findFileByRelativePath(relativePath);
            final DebuggerClient localhost = new DebuggerClient(new WeaveDebuggerClientListener(session, fileByRelativePath), new TcpClientDebuggerProtocol("localhost", 6565));
            final ExecutionResult result = state.execute(env.getExecutor(), WeaveDebuggerRunner.this);
            new DebuggerConnector(localhost).start();
            return new WeaveDebugProcess(session, localhost, result);
        }
    }).getRunContentDescriptor();

}
 
開發者ID:machaval,項目名稱:mule-intellij-plugins,代碼行數:26,代碼來源:WeaveDebuggerRunner.java

示例2: createContentDescriptor

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Nullable
@Override
protected RunContentDescriptor createContentDescriptor(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException {
  if (state instanceof ExternalSystemRunConfiguration.MyRunnableState) {
    int port = ((ExternalSystemRunConfiguration.MyRunnableState)state).getDebugPort();
    if (port > 0) {
      RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", String.valueOf(port), true);
      return attachVirtualMachine(state, environment, connection, true);
    }
    else {
      LOG.warn("Can't attach debugger to external system task execution. Reason: target debug port is unknown");
    }
  }
  else {
    LOG.warn(String.format(
      "Can't attach debugger to external system task execution. Reason: invalid run profile state is provided"
      + "- expected '%s' but got '%s'",
      ExternalSystemRunConfiguration.MyRunnableState.class.getName(), state.getClass().getName()
    ));
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:ExternalSystemTaskDebugRunner.java

示例3: RemoteExternalSystemCommunicationManager

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
public RemoteExternalSystemCommunicationManager(@NotNull ExternalSystemProgressNotificationManager notificationManager) {
  myProgressManager = (ExternalSystemProgressNotificationManagerImpl)notificationManager;
  mySupport = new RemoteProcessSupport<Object, RemoteExternalSystemFacade, String>(RemoteExternalSystemFacade.class) {
    @Override
    protected void fireModificationCountChanged() {
    }

    @Override
    protected String getName(Object o) {
      return RemoteExternalSystemFacade.class.getName();
    }

    @Override
    protected RunProfileState getRunProfileState(Object o, String configuration, Executor executor) throws ExecutionException {
      return createRunProfileState(configuration);
    }
  };

  ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
    public void run() {
      shutdown(false);
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:RemoteExternalSystemCommunicationManager.java

示例4: execute

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Override
protected final void execute(@NotNull final ExecutionEnvironment environment,
                             @Nullable final Callback callback,
                             @NotNull final RunProfileState state) throws ExecutionException {
  prepare(environment, state)
    .done(new Consumer<RunProfileStarter>() {
      @Override
      public void consume(@Nullable final RunProfileStarter result) {
        UIUtil.invokeLaterIfNeeded(new Runnable() {
          @Override
          public void run() {
            if (!environment.getProject().isDisposed()) {
              startRunProfile(environment, state, callback, result);
            }
          }
        });
      }
    });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:AsyncGenericProgramRunner.java

示例5: initSession

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Override
protected void initSession(XDebugSession session, RunProfileState state, Executor executor) {
  XDebugSessionTab tab = ((XDebugSessionImpl)session).getSessionTab();
  if (tab != null) {
    RunnerLayoutUi ui = tab.getUi();
    ContentManager contentManager = ui.getContentManager();
    Content content = findContent(contentManager, XDebuggerBundle.message("debugger.session.tab.watches.title"));
    if (content != null) {
      contentManager.removeContent(content, true);
    }
    content = findContent(contentManager, XDebuggerBundle.message("debugger.session.tab.console.content.name"));
    if (content != null) {
      contentManager.removeContent(content, true);
    }
    initEduConsole(session, ui);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:PyEduDebugRunner.java

示例6: getState

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Nullable
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) throws ExecutionException {
  final AbstractPythonRunConfiguration configuration = ((AbstractPythonRunConfiguration)getPeer());

  // If configuration wants to take care about rerun itself
  if (configuration instanceof TestRunConfigurationReRunResponsible) {
    // TODO: Extract method
    final Set<PsiElement> failedTestElements = new HashSet<PsiElement>();
    for (final AbstractTestProxy proxy : getFailedTests(getProject())) {
      final Location<?> location = proxy.getLocation(getProject(), GlobalSearchScope.allScope(getProject()));
      if (location != null) {
        failedTestElements.add(location.getPsiElement());
      }
    }
    return ((TestRunConfigurationReRunResponsible)configuration).rerunTests(executor, env, failedTestElements);
  }
  return new FailedPythonTestCommandLineStateBase(configuration, env,
                                                  (PythonTestCommandLineStateBase)configuration.getState(executor, env));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:PyRerunFailedTestsAction.java

示例7: findRestartActionState

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
/**
 * Searches for "rerun failed tests" action and fetches state from it
 *
 * @param descriptor previous run descriptor
 * @return state (if found)
 */
@Nullable
public static RunProfileState findRestartActionState(@NotNull final RunContentDescriptor descriptor) {
  final ExecutionEnvironment action = findRestartAction(descriptor);
  if (action == null) {
    return null;
  }
  final Ref<RunProfileState> stateRef = new Ref<RunProfileState>();
  ApplicationManager.getApplication().invokeAndWait(new Runnable() {
    @Override
    public void run() {
      try {
        stateRef.set(action.getState());
      }
      catch (final ExecutionException e) {
        throw new IllegalStateException("Error obtaining execution state", e);
      }
    }
  }, ModalityState.NON_MODAL);

  return stateRef.get();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:RerunFailedActionsTestTools.java

示例8: doExecute

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Override
protected RunContentDescriptor doExecute(@NotNull final RunProfileState state, @NotNull final ExecutionEnvironment environment) throws ExecutionException {
  assert state instanceof AndroidRunningState;
  final AndroidRunningState runningState = (AndroidRunningState)state;
  final RunContentDescriptor[] descriptor = {null};

  runningState.addListener(new AndroidRunningStateListener() {
    @Override
    public void executionFailed() {
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          if (descriptor[0] != null) {
            showNotification(environment.getProject(), environment.getExecutor(), descriptor[0], "error", false, NotificationType.ERROR);
          }
        }
      });
    }
  });
  descriptor[0] = doExec(runningState, environment);
  return descriptor[0];
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:AndroidDebugRunner.java

示例9: getRunProfile

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Override
protected MyRunProfile getRunProfile(@NotNull ExecutionEnvironment environment) {
  //noinspection ConstantConditions
  final JUnitConfiguration configuration = (JUnitConfiguration)myConsoleProperties.getConfiguration();
  final TestMethods testMethods = new TestMethods(configuration, environment, getFailedTests(configuration.getProject()));
  return new MyRunProfile(configuration) {
    @Override
    @NotNull
    public Module[] getModules() {
      return testMethods.getModulesToCompile();
    }

    @Override
    public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) {
      testMethods.clear();
      return testMethods;
    }
  };
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:RerunFailedTestsAction.java

示例10: createContentDescriptor

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
protected RunContentDescriptor createContentDescriptor(final RunProfileState runProfileState, final ExecutionEnvironment environment) throws ExecutionException {
  final XDebugSession debugSession =
    XDebuggerManager.getInstance(environment.getProject()).startSession(environment, new XDebugProcessStarter() {
      @NotNull
      public XDebugProcess start(@NotNull final XDebugSession session) throws ExecutionException {
        ACTIVE.set(Boolean.TRUE);
        try {
          final XsltCommandLineState c = (XsltCommandLineState)runProfileState;
          final ExecutionResult result = runProfileState.execute(environment.getExecutor(), XsltDebuggerRunner.this);
          return new XsltDebugProcess(session, result, c.getExtensionData().getUserData(XsltDebuggerExtension.VERSION));
        } finally {
          ACTIVE.remove();
        }
      }
    });
  return debugSession.getRunContentDescriptor();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:XsltDebuggerRunner.java

示例11: doExecute

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Override
protected RunContentDescriptor doExecute(
    final RunProfileState state, final ExecutionEnvironment env) throws ExecutionException {
  RunContentDescriptor descriptor = super.doExecute(state, env);
  if (descriptor != null) {
    ProcessHandler processHandler = descriptor.getProcessHandler();
    assert processHandler != null;

    RunProfile runProfile = env.getRunProfile();
    int uniqueId =
        (runProfile instanceof RunConfigurationBase)
            ? ((RunConfigurationBase) runProfile).getUniqueID()
            : -1;
    AndroidSessionInfo sessionInfo =
        new AndroidSessionInfo(
            processHandler,
            descriptor,
            uniqueId,
            env.getExecutor().getId(),
            env.getExecutor().getActionName(),
            InstantRunUtils.isInstantRunEnabled(env));
    processHandler.putUserData(AndroidSessionInfo.KEY, sessionInfo);
  }

  return descriptor;
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:27,代碼來源:BlazeAndroidBinaryProgramRunner.java

示例12: doExecute

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Nullable
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException {
    if(DEBUG_EXECUTOR.equals(environment.getExecutor().getId())) {
        RoboVmRunConfiguration runConfig = (RoboVmRunConfiguration)environment.getRunProfile();
        RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", "" + runConfig.getDebugPort(), false);
        connection.setServerMode(true);
        return attachVirtualMachine(state, environment, connection, false);
    } else {
        ExecutionResult executionResult = state.execute(environment.getExecutor(), this);
        if (executionResult == null) {
            return null;
        }
        return new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse());
    }
}
 
開發者ID:robovm,項目名稱:robovm-idea,代碼行數:17,代碼來源:RoboVmRunner.java

示例13: doExecute

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Nullable
@Override
protected RunContentDescriptor doExecute(@NotNull Project project, @NotNull RunProfileState state,
                                         @Nullable RunContentDescriptor contentToReuse, @NotNull ExecutionEnvironment environment) throws ExecutionException {
    final MayaCharmRunProfile configuration = (MayaCharmRunProfile) environment.getRunProfile();
    final MCSettingsProvider settingsProvider = MCSettingsProvider.getInstance(project);
    final MayaCommInterface mayaCommInterface = new MayaCommInterface(settingsProvider.getHost(), settingsProvider.getPort());

    ToolWindow mayaLogWindow = ToolWindowManager.getInstance(project).getToolWindow("Maya Log");
    mayaLogWindow.activate(null, true, true);

    mayaCommInterface.connectMayaLog();

    switch (configuration.getExecutionType()) {
        case CODE:
            mayaCommInterface.sendCodeToMaya(configuration.getScriptCodeText());
            break;
        case FILE:
            mayaCommInterface.sendFileToMaya(configuration.getScriptFilePath());
            break;
    }
    return null;
}
 
開發者ID:cmcpasserby,項目名稱:MayaCharm,代碼行數:24,代碼來源:MayaCharmRunner.java

示例14: doExecute

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Override
@RequiredDispatchThread
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException
{
	UnityProcess editorProcess = UnityEditorCommunication.findEditorProcess();
	if(editorProcess == null)
	{
		throw new ExecutionException("Editor is not responding");
	}
	FileDocumentManager.getInstance().saveAllDocuments();

	ExecutionResult executionResult = state.execute(env.getExecutor(), this);
	if(executionResult == null)
	{
		return null;
	}
	return Unity3dAttachRunner.runContentDescriptor(executionResult, env, editorProcess, (ConsoleView) executionResult.getExecutionConsole(), true);
}
 
開發者ID:consulo,項目名稱:consulo-unity3d,代碼行數:19,代碼來源:Unity3dTestDebuggerRunner.java

示例15: getState

import com.intellij.execution.configurations.RunProfileState; //導入依賴的package包/類
@Override
public RunProfileState getState(@NotNull Executor executor, final @NotNull ExecutionEnvironment env) throws ExecutionException {
    if (DefaultDebugExecutor.EXECUTOR_ID.equals(executor.getId())) {
        List<String> goals = null;
        if (RunType.Test.equals(runType)) {
            RunnerAndConfigurationSettings settings = env.getRunnerAndConfigurationSettings();
            if (settings != null && settings.getConfiguration() instanceof MvnRunConfiguration) {
                goals = disableFork(((MvnRunConfiguration) settings.getConfiguration()).getGoals());
            }
        }
        if ((RunType.Jetty.equals(runType) || RunType.Tomcat.equals(runType)) || goals != null) {
            return new DebugServerCommandLineState(env, this, goals);
        }
    }
    return super.getState(executor, env);
}
 
開發者ID:shlxue,項目名稱:MvnRunner,代碼行數:17,代碼來源:MvnRunConfiguration.java


注:本文中的com.intellij.execution.configurations.RunProfileState類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。