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


Java FacetConfiguration类代码示例

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


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

示例1: configure

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

示例2: findLuaSdk

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
public static Sdk findLuaSdk(Module module) {
    if (module == null) return null;
    final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
    if (sdk != null && sdk.getSdkType() instanceof LuaSdkType) return sdk;
    final Facet[] facets = FacetManager.getInstance(module).getAllFacets();
    for (Facet facet : facets) {
        final FacetConfiguration configuration = facet.getConfiguration();
        if (configuration instanceof LuaFacetConfiguration) {
            return ((LuaFacetConfiguration)configuration).getSdk();
        }
    }
    return null;
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:14,代码来源:LuaSdkType.java

示例3: FacetEditorImpl

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
public FacetEditorImpl(final FacetEditorContext context, final FacetConfiguration configuration) {
  myContext = context;
  myErrorPanel = new FacetErrorPanel();
  myEditorTabs = configuration.createEditorTabs(context, myErrorPanel.getValidatorsManager());
  for (Configurable configurable : myEditorTabs) {
    add(configurable);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FacetEditorImpl.java

示例4: FacetTypeEditor

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
public <C extends FacetConfiguration> FacetTypeEditor(@NotNull Project project, final StructureConfigurableContext context, @NotNull FacetType<?, C> facetType) {
  myProject = project;
  myContext = context;
  myFacetType = facetType;

  if (!(facetType instanceof InvalidFacetType)) {
    C configuration = ProjectFacetManager.getInstance(project).createDefaultConfiguration(facetType);
    DefaultFacetSettingsEditor defaultSettingsEditor = facetType.createDefaultConfigurationEditor(project, configuration);
    if (defaultSettingsEditor != null) {
      myDefaultSettingsConfigurable = new DefaultFacetSettingsConfigurable<C>(facetType, project, defaultSettingsEditor, configuration);
      add(myDefaultSettingsConfigurable);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:FacetTypeEditor.java

示例5: createDetectedFacetDescriptions

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
@NotNull
@Override
public <F extends Facet, C extends FacetConfiguration> List<? extends DetectedFrameworkDescription> createDetectedFacetDescriptions(@NotNull FacetBasedFrameworkDetector<F, C> detector,
                                                                                                                                    @NotNull Collection<VirtualFile> files) {
  final List<ModuleDescriptor> descriptors = getModuleDescriptors();
  MultiMap<ModuleDescriptor, VirtualFile> filesByModule = new MultiMap<ModuleDescriptor, VirtualFile>();
  for (VirtualFile file : files) {
    final File ioFile = VfsUtil.virtualToIoFile(file);
    ModuleDescriptor descriptor = findDescriptorByFile(descriptors, ioFile);
    if (descriptor != null) {
      filesByModule.putValue(descriptor, file);
    }
  }

  final List<DetectedFrameworkDescription> result = new ArrayList<DetectedFrameworkDescription>();
  final FacetType<F,C> facetType = detector.getFacetType();
  for (ModuleDescriptor module : filesByModule.keySet()) {
    if (!facetType.isSuitableModuleType(module.getModuleType())) {
      continue;
    }

    final List<Pair<C, Collection<VirtualFile>>> pairs =
      detector.createConfigurations(filesByModule.get(module), Collections.<C>emptyList());
    for (Pair<C, Collection<VirtualFile>> pair : pairs) {
      result.add(new FacetBasedDetectedFrameworkDescriptionInWizard<F, C>(module, detector, pair.getFirst(),
                                                                          new HashSet<VirtualFile>(pair.getSecond())));
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:FrameworkDetectionInWizardContext.java

示例6: findPythonSdk

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
@Nullable
public static Sdk findPythonSdk(@Nullable Module module) {
  if (module == null) return null;
  final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
  if (sdk != null && sdk.getSdkType() instanceof PythonSdkType) return sdk;
  final Facet[] facets = FacetManager.getInstance(module).getAllFacets();
  for (Facet facet : facets) {
    final FacetConfiguration configuration = facet.getConfiguration();
    if (configuration instanceof PythonFacetSettings) {
      return ((PythonFacetSettings)configuration).getSdk();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PythonSdkType.java

示例7: createDetectedFacetDescriptions

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
@NotNull
<F extends Facet, C extends FacetConfiguration>
List<? extends DetectedFrameworkDescription> createDetectedFacetDescriptions(@NotNull FacetBasedFrameworkDetector<F, C> detector,
                                                                             @NotNull Collection<VirtualFile> files);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FrameworkDetectionContext.java

示例8: MetaborgFacet

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
/**
 * Initializes a new instance of the {@link MetaborgFacet} class.
 *
 * @param facetType The facet type.
 * @param module The module to which the facet is applied.
 * @param name The name of the facet.
 * @param configuration The configuration of the facet.
 * @param underlyingFacet The underlying facet.
 */
public MetaborgFacet(final MetaborgFacetType facetType,
                     final Module module,
                     final String name,
                     final FacetConfiguration configuration,
                     @Nullable final Facet underlyingFacet) {
    super(facetType, module, name, configuration, underlyingFacet);
    SpoofaxIdeaPlugin.injector().injectMembers(this);
}
 
开发者ID:metaborg,项目名称:spoofax-intellij,代码行数:18,代码来源:MetaborgFacet.java

示例9: registerOnTheFlySubFacetDetector

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
/**
 * Register detector which will be used to detect subfacets on the fly
 * @param fileType type of facet descriptor files
 * @param virtualFilePattern preliminary filter for facet descriptor file
 * @param psiFilePattern filter for facet descriptors
 * @param facetDetector detector
 * @param selector {@link UnderlyingFacetSelector} instance which will be used to select a parent facet for a detected facet
 *
 * @deprecated do not use facet detectors based on PsiFile, because it may slow down facet detection process.
 * Use {@link #registerUniversalSubFacetDetector} instead
 */
<U extends FacetConfiguration>
void registerOnTheFlySubFacetDetector(@NotNull FileType fileType, @NotNull VirtualFilePattern virtualFilePattern,
                                      @NotNull ElementPattern<? extends PsiFile> psiFilePattern, @NotNull FacetDetector<PsiFile, C> facetDetector,
                                      UnderlyingFacetSelector<VirtualFile, U> selector);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:FacetDetectorRegistry.java

示例10: registerSubFacetDetectorForWizard

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
/**
 * Register detector which will be used in the module wizard when a module is created from sources
 * @param fileType type of facet descriptor files
 * @param virtualFilePattern filter for facet descriptors
 * @param facetDetector detector
 * @param underlyingFacetSelector {@link UnderlyingFacetSelector} instance which will be used to select a parent facet for a detected facet
 */
<U extends FacetConfiguration>
void registerSubFacetDetectorForWizard(@NotNull FileType fileType, @NotNull VirtualFilePattern virtualFilePattern,
                                       @NotNull FacetDetector<VirtualFile, C> facetDetector,
                                       @NotNull UnderlyingFacetSelector<VirtualFile, U> underlyingFacetSelector);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FacetDetectorRegistry.java

示例11: registerUniversalSubFacetDetector

import com.intellij.facet.FacetConfiguration; //导入依赖的package包/类
/**
 * Register detector to be used for both on-the-fly auto-detection and auto-detection in the module wizard
 * @param fileType type of facet descriptor files
 * @param virtualFilePattern filter for facet descriptors
 * @param facetDetector detector
 * @param underlyingFacetSelector {@link UnderlyingFacetSelector} instance which will be used to select a parent facet for a detected facet
 */
<U extends FacetConfiguration> void registerUniversalSubFacetDetector(@NotNull FileType fileType,
                                                                      @NotNull VirtualFilePattern virtualFilePattern,
                                                                      @NotNull FacetDetector<VirtualFile, C> facetDetector,
                                                                      UnderlyingFacetSelector<VirtualFile, U> underlyingFacetSelector);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FacetDetectorRegistry.java


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