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


Java ExternalSystemConstants类代码示例

本文整理汇总了Java中com.intellij.openapi.externalSystem.util.ExternalSystemConstants的典型用法代码示例。如果您正苦于以下问题:Java ExternalSystemConstants类的具体用法?Java ExternalSystemConstants怎么用?Java ExternalSystemConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExternalSystemConstants类属于com.intellij.openapi.externalSystem.util包,在下文中一共展示了ExternalSystemConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: after

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Override
public void after(@NotNull List<? extends VFileEvent> events) {
  boolean scheduleRefresh = false;
  for (VFileEvent event : events) {
    String changedPath = event.getPath();
    for (MyEntry entry : myAutoImportAware) {
      String projectPath = entry.aware.getAffectedExternalProjectPath(changedPath, myProject);
      if (projectPath == null) {
        continue;
      }
      ExternalProjectSettings projectSettings = entry.systemSettings.getLinkedProjectSettings(projectPath);
      if (projectSettings != null && projectSettings.isUseAutoImport()) {
        addPath(entry.externalSystemId, projectPath);
        scheduleRefresh = true;
        break;
      }
    }
  }
  if (scheduleRefresh) {
    myVfsAlarm.cancelAllRequests();
    myVfsAlarm.addRequest(myFilesRequest, ExternalSystemConstants.AUTO_IMPORT_DELAY_MILLIS);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ExternalSystemAutoImporter.java

示例2: getDescription

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Override
public String getDescription(ExternalSystemBeforeRunTask task) {
  final String externalProjectPath = task.getTaskExecutionSettings().getExternalProjectPath();

  if (task.getTaskExecutionSettings().getTaskNames().isEmpty()) {
    return ExternalSystemBundle.message("tasks.before.run.empty", mySystemId.getReadableName());
  }

  String desc = StringUtil.join(task.getTaskExecutionSettings().getTaskNames(), " ");
  for (Module module : ModuleManager.getInstance(myProject).getModules()) {
    if (!mySystemId.toString().equals(module.getOptionValue(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY))) continue;

    if (StringUtil.equals(externalProjectPath, module.getOptionValue(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY))) {
      desc = module.getName() + ": " + desc;
      break;
    }
  }

  return ExternalSystemBundle.message("tasks.before.run", mySystemId.getReadableName(), desc);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ExternalSystemBeforeRunTaskProvider.java

示例3: enhanceRemoteProcessing

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Override
public void enhanceRemoteProcessing(@NotNull SimpleJavaParameters parameters) throws ExecutionException {
  final Set<String> additionalEntries = ContainerUtilRt.newHashSet();
  for (GradleProjectResolverExtension extension : RESOLVER_EXTENSIONS.getValue()) {
    ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(extension.getClass()));
    for (Class aClass : extension.getExtraProjectModelClasses()) {
      ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(aClass));
    }
    extension.enhanceRemoteProcessing(parameters);
  }

  final PathsList classPath = parameters.getClassPath();
  for (String entry : additionalEntries) {
    classPath.add(entry);
  }

  parameters.getVMParametersList().addProperty(
    ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY, GradleConstants.SYSTEM_ID.getId());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:GradleManager.java

示例4: isConfigurationFromContext

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Override
public boolean isConfigurationFromContext(ExternalSystemRunConfiguration configuration, ConfigurationContext context) {
  if (configuration == null) return false;
  if (!GradleConstants.SYSTEM_ID.equals(configuration.getSettings().getExternalSystemId())) return false;

  final PsiPackage psiPackage = JavaRuntimeConfigurationProducerBase.checkPackage(context.getPsiLocation());
  if (psiPackage == null) return false;

  if (context.getModule() == null) return false;

  if (!StringUtil.equals(
    context.getModule().getOptionValue(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY),
    configuration.getSettings().getExternalProjectPath())) {
    return false;
  }
  if (!configuration.getSettings().getTaskNames().containsAll(TASKS_TO_RUN)) return false;

  final String scriptParameters = configuration.getSettings().getScriptParameters() + ' ';
  return psiPackage.getQualifiedName().isEmpty()
         ? scriptParameters.contains("--tests * ")
         : scriptParameters.contains(String.format("--tests %s.* ", psiPackage.getQualifiedName()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AllInPackageGradleConfigurationProducer.java

示例5: applyTestMethodConfiguration

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
private static boolean applyTestMethodConfiguration(@NotNull ExternalSystemRunConfiguration configuration,
                                                    @NotNull ConfigurationContext context,
                                                    @NotNull PsiMethod psiMethod,
                                                    @NotNull PsiClass... containingClasses) {
  if (!StringUtil.equals(
    context.getModule().getOptionValue(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY),
    GradleConstants.SYSTEM_ID.toString())) {
    return false;
  }

  configuration.getSettings().setExternalProjectPath(context.getModule().getOptionValue(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY));
  configuration.getSettings().setTaskNames(TASKS_TO_RUN);

  StringBuilder buf = new StringBuilder();
  for (PsiClass aClass : containingClasses) {
    buf.append(creatTestFilter(aClass, psiMethod));
  }

  configuration.getSettings().setScriptParameters(buf.toString().trim());
  configuration.setName(psiMethod.getName());
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:TestMethodGradleConfigurationProducer.java

示例6: getClassRoots

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Nullable
public List<File> getClassRoots(@Nullable Project project, @Nullable String rootProjectPath) {
  if (project == null) return null;

  if(rootProjectPath == null) {
    for (Module module : ModuleManager.getInstance(project).getModules()) {
      rootProjectPath = module.getOptionValue(ExternalSystemConstants.ROOT_PROJECT_PATH_KEY);
      List<File> result = findGradleSdkClasspath(project, rootProjectPath);
      if(!result.isEmpty()) return result;
    }
  } else {
    return findGradleSdkClasspath(project, rootProjectPath);
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:GradleInstallationManager.java

示例7: patchResolveScopeInner

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
public GlobalSearchScope patchResolveScopeInner(@Nullable Module module, @NotNull GlobalSearchScope baseScope) {
  if (module == null) return GlobalSearchScope.EMPTY_SCOPE;
  final String externalSystemId = module.getOptionValue(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY);
  if (!GradleConstants.SYSTEM_ID.toString().equals(externalSystemId)) return baseScope;

  GlobalSearchScope result = GlobalSearchScope.EMPTY_SCOPE;
  final Project project = module.getProject();
  for (OrderEntry entry : ModuleRootManager.getInstance(module).getOrderEntries()) {
    if (entry instanceof JdkOrderEntry) {
      GlobalSearchScope scopeForSdk = LibraryScopeCache.getInstance(project).getScopeForSdk((JdkOrderEntry)entry);
      result = result.uniteWith(scopeForSdk);
    }
  }

  String modulePath = module.getOptionValue(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);
  if (modulePath == null) return result;

  final Collection<VirtualFile> files = GradleBuildClasspathManager.getInstance(project).getModuleClasspathEntries(modulePath);

  result = new ExternalModuleBuildGlobalSearchScope(project, result.uniteWith(new NonClasspathDirectoriesScope(files)), modulePath);

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:GradleScriptType.java

示例8: setMavenizedModules

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
public void setMavenizedModules(Collection<Module> modules, boolean mavenized) {
  ApplicationManager.getApplication().assertWriteAccessAllowed();
  for (Module m : modules) {
    if (m.isDisposed()) continue;

    if (mavenized) {
      m.setOption(getMavenizedModuleOptionName(), "true");

      // clear external system API options
      // see com.intellij.openapi.externalSystem.service.project.manage.ModuleDataService#setModuleOptions
      m.clearOption(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY);
      m.clearOption(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);
      m.clearOption(ExternalSystemConstants.ROOT_PROJECT_PATH_KEY);
      m.clearOption(ExternalSystemConstants.EXTERNAL_SYSTEM_MODULE_GROUP_KEY);
      m.clearOption(ExternalSystemConstants.EXTERNAL_SYSTEM_MODULE_VERSION_KEY);
    }
    else {
      m.clearOption(getMavenizedModuleOptionName());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:MavenProjectsManager.java

示例9: initComponent

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Override
public void initComponent() {
  // The Pants plugin doesn't do so many computations for building a project
  // to start an external JVM each time.
  // The plugin only calls `export` goal and parses JSON response.
  // So it will be in process all the time.
  final String key = PantsConstants.SYSTEM_ID.getId() + ExternalSystemConstants.USE_IN_PROCESS_COMMUNICATION_REGISTRY_KEY_SUFFIX;
  Registry.get(key).setValue(true);

  // hack to trick BuildProcessClasspathManager
  final String basePath = System.getProperty("pants.plugin.base.path");
  final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(PantsConstants.PLUGIN_ID));
  if (StringUtil.isNotEmpty(basePath) && plugin instanceof IdeaPluginDescriptorImpl) {
    ((IdeaPluginDescriptorImpl) plugin).setPath(new File(basePath));
  }

  registerPantsActions();
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:19,代码来源:PantsInitComponentImpl.java

示例10: filterExistingModules

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@NotNull
private Collection<DataNode<ModuleData>> filterExistingModules(@NotNull Collection<DataNode<ModuleData>> modules,
                                                               @NotNull Project project)
{
  Collection<DataNode<ModuleData>> result = ContainerUtilRt.newArrayList();
  for (DataNode<ModuleData> node : modules) {
    ModuleData moduleData = node.getData();
    Module module = myProjectStructureHelper.findIdeModule(moduleData, project);
    if (module == null) {
      result.add(node);
    }
    else {
      module.setOption(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY, moduleData.getOwner().toString());
      module.setOption(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY, moduleData.getLinkedExternalProjectPath());
    }
  }
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:ModuleDataService.java

示例11: after

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Override
public void after(@Nonnull List<? extends VFileEvent> events) {
  boolean scheduleRefresh = false;
  for (VFileEvent event : events) {
    String changedPath = event.getPath();
    for (MyEntry entry : myAutoImportAware) {
      String projectPath = entry.aware.getAffectedExternalProjectPath(changedPath, myProject);
      if (projectPath == null) {
        continue;
      }
      ExternalProjectSettings projectSettings = entry.systemSettings.getLinkedProjectSettings(projectPath);
      if (projectSettings != null && projectSettings.isUseAutoImport()) {
        addPath(entry.externalSystemId, projectPath);
        scheduleRefresh = true;
        break;
      }
    }
  }
  if (scheduleRefresh) {
    myVfsAlarm.cancelAllRequests();
    myVfsAlarm.addRequest(myFilesRequest, ExternalSystemConstants.AUTO_IMPORT_DELAY_MILLIS);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:ExternalSystemAutoImporter.java

示例12: testEnsureSize

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Test
public void testEnsureSize() throws Exception {
  List<ExternalTaskExecutionInfo> tasks = ContainerUtilRt.newArrayList();

  // test task list widening
  myModel.setTasks(tasks);
  myModel.ensureSize(ExternalSystemConstants.RECENT_TASKS_NUMBER);
  Assert.assertEquals("task list widening failed", ExternalSystemConstants.RECENT_TASKS_NUMBER, myModel.getSize());

  // test task list reduction
  for (int i = 0; i < ExternalSystemConstants.RECENT_TASKS_NUMBER + 1; i++) {
    tasks.add(new ExternalTaskExecutionInfo(new ExternalSystemTaskExecutionSettings(), "task" + i));
  }
  myModel.setTasks(tasks);
  Assert.assertEquals(ExternalSystemConstants.RECENT_TASKS_NUMBER + 1, myModel.getSize());

  myModel.ensureSize(ExternalSystemConstants.RECENT_TASKS_NUMBER);
  Assert.assertEquals("task list reduction failed", ExternalSystemConstants.RECENT_TASKS_NUMBER, myModel.getSize());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:ExternalSystemRecentTaskListModelTest.java

示例13: main

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void main(String[] args) throws Exception {
  if (args.length < 1) {
    throw new IllegalArgumentException(
      "Can't create external system facade. Reason: given arguments don't contain information about external system resolver to use");
  }
  final Class<ExternalSystemProjectResolver<?>> resolverClass = (Class<ExternalSystemProjectResolver<?>>)Class.forName(args[0]);
  if (!ExternalSystemProjectResolver.class.isAssignableFrom(resolverClass)) {
    throw new IllegalArgumentException(String.format(
      "Can't create external system facade. Reason: given external system resolver class (%s) must be IS-A '%s'",
      resolverClass,
      ExternalSystemProjectResolver.class));
  }

  if (args.length < 2) {
    throw new IllegalArgumentException(
      "Can't create external system facade. Reason: given arguments don't contain information about external system build manager to use"
    );
  }
  final Class<ExternalSystemTaskManager<?>> buildManagerClass = (Class<ExternalSystemTaskManager<?>>)Class.forName(args[1]);
  if (!ExternalSystemProjectResolver.class.isAssignableFrom(resolverClass)) {
    throw new IllegalArgumentException(String.format(
      "Can't create external system facade. Reason: given external system build manager (%s) must be IS-A '%s'",
      buildManagerClass, ExternalSystemTaskManager.class
    ));
  }

  // running the code indicates remote communication mode with external system
  Registry.get(
    System.getProperty(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY) +
    ExternalSystemConstants.USE_IN_PROCESS_COMMUNICATION_REGISTRY_KEY_SUFFIX).setValue(false);

  RemoteExternalSystemFacadeImpl facade = new RemoteExternalSystemFacadeImpl(resolverClass, buildManagerClass);
  facade.init();
  start(facade);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:RemoteExternalSystemFacadeImpl.java

示例14: getRootProjectPath

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Nullable
private static String getRootProjectPath(@NotNull Module module) {
  String externalSystemId = module.getOptionValue(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY);
  if (externalSystemId == null || !GradleConstants.SYSTEM_ID.toString().equals(externalSystemId)) {
    return null;
  }

  String path = module.getOptionValue(ExternalSystemConstants.ROOT_PROJECT_PATH_KEY);
  return StringUtil.isEmpty(path) ? null : path;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:UseDistributionWithSourcesNotificationProvider.java

示例15: setupConfigurationFromContext

import com.intellij.openapi.externalSystem.util.ExternalSystemConstants; //导入依赖的package包/类
@Override
protected boolean setupConfigurationFromContext(ExternalSystemRunConfiguration configuration,
                                                ConfigurationContext context,
                                                Ref<PsiElement> sourceElement) {

  final PsiPackage psiPackage = JavaRuntimeConfigurationProducerBase.checkPackage(context.getPsiLocation());
  if (psiPackage == null) return false;
  sourceElement.set(psiPackage);

  final Module module = context.getModule();
  if (module == null) return false;

  if (!StringUtil.equals(
    module.getOptionValue(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY),
    GradleConstants.SYSTEM_ID.toString())) {
    return false;
  }

  final String linkedGradleProject = module.getOptionValue(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);
  if (linkedGradleProject == null) return false;
  configuration.getSettings().setExternalProjectPath(linkedGradleProject);
  configuration.getSettings().setTaskNames(TASKS_TO_RUN);
  if (psiPackage.getQualifiedName().isEmpty()) {
    configuration.getSettings().setScriptParameters("--tests *");
  }
  else {
    configuration.getSettings()
      .setScriptParameters(String.format("--tests %s.*", psiPackage.getQualifiedName()));
  }
  configuration.setName(suggestName(psiPackage, module));
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:AllInPackageGradleConfigurationProducer.java


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