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


Java FacetTypeRegistry类代码示例

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


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

示例1: excludeFrameworkDetection

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
private void excludeFrameworkDetection(final Project project, FacetTypeId facetTypeId) {
    final DetectionExcludesConfiguration configuration = DetectionExcludesConfiguration.getInstance(project);
    final FacetType facetType = FacetTypeRegistry.getInstance().findFacetType(facetTypeId);
    final FrameworkType frameworkType = FrameworkDetectionUtil.findFrameworkTypeForFacetDetector(facetType);

    if (frameworkType != null) {
        configuration.addExcludedFramework(frameworkType);
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:10,代码来源:ImportProjectProgressModalWindow.java

示例2: configure

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
@Override
public void configure(
    @NotNull final ModifiableFacetModel modifiableFacetModel,
    @NotNull final HybrisModuleDescriptor moduleDescriptor,
    @NotNull final Module javaModule,
    @NotNull final ModifiableRootModel modifiableRootModel
) {
    final File webRoot = moduleDescriptor.getWebRoot();
    if (null == webRoot) {
        return;
    }

    WebFacet webFacet = modifiableFacetModel.getFacetByType(WebFacet.ID);

    if (webFacet == null) {
        final FacetType<WebFacet, FacetConfiguration> webFacetType = FacetTypeRegistry.getInstance().findFacetType(
            WebFacet.ID
        );

        if (!webFacetType.isSuitableModuleType(ModuleType.get(javaModule))) {
            return;
        }

        webFacet = FacetManager.getInstance(javaModule).createFacet(
            webFacetType, webFacetType.getDefaultFacetName(), null
        );

        modifiableFacetModel.addFacet(webFacet);

    } else {
        webFacet.removeAllWebRoots();
        webFacet.getDescriptorsContainer().getConfiguration().removeConfigFiles(
            DeploymentDescriptorsConstants.WEB_XML_META_DATA
        );
    }

    webFacet.setWebSourceRoots(modifiableRootModel.getSourceRootUrls(false));
    webFacet.addWebRootNoFire(VfsUtil.pathToUrl(FileUtil.toSystemIndependentName(webRoot.getAbsolutePath())), "/");
    this.setupFacetDeploymentDescriptor(webFacet, moduleDescriptor);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:41,代码来源:WebFacetConfigurator.java

示例3: setMuleFacet

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
public void setMuleFacet(Module module) {
    MuleFacetType type = (MuleFacetType)FacetTypeRegistry.getInstance().findFacetType(MuleFacet.ID);
    MuleFacetConfiguration configuration = type.createDefaultConfiguration();
    configuration.setPathToSdk(MuleSdkManager.getInstance().findFromVersion(muleVersion).getMuleHome());
    Facet facet = type.createFacet(module, type.getPresentableName(), configuration, null);
    ModifiableFacetModel model = FacetManager.getInstance(module).createModifiableModel();
    model.addFacet(facet);
    model.commit();
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:10,代码来源:MuleMavenModuleBuilder.java

示例4: createAddFacetActions

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
public static AnAction[] createAddFacetActions(FacetStructureConfigurable configurable) {
  final List<AnAction> result = new ArrayList<AnAction>();
  final StructureConfigurableContext context = configurable.myContext;
  for (FacetType type : FacetTypeRegistry.getInstance().getSortedFacetTypes()) {
    if (hasSuitableModules(context, type)) {
      result.add(new AddFacetOfTypeAction(type, context));
    }
  }
  return result.toArray(new AnAction[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:AddFacetOfTypeAction.java

示例5: getFacetTypes

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
public List<FacetType> getFacetTypes() {
  return ContainerUtil.mapNotNull(getFacetIds(), new NullableFunction<String, FacetType>() {
    @Override
    public FacetType fun(String facetId) {
      return FacetTypeRegistry.getInstance().findFacetType(facetId);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FacetDependentToolWindow.java

示例6: createTestModules

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
/** Creates all {@link Module modules} annotated with {@link TestModule}. */
private void createTestModules() throws IllegalAccessException {
  for (Field field : getFieldsWithAnnotation(testInstance.getClass(), TestModule.class)) {
    field.setAccessible(true);
    if (!field.getType().equals(Module.class)) {
      throw new IllegalArgumentException(
          "@TestModule can only annotate fields of type com.intellij.openapi.module.Module");
    }

    writeOnMainThread(
        () -> {
          Module module =
              ModuleManager.getInstance(testFixture.getProject())
                  .newModule(
                      testFixture.getProject().getBasePath()
                          + "/"
                          + moduleCounter.incrementAndGet()
                          + ModuleFileType.DOT_DEFAULT_EXTENSION,
                      ModuleType.EMPTY.getId());
          field.set(testInstance, module);

          String facetTypeId = field.getAnnotation(TestModule.class).facetTypeId();
          if (!Strings.isNullOrEmpty(facetTypeId)) {
            FacetType<?, ?> facetType =
                FacetTypeRegistry.getInstance().findFacetType(facetTypeId);
            FacetManager.getInstance(module)
                .addFacet(facetType, facetTypeId, /* underlying= */ null);
          }
        });
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:32,代码来源:CloudToolsRule.java

示例7: configure

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
@Override
public void configure(
    @NotNull final ModifiableFacetModel modifiableFacetModel,
    @NotNull final HybrisModuleDescriptor moduleDescriptor,
    @NotNull final Module javaModule,
    @NotNull final ModifiableRootModel modifiableRootModel
) {
    Validate.notNull(javaModule);
    Validate.notNull(modifiableFacetModel);
    Validate.notNull(moduleDescriptor);
    Validate.notNull(modifiableFacetModel);

    SpringFacet springFacet = modifiableFacetModel.getFacetByType(SpringFacet.FACET_TYPE_ID);

    if (springFacet == null) {
        final FacetType<SpringFacet, SpringFacetConfiguration> springFacetType = FacetTypeRegistry
            .getInstance().findFacetType(SpringFacet.FACET_TYPE_ID);

        if (!springFacetType.isSuitableModuleType(ModuleType.get(javaModule))) {
            return;
        }

        springFacet = springFacetType.createFacet(
            javaModule, springFacetType.getDefaultFacetName(), springFacetType.createDefaultConfiguration(), null
        );

        modifiableFacetModel.addFacet(springFacet);
    } else {
        springFacet.removeFileSets();
    }

    final String facetId = moduleDescriptor.getName() + SpringFacet.FACET_TYPE_ID.toString();
    final SpringFileSet springFileSet = springFacet.addFileSet(facetId, facetId);

    for (String springFile : moduleDescriptor.getSpringFileSet()) {
        final VirtualFile vf = VfsUtil.findFileByIoFile(new File(springFile), true);

        if (null != vf) {
            springFileSet.addFile(vf);
        }
    }
    final CustomSetting.BOOLEAN setting = springFacet.findSetting(LocalXmlModel.PROCESS_EXPLICITLY_ANNOTATED);

    if (setting != null) {
        setting.setBooleanValue(false);
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:48,代码来源:SpringFacetConfigurator.java

示例8: getFacetType

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
@NotNull
public static XposedFacetType getFacetType() {
    return (XposedFacetType)FacetTypeRegistry.getInstance().findFacetType(ID);
}
 
开发者ID:apsun,项目名称:XposedPlugin,代码行数:5,代码来源:XposedFacet.java

示例9: getCreateElementIcon

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
@Override
public Icon getCreateElementIcon() {
  return FacetTypeRegistry.getInstance().findFacetType(myFacetType).getIcon();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FacetBasedPackagingElementType.java

示例10: getItemIcon

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
@Override
protected Icon getItemIcon(F item) {
  return FacetTypeRegistry.getInstance().findFacetType(myFacetType).getIcon();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FacetBasedPackagingElementType.java

示例11: getInstance

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
public static BuildoutFacetType getInstance() {
  return (BuildoutFacetType)FacetTypeRegistry.getInstance().findFacetType(ID);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:BuildoutFacetType.java

示例12: getFacetType

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
@NotNull
public static AndroidFacetType getFacetType() {
  return (AndroidFacetType)FacetTypeRegistry.getInstance().findFacetType(ID);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:AndroidFacet.java

示例13: mockFacetRegistry

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
private void mockFacetRegistry(Container applicationServices) {
  applicationServices.register(FacetTypeRegistry.class, new FacetTypeRegistryImpl());
  registerExtensionPoint(FacetType.EP_NAME, FacetType.class)
      .registerExtension(new AndroidFacetType());
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:6,代码来源:BlazeAndroidProjectPathsTest.java

示例14: registerFacet

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
private void registerFacet()
{
    FacetTypeRegistry facetTypeRegistry = FacetTypeRegistry.getInstance();
    facetTypeRegistry.registerFacetType( polygeneFacetType );
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:6,代码来源:PolygeneApplicationComponent.java

示例15: unregisterFacet

import com.intellij.facet.FacetTypeRegistry; //导入依赖的package包/类
private void unregisterFacet()
{
    FacetTypeRegistry facetTypeRegistry = FacetTypeRegistry.getInstance();
    facetTypeRegistry.unregisterFacetType( polygeneFacetType );
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:6,代码来源:PolygeneApplicationComponent.java


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