• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ModifiableFacetModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: configureDependencies

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
@Override
public void configureDependencies(
    final @NotNull HybrisProjectDescriptor hybrisProjectDescriptor,
    final @NotNull IdeModifiableModelsProvider modifiableModelsProvider
) {
    final Map<String, ModifiableFacetModel> modifiableFacetModelMap = ContainerUtil.newHashMap();

    for (Module module : modifiableModelsProvider.getModules()) {
        final ModifiableFacetModel modifiableFacetModel = modifiableModelsProvider.getModifiableFacetModel(module);
        modifiableFacetModelMap.put(module.getName(), modifiableFacetModel);
    }

    for (HybrisModuleDescriptor moduleDescriptor : hybrisProjectDescriptor.getModulesChosenForImport()) {
        configureFacetDependencies(moduleDescriptor, modifiableFacetModelMap);
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:17,代码来源:DefaultSpringConfigurator.java


示例2: configureFacetDependencies

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
private void configureFacetDependencies(
    @NotNull final HybrisModuleDescriptor moduleDescriptor,
    @NotNull final Map<String, ModifiableFacetModel> modifiableFacetModelMap
) {
    Validate.notNull(moduleDescriptor);
    Validate.notNull(modifiableFacetModelMap);

    final SpringFileSet springFileSet = getSpringFileSet(modifiableFacetModelMap, moduleDescriptor.getName());
    if (springFileSet == null) {
        return;
    }

    for (HybrisModuleDescriptor dependsOnModule : moduleDescriptor.getDependenciesTree()) {
        final SpringFileSet parentFileSet = getSpringFileSet(modifiableFacetModelMap, dependsOnModule.getName());
        if (parentFileSet == null) {
            continue;
        }
        springFileSet.addDependency(parentFileSet);
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:21,代码来源:DefaultSpringConfigurator.java


示例3: getSpringFileSet

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
private SpringFileSet getSpringFileSet(
    @NotNull final Map<String, ModifiableFacetModel> modifiableFacetModelMap,
    @NotNull final String moduleName
) {
    Validate.notNull(moduleName);
    Validate.notNull(modifiableFacetModelMap);

    final ModifiableFacetModel modifiableFacetModel = modifiableFacetModelMap.get(moduleName);
    if (modifiableFacetModel == null) {
        return null;
    }
    final SpringFacet springFacet = modifiableFacetModel.getFacetByType(SpringFacet.FACET_TYPE_ID);
    if (springFacet == null || springFacet.getFileSets().isEmpty()) {
        return null;
    }
    return springFacet.getFileSets().iterator().next();
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:18,代码来源:DefaultSpringConfigurator.java


示例4: setupFacet

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
static void setupFacet(Module module, @NotNull BuildoutFacetConfiguration config) {
  //TODO: refactor, see other python facets
  FacetManager facetManager = FacetManager.getInstance(module);
  final ModifiableFacetModel model = facetManager.createModifiableModel();
  BuildoutFacetType facetType = BuildoutFacetType.getInstance();
  BuildoutFacet facet = facetManager.createFacet(facetType, facetType.getDefaultFacetName(), config, null);
  model.addFacet(facet);

  new WriteAction() {
    protected void run(@NotNull final Result result) throws Throwable {
      model.commit();
    }
  }.execute();
  facet.updatePaths();
  BuildoutFacet.attachLibrary(module);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:BuildoutFacetConfigurator.java


示例5: addAndroidFacet

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
@NotNull
public static AndroidFacet addAndroidFacet(final Module module, @NotNull VirtualFile contentRoot,
                                           boolean library) {
  final FacetManager facetManager = FacetManager.getInstance(module);
  ModifiableFacetModel model = facetManager.createModifiableModel();
  AndroidFacet facet = model.getFacetByType(AndroidFacet.ID);

  if (facet == null) {
    facet = facetManager.createFacet(AndroidFacet.getFacetType(), "Android", null);
    AndroidFacetConfiguration configuration = facet.getConfiguration();
    configuration.init(module, contentRoot);
    if (library) {
      configuration.getState().LIBRARY_PROJECT = true;
    }
    model.addFacet(facet);
  }
  model.commit();

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


示例6: setAndGetJavaGradleFacet

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
@NotNull
private static JavaGradleFacet setAndGetJavaGradleFacet(Module module) {
  JavaGradleFacet facet = JavaGradleFacet.getInstance(module);
  if (facet != null) {
    return facet;
  }

  // Module does not have Android-Gradle facet. Create one and add it.
  FacetManager facetManager = FacetManager.getInstance(module);
  ModifiableFacetModel model = facetManager.createModifiableModel();
  try {
    facet = facetManager.createFacet(JavaGradleFacet.getFacetType(), JavaGradleFacet.NAME, null);
    model.addFacet(facet);
  }
  finally {
    model.commit();
  }
  return facet;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DependenciesModuleCustomizer.java


示例7: customizeModule

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
@Override
public void customizeModule(@NotNull Project project,
                            @NotNull Module module,
                            @NotNull IdeModifiableModelsProvider modelsProvider,
                            @Nullable IdeaAndroidProject androidProject) {
  if (androidProject == null) {
    removeAllFacetsOfType(AndroidFacet.ID, modelsProvider.getModifiableFacetModel(module));
  }
  else {
    AndroidFacet facet = AndroidFacet.getInstance(module);
    if (facet != null) {
      configureFacet(facet, androidProject);
    }
    else {
      // Module does not have Android facet. Create one and add it.
      ModifiableFacetModel model = modelsProvider.getModifiableFacetModel(module);
      final AndroidFacetType facetType = AndroidFacet.getFacetType();
      facet = facetType.createFacet(module, AndroidFacet.NAME, facetType.createDefaultConfiguration(), null);
      model.addFacet(facet);
      configureFacet(facet, androidProject);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AndroidFacetModuleCustomizer.java


示例8: 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


示例9: addAndroidFacet

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
public static AndroidFacet addAndroidFacet(Module module, String sdkPath, String platformDir, boolean addSdk) {
  FacetManager facetManager = FacetManager.getInstance(module);
  AndroidFacet facet = facetManager.createFacet(AndroidFacet.getFacetType(), "Android", null);

  if (addSdk) {
    addAndroidSdk(module, sdkPath, platformDir);
  }
  final ModifiableFacetModel facetModel = facetManager.createModifiableModel();
  facetModel.addFacet(facet);
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      facetModel.commit();
    }
  });
  return facet;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:AndroidTestCase.java


示例10: setUpLibModule

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
private void setUpLibModule() {
  FacetManager facetManager = FacetManager.getInstance(myLibModule);
  ModifiableFacetModel facetModel = facetManager.createModifiableModel();
  try {
    AndroidFacet androidFacet = createFacet(facetManager, true);
    androidFacet.setIdeaAndroidProject(myLib);
    facetModel.addFacet(androidFacet);

    AndroidGradleFacet gradleFacet = facetManager.createFacet(AndroidGradleFacet.getFacetType(), AndroidGradleFacet.NAME, null);
    gradleFacet.getConfiguration().GRADLE_PROJECT_PATH = myLibGradlePath;
    facetModel.addFacet(gradleFacet);
  }
  finally {
    facetModel.commit();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ConflictSetTest.java


示例11: testRemoveAllFacetsWithAndroidFacets

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
public void testRemoveAllFacetsWithAndroidFacets() throws Exception {
  FacetManager facetManager = FacetManager.getInstance(myModule);
  ModifiableFacetModel model = facetManager.createModifiableModel();
  try {
    AndroidFacet facet = facetManager.createFacet(AndroidFacet.getFacetType(), AndroidFacet.NAME, null);
    model.addFacet(facet);
  }
  finally {
    model.commit();
  }

  assertEquals(1, facetManager.getFacetsByType(AndroidFacet.ID).size());

  Facets.removeAllFacetsOfType(myModule, AndroidFacet.ID);

  assertEquals(0, facetManager.getFacetsByType(AndroidFacet.ID).size());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FacetsTest.java


示例12: testRemoveAllFacetsWithAndroidGradleFacets

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
public void testRemoveAllFacetsWithAndroidGradleFacets() throws Exception {
  FacetManager facetManager = FacetManager.getInstance(myModule);
  ModifiableFacetModel model = facetManager.createModifiableModel();
  try {
    AndroidGradleFacet facet = facetManager.createFacet(AndroidGradleFacet.getFacetType(), AndroidGradleFacet.NAME, null);
    model.addFacet(facet);
  }
  finally {
    model.commit();
  }

  assertEquals(1, facetManager.getFacetsByType(AndroidGradleFacet.TYPE_ID).size());

  Facets.removeAllFacetsOfType(myModule, AndroidGradleFacet.TYPE_ID);

  assertEquals(0, facetManager.getFacetsByType(AndroidGradleFacet.TYPE_ID).size());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FacetsTest.java


示例13: setUp

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  AndroidTestCaseHelper.removeExistingAndroidSdks();
  myAndroidSdkPath = AndroidTestCaseHelper.getAndroidSdkPath();

  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      FacetManager facetManager = FacetManager.getInstance(myModule);
      ModifiableFacetModel model = facetManager.createModifiableModel();
      try {
        model.addFacet(facetManager.createFacet(AndroidFacet.getFacetType(), AndroidFacet.NAME, null));
      } finally {
        model.commit();
      }
    }
  });
  AndroidFacet facet = AndroidFacet.getInstance(myModule);
  assertNotNull(facet);
  facet.getProperties().ALLOW_USER_CONFIGURATION = false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:IdeSdksTest.java


示例14: createAndroidFacet

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
public static void createAndroidFacet(Module module) {
  AndroidFacet facet = AndroidFacet.getInstance(module);
  if (facet != null) {
    configureFacet(facet);
  } else {
    // Module does not have Android facet. Create one and add it.
    FacetManager facetManager = FacetManager.getInstance(module);
    ModifiableFacetModel model = facetManager.createModifiableModel();
    try {
      facet = facetManager.createFacet(AndroidFacet.getFacetType(), AndroidFacet.NAME, null);
      model.addFacet(facet);
      configureFacet(facet);
    } finally {
      model.commit();
    }
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:18,代码来源:AndroidFacetModuleCustomizer.java


示例15: configure

import com.intellij.facet.ModifiableFacetModel; //导入依赖的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


示例16: setMuleFacet

import com.intellij.facet.ModifiableFacetModel; //导入依赖的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


示例17: addSupport

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
public void addSupport(@NotNull Module module, @NotNull ModifiableRootModel model, @Nullable Library library) {
  final FacetManager facetManager = FacetManager.getInstance(module);
  ModifiableFacetModel facetModel = facetManager.createModifiableModel();
  LuaFacet facet = facetManager.createFacet(LuaFacetType.getInstance(), "Lua", null);
  facet.getConfiguration().setSdk(mySdkComboBox.getSelectedSdk());
  facetModel.addFacet(facet);
  facetModel.commit();
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:9,代码来源:LuaFrameworkSupportConfigurable.java


示例18: getFacetModifiableModel

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
@Override
public ModifiableFacetModel getFacetModifiableModel(Module module) {
  final ModulesConfigurator configurator = getModulesConfigurator(module.getProject());
  if (configurator != null) {
    return configurator.getFacetsConfigurator().getOrCreateModifiableModel(module);
  }
  return FacetManager.getInstance(module).createModifiableModel();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:IdeaModifiableModelsProvider.java


示例19: commitFacetModifiableModel

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
@Override
public void commitFacetModifiableModel(Module module, ModifiableFacetModel model) {
  final ModulesConfigurator configurator = getModulesConfigurator(module.getProject());
  if (configurator == null || !(configurator.getFacetsConfigurator().getFacetModel(module) instanceof ModifiableFacetModel)) {
    model.commit();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:IdeaModifiableModelsProvider.java


示例20: getModifiableFacetModel

import com.intellij.facet.ModifiableFacetModel; //导入依赖的package包/类
@Override
@NotNull
public ModifiableFacetModel getModifiableFacetModel(Module module) {
  ModifiableFacetModel result = myModifiableFacetModels.get(module);
  if (result == null) {
    result = doGetModifiableFacetModel(module);
    myModifiableFacetModels.put(module, result);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:AbstractIdeModifiableModelsProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JavaElement类代码示例发布时间:2022-05-22
下一篇:
Java AcknowledgedResponse类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap