public abstract class FacetType<F extends Facet,C extends FacetConfiguration> extends java.lang.Object implements PluginAware
plugin.xml
:
<extensions defaultExtensionNs="com.intellij"> <facetType implementation="qualified-class-name"/> </extensions>
Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<FacetType> |
EP_NAME |
Constructor and Description |
---|
FacetType(FacetTypeId<F> id,
java.lang.String stringId,
java.lang.String presentableName) |
FacetType(FacetTypeId<F> id,
java.lang.String stringId,
java.lang.String presentableName,
FacetTypeId underlyingFacetType) |
Modifier and Type | Method and Description |
---|---|
abstract C |
createDefaultConfiguration()
Create default configuration of facet.
|
DefaultFacetSettingsEditor |
createDefaultConfigurationEditor(Project project,
C configuration) |
abstract F |
createFacet(Module module,
java.lang.String name,
C configuration,
Facet underlyingFacet)
Create a new facet instance.
|
MultipleFacetSettingsEditor |
createMultipleConfigurationsEditor(Project project,
FacetEditor [] editors)
Override to allow editing several facets at once.
|
static <T extends FacetType> |
findInstance(java.lang.Class<T> aClass) |
java.lang.String |
getDefaultFacetName()
Default name which will be used then user creates a facet of this type.
|
java.lang.String |
getHelpTopic()
Returns the topic in the help file which is shown when help for this facet type is requested.
|
javax.swing.Icon |
getIcon() |
FacetTypeId<F> |
getId() |
PluginDescriptor |
getPluginDescriptor() |
java.lang.String |
getPresentableName() |
java.lang.String |
getStringId() |
FacetTypeId<?> |
getUnderlyingFacetType() |
boolean |
isOnlyOneFacetAllowed() |
abstract boolean |
isSuitableModuleType(ModuleType moduleType) |
void |
registerDetectors(FacetDetectorRegistry<C> registry)
Deprecated.
this method is not called by IDE core anymore. Use
FrameworkDetector extension
to provide automatic detection for facets |
void |
setPluginDescriptor(PluginDescriptor pluginDescriptor)
Called by extensions framework when extension is loaded from plugin.xml descriptor.
|
public static final ExtensionPointName<FacetType> EP_NAME
public FacetType(FacetTypeId<F> id, java.lang.String stringId, java.lang.String presentableName, FacetTypeId underlyingFacetType)
id
- unique instance of FacetTypeId
stringId
- unique string id of the facet typepresentableName
- name of this facet type which will be shown in UIunderlyingFacetType
- if this parameter is not null
then you will be able to add facets of this type only as
subfacets to a facet of the specified type. If this parameter is null
it will be possible to add facet of this type
directly to a modulepublic FacetType(FacetTypeId<F> id, java.lang.String stringId, java.lang.String presentableName)
id
- unique instance of FacetTypeId
stringId
- unique string id of the facet typepresentableName
- name of this facet type which will be shown in UIpublic static <T extends FacetType> T findInstance(java.lang.Class<T> aClass)
public final FacetTypeId<F> getId()
public final java.lang.String getStringId()
public java.lang.String getPresentableName()
public java.lang.String getDefaultFacetName()
public FacetTypeId<?> getUnderlyingFacetType()
public void setPluginDescriptor(PluginDescriptor pluginDescriptor)
PluginAware
If this method is implemented in a bean class
extension point and it also exposes the stored plugin description via getPluginDescriptor
method, you must annotate the latter
with @Transient
to ensure that serialization engine won't try to deserialize this property.
setPluginDescriptor
in interface PluginAware
pluginDescriptor
- descriptor of the plugin that provided this particular extension.public final PluginDescriptor getPluginDescriptor()
@Deprecated public void registerDetectors(FacetDetectorRegistry<C> registry)
FrameworkDetector
extension
to provide automatic detection for facetspublic abstract C createDefaultConfiguration()
FacetConfiguration
for details.public abstract F createFacet(Module module, java.lang.String name, C configuration, Facet underlyingFacet)
module
- parent module for facet. Must be passed to Facet
constructorname
- name of facet. Must be passed to Facet
constructorconfiguration
- facet configuration. Must be passed to Facet
constructorunderlyingFacet
- underlying facet. Must be passed to Facet
constructorpublic boolean isOnlyOneFacetAllowed()
true
if only one facet of this type is allowed within the containing module (if this type doesn't have the underlying
facet type) or within the underlying facetpublic abstract boolean isSuitableModuleType(ModuleType moduleType)
moduleType
- type of moduletrue
if facet of this type are allowed in module of type moduleType
public javax.swing.Icon getIcon()
public java.lang.String getHelpTopic()
public DefaultFacetSettingsEditor createDefaultConfigurationEditor(Project project, C configuration)
public MultipleFacetSettingsEditor createMultipleConfigurationsEditor(Project project, FacetEditor [] editors)
project
- projecteditors
- editors of selected facets