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


Java RunProfile類代碼示例

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


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

示例1: addToHistory

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
private void addToHistory(final SMTestProxy.SMRootTestProxy root,
                          TestConsoleProperties consoleProperties,
                          Disposable parentDisposable) {
  final RunProfile configuration = consoleProperties.getConfiguration();
  if (configuration instanceof RunConfiguration && 
      !(consoleProperties instanceof ImportedTestConsoleProperties) &&
      !ApplicationManager.getApplication().isUnitTestMode() &&
      !myDisposed) {
    final MySaveHistoryTask backgroundable = new MySaveHistoryTask(consoleProperties, root, (RunConfiguration)configuration);
    final BackgroundableProcessIndicator processIndicator = new BackgroundableProcessIndicator(backgroundable);
    Disposer.register(parentDisposable, new Disposable() {
      @Override
      public void dispose() {
        processIndicator.cancel();
        backgroundable.dispose();
      }
    });
    Disposer.register(parentDisposable, processIndicator);
    ProgressManager.getInstance().runProcessWithProgressAsynchronously(backgroundable, processIndicator);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:SMTestRunnerResultsForm.java

示例2: ExecutionEnvironment

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
ExecutionEnvironment(@NotNull RunProfile runProfile,
                     @NotNull Executor executor,
                     @NotNull ExecutionTarget target,
                     @NotNull Project project,
                     @Nullable RunnerSettings runnerSettings,
                     @Nullable ConfigurationPerRunnerSettings configurationSettings,
                     @Nullable RunContentDescriptor contentToReuse,
                     @Nullable RunnerAndConfigurationSettings settings,
                     @NotNull ProgramRunner<?> runner) {
  myExecutor = executor;
  myTarget = target;
  myRunProfile = runProfile;
  myRunnerSettings = runnerSettings;
  myConfigurationSettings = configurationSettings;
  myProject = project;
  setContentToReuse(contentToReuse);
  myRunnerAndConfigurationSettings = settings;

  myRunner = runner;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:ExecutionEnvironment.java

示例3: initScope

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@NotNull
protected GlobalSearchScope initScope() {
  RunProfile configuration = getConfiguration();
  if (!(configuration instanceof ModuleRunProfile)) {
    return GlobalSearchScope.allScope(myProject);
  }

  Module[] modules = ((ModuleRunProfile)configuration).getModules();
  if (modules.length == 0) {
    return GlobalSearchScope.allScope(myProject);
  }

  GlobalSearchScope scope = GlobalSearchScope.EMPTY_SCOPE;
  for (Module each : modules) {
    scope = scope.uniteWith(GlobalSearchScope.moduleRuntimeScope(each, true));
  }
  return scope;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:TestConsoleProperties.java

示例4: getData

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@Nullable
public static Object getData(final AbstractTestProxy testProxy, final String dataId, final TestFrameworkRunningModel model) {
  final TestConsoleProperties properties = model.getProperties();
  final Project project = properties.getProject();
  if (testProxy == null) return null;
  if (AbstractTestProxy.DATA_KEY.is(dataId)) return testProxy;
  if (CommonDataKeys.NAVIGATABLE.is(dataId)) return getOpenFileDescriptor(testProxy, model);
  if (CommonDataKeys.PSI_ELEMENT.is(dataId)) {
    final Location location = testProxy.getLocation(project, properties.getScope());
    if (location != null) {
      final PsiElement element = location.getPsiElement();
      return element.isValid() ? element : null;
    }
    else {
      return null;
    }
  }
  if (Location.DATA_KEY.is(dataId)) return testProxy.getLocation(project, properties.getScope());
  if (RunConfiguration.DATA_KEY.is(dataId)) {
    final RunProfile configuration = properties.getConfiguration();
    if (configuration instanceof RunConfiguration) {
      return configuration;
    }
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:TestsUIUtil.java

示例5: attachNotificationTo

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
protected void attachNotificationTo(final Content content) {
  if (myConsole instanceof ObservableConsoleView) {
    ObservableConsoleView observable = (ObservableConsoleView)myConsole;
    observable.addChangeListener(new ObservableConsoleView.ChangeListener() {
      @Override
      public void contentAdded(final Collection<ConsoleViewContentType> types) {
        if (types.contains(ConsoleViewContentType.ERROR_OUTPUT) || types.contains(ConsoleViewContentType.NORMAL_OUTPUT)) {
          content.fireAlert();
        }
      }
    }, content);
    RunProfile profile = getRunProfile();
    if (profile instanceof RunConfigurationBase && !ApplicationManager.getApplication().isUnitTestMode()) {
      observable.addChangeListener(new RunContentBuilder.ConsoleToFrontListener((RunConfigurationBase)profile,
                                                                                myProject,
                                                                                DefaultDebugExecutor.getDebugExecutorInstance(),
                                                                                myRunContentDescriptor,
                                                                                myUi),
                                   content);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:DebuggerSessionTabBase.java

示例6: onRunnerStateChanged

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
public void onRunnerStateChanged(final StateEvent event) {
  if (!(event instanceof CompletionEvent)) {
    return;
  }
  final boolean areTestsFailed = myModel.getRoot().isDefect();
  final CompletionEvent completion = (CompletionEvent)event;
  final RunProfile configuration = myModel.getProperties().getConfiguration();
  if (configuration == null) {
    return;
  }
  if (testsTerminatedAndNotFailed(completion, areTestsFailed)) return;

  if (completion.isNormalExit()) {
    LvcsHelper.addLabel(myModel);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:LvcsLabeler.java

示例7: execute

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
  RunProfile profile = myEnvironment.getRunProfile();
  if (profile instanceof AntRunConfiguration) {
    AntRunConfiguration antRunConfiguration = (AntRunConfiguration)profile;
    AntBuildTarget target = antRunConfiguration.getTarget();
    if (target == null) return null;
    ProcessHandler processHandler = ExecutionHandler
      .executeRunConfiguration(antRunConfiguration, myEnvironment.getDataContext(), new ArrayList<BuildFileProperty>(),
                               new AntBuildListener() {
                                 @Override
                                 public void buildFinished(int state, int errorCount) {

                                 }
                               });
    if (processHandler == null) return null;
    return new DefaultExecutionResult(null, processHandler);
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:AntRunProfileState.java

示例8: ensureRunnerConfigured

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@Override
public boolean ensureRunnerConfigured(@Nullable Module module, RunProfile profile, Executor executor, final Project project) {
  if (GantUtils.getSDKInstallPath(module, project).isEmpty()) {
    int result = Messages
      .showOkCancelDialog("Gant is not configured. Do you want to configure it?", "Configure Gant SDK",
                          JetgroovyIcons.Groovy.Gant_16x16);
    if (result == Messages.OK) {
      ShowSettingsUtil.getInstance().editConfigurable(project, new GantConfigurable(project));
    }
    if (GantUtils.getSDKInstallPath(module, project).isEmpty()) {
      return false;
    }
  }

  return true;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:GantRunner.java

示例9: getCurrentCoverageSuite

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@Nullable
private CoverageSuitesBundle getCurrentCoverageSuite() {
  if (myModel == null) {
    return null;
  }

  final RunProfile runConf = myModel.getProperties().getConfiguration();
  if (runConf instanceof ModuleBasedConfiguration) {

    // if coverage supported for run configuration
    if (CoverageEnabledConfiguration.isApplicableTo((ModuleBasedConfiguration) runConf)) {

      // Get coverage settings
      Executor executor = myProperties.getExecutor();
      if (executor != null && executor.getId().equals(CoverageExecutor.EXECUTOR_ID)) {
        return CoverageDataManager.getInstance(myProperties.getProject()).getCurrentSuitesBundle();
      }
    }
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:TrackCoverageAction.java

示例10: canRun

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@Override
public boolean canRun(String executorId, RunProfile profile) {
  BlazeAndroidRunConfigurationHandler handler =
      BlazeAndroidRunConfigurationHandler.getHandlerFrom(profile);
  if (handler == null) {
    return false;
  }
  // In practice, the stock runner will probably handle all non-incremental-install configs.
  if (DefaultDebugExecutor.EXECUTOR_ID.equals(executorId)
      || DefaultRunExecutor.EXECUTOR_ID.equals(executorId)) {
    return true;
  }
  // Otherwise, the configuration must be a Blaze incremental install configuration running with
  // an incremental install executor.
  if (!(handler instanceof BlazeAndroidBinaryRunConfigurationHandler)) {
    return false;
  }
  AndroidBinaryLaunchMethod launchMethod =
      ((BlazeAndroidBinaryRunConfigurationHandler) handler).getState().getLaunchMethod();
  return (AndroidBinaryLaunchMethod.MOBILE_INSTALL.equals(launchMethod)
          || AndroidBinaryLaunchMethod.MOBILE_INSTALL_V2.equals(launchMethod))
      && (IncrementalInstallDebugExecutor.EXECUTOR_ID.equals(executorId)
          || IncrementalInstallRunExecutor.EXECUTOR_ID.equals(executorId));
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:25,代碼來源:BlazeAndroidBinaryProgramRunner.java

示例11: isApplicableTo

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
public static boolean isApplicableTo(RunProfile runProfile) {
  BlazeCommandRunConfiguration config = toBlazeConfig(runProfile);
  if (config == null) {
    return false;
  }
  if (Blaze.getBuildSystem(config.getProject()) != BuildSystem.Blaze) {
    // temporarily disable coverage for Bazel, until we properly interface with its API and output
    // file locations
    return false;
  }
  BlazeCommandRunConfigurationCommonState handlerState =
      config.getHandlerStateIfType(BlazeCommandRunConfigurationCommonState.class);
  if (handlerState == null) {
    return false;
  }
  BlazeCommandName command = handlerState.getCommandState().getCommand();
  return BlazeCommandName.TEST.equals(command) || BlazeCommandName.COVERAGE.equals(command);
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:19,代碼來源:CoverageUtils.java

示例12: findHotSwappableBlazeDebuggerSession

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@Nullable
static HotSwappableDebugSession findHotSwappableBlazeDebuggerSession(Project project) {
  DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
  DebuggerSession session = debuggerManager.getContext().getDebuggerSession();
  if (session == null || !session.isAttached()) {
    return null;
  }
  JavaDebugProcess process = session.getProcess().getXdebugProcess();
  if (process == null) {
    return null;
  }
  ExecutionEnvironment env = ((XDebugSessionImpl) process.getSession()).getExecutionEnvironment();
  if (env == null || ClassFileManifestBuilder.getManifest(env) == null) {
    return null;
  }
  RunProfile runProfile = env.getRunProfile();
  if (!(runProfile instanceof BlazeCommandRunConfiguration)) {
    return null;
  }
  return new HotSwappableDebugSession(session, env, (BlazeCommandRunConfiguration) runProfile);
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:22,代碼來源:BlazeHotSwapManager.java

示例13: getBackgroundListeningStates

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
/** Get all the background snapshot states. */
public List<CloudDebugProcessState> getBackgroundListeningStates() {
  List<CloudDebugProcessState> states = new ArrayList<CloudDebugProcessState>();

  for (Project project : ProjectManager.getInstance().getOpenProjects()) {
    Set<RunProfile> runningProfiles = getProfilesWithActiveDebugSession(project);

    RunManager manager = RunManager.getInstance(project);

    // find all CloudDebugRunConfiguration that do not have active debug sessions but are
    // listening in the background
    for (final RunnerAndConfigurationSettings config : manager.getAllSettings()) {
      if (notRunningConfiguration(runningProfiles, config.getConfiguration())) {
        if (config.getConfiguration() instanceof CloudDebugRunConfiguration) {
          final CloudDebugRunConfiguration cloudConfig =
              (CloudDebugRunConfiguration) config.getConfiguration();
          CloudDebugProcessState state = cloudConfig.getProcessState();
          if (listensInBackground(state)) {
            states.add(state);
          }
        }
      }
    }
  }
  return states;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-intellij,代碼行數:27,代碼來源:CloudDebugProcessStateCollector.java

示例14: stop

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@Override
public void stop() {
  getStateController().stopBackgroundListening();

  RunProfile profile = getXDebugSession().getRunProfile();
  if (profile instanceof CloudDebugRunConfiguration) {
    ((CloudDebugRunConfiguration) profile).setProcessState(processState);
  }

  getRepositoryValidator().restoreToOriginalState(getXDebugSession().getProject());

  XBreakpointManager breakpointManager =
      XDebuggerManager.getInstance(getXDebugSession().getProject()).getBreakpointManager();
  for (XBreakpoint bp : breakpointManager.getAllBreakpoints()) {
    com.intellij.debugger.ui.breakpoints.Breakpoint cloudBreakpoint =
        BreakpointManager.getJavaBreakpoint(bp);
    if (!(cloudBreakpoint instanceof CloudLineBreakpointType.CloudLineBreakpoint)) {
      continue;
    }
    CloudLineBreakpointType.CloudLineBreakpoint cloudLineBreakpoint =
        (CloudLineBreakpointType.CloudLineBreakpoint) cloudBreakpoint;
    cloudLineBreakpoint.setVerified(false);
    cloudLineBreakpoint.setErrorMessage(null);
    updateBreakpointPresentation(cloudLineBreakpoint);
  }
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-intellij,代碼行數:27,代碼來源:CloudDebugProcess.java

示例15: testGetProfilesWithActiveDebugSession_returnsNotStoppedSessionsWithRunProfile

import com.intellij.execution.configurations.RunProfile; //導入依賴的package包/類
@Test
public void testGetProfilesWithActiveDebugSession_returnsNotStoppedSessionsWithRunProfile() {
  Project project = mock(Project.class);

  XDebugSession notStoppedSession =
      createMockSession(false, mock(CloudDebugRunConfiguration.class));
  XDebugSession stoppedSession = createMockSession(true, mock(CloudDebugRunConfiguration.class));
  XDebugSession stoppedSessionWithoutRunProfile = createMockSession(true, null);

  createMockXDebuggerManager(
      project,
      new XDebugSession[] {notStoppedSession, stoppedSession, stoppedSessionWithoutRunProfile});

  Set<RunProfile> profiles =
      new CloudDebugProcessStateCollector().getProfilesWithActiveDebugSession(project);

  assertNotNull(profiles);
  assertThat(profiles).hasSize(1);
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-intellij,代碼行數:20,代碼來源:CloudDebugProcessStateCollectorTest.java


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