本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
示例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);
}
示例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);
示例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);
示例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);