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


Java ModifiableFacetModel.removeFacet方法代码示例

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


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

示例1: cleanUpAndroidModuleWithoutVariants

import com.intellij.facet.ModifiableFacetModel; //导入方法依赖的package包/类
private static void cleanUpAndroidModuleWithoutVariants(@NotNull Module module) {
  // Remove Android facet, otherwise the IDE will try to build the module, and fail. The facet may have been added in a previous
  // successful commit.
  AndroidFacet facet = AndroidFacet.getInstance(module);
  if (facet != null) {
    ModifiableFacetModel facetModel = FacetManager.getInstance(module).createModifiableModel();
    facetModel.removeFacet(facet);
    facetModel.commit();
  }

  // Clear all source and exclude folders.
  ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);
  ModifiableRootModel rootModel = moduleRootManager.getModifiableModel();
  for (ContentEntry contentEntry : rootModel.getContentEntries()) {
    contentEntry.clearSourceFolders();
    contentEntry.clearExcludeFolders();
  }

  rootModel.commit();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:JavaProjectDataService.java

示例2: removeFacet

import com.intellij.facet.ModifiableFacetModel; //导入方法依赖的package包/类
private void removeFacet(BuildoutFacet facet) {
  final ModifiableFacetModel model = FacetManager.getInstance(myModule).createModifiableModel();
  model.removeFacet(facet);
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    public void run() {
      model.commit();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:BuildoutConfigurable.java

示例3: removeAllFacetsOfType

import com.intellij.facet.ModifiableFacetModel; //导入方法依赖的package包/类
public static <T extends Facet> void removeAllFacetsOfType(@NotNull Module module, @NotNull FacetTypeId<T> typeId) {
  FacetManager facetManager = FacetManager.getInstance(module);
  Collection<T> facets = facetManager.getFacetsByType(typeId);
  if (!facets.isEmpty()) {
    ModifiableFacetModel model = facetManager.createModifiableModel();
    try {
      for (T facet : facets) {
        model.removeFacet(facet);
      }
    }
    finally {
      model.commit();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:Facets.java

示例4: removeAndroidFacet

import com.intellij.facet.ModifiableFacetModel; //导入方法依赖的package包/类
public static void removeAndroidFacet(Module module) {
  AndroidFacet facet = AndroidFacet.getInstance(module);
  if (facet != null) {
    ModifiableFacetModel facetModel = FacetManager.getInstance(module).createModifiableModel();
    facetModel.removeFacet(facet);
    facetModel.commit();
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:9,代码来源:AndroidFacetModuleCustomizer.java

示例5: removeFacet

import com.intellij.facet.ModifiableFacetModel; //导入方法依赖的package包/类
private static void removeFacet(Module workspaceModule) {
  FacetManager manager = FacetManager.getInstance(workspaceModule);
  ModifiableFacetModel facetModel = manager.createModifiableModel();
  LibraryContributingFacet<?> facet = manager.findFacet(PythonFacetUtil.getFacetId(), "Python");
  if (facet != null) {
    facetModel.removeFacet(facet);
    facetModel.commit();
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:10,代码来源:BlazePythonSyncPlugin.java

示例6: getOrCreatePythonFacet

import com.intellij.facet.ModifiableFacetModel; //导入方法依赖的package包/类
@Nullable
private static LibraryContributingFacet<?> getOrCreatePythonFacet(
    BlazeContext context, Module module) {
  LibraryContributingFacet<?> facet = findPythonFacet(module);
  if (facet != null && facetHasSdk(facet)) {
    return facet;
  }
  FacetManager manager = FacetManager.getInstance(module);
  ModifiableFacetModel facetModel = manager.createModifiableModel();
  if (facet != null) {
    // we can't modify in place, IntelliJ has no hook to trigger change events. Instead we create
    // a new facet.
    facetModel.removeFacet(facet);
  }
  Sdk sdk = getOrCreatePythonSdk();
  if (sdk == null) {
    String msg =
        "Unable to find a Python SDK installed.\n"
            + "After configuring a suitable SDK in the \"Project Structure\" dialog, "
            + "sync the project again.";
    IssueOutput.error(msg).submit(context);
    return null;
  }
  facet = manager.createFacet(PythonFacetUtil.getTypeInstance(), "Python", null);
  facetModel.addFacet(facet);
  facetModel.commit();
  return facet;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:29,代码来源:BlazePythonSyncPlugin.java


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