com.atlassian.confluence.plugin.descriptor
Class XhtmlMacroModuleDescriptor
java.lang.Object
com.atlassian.plugin.descriptors.AbstractModuleDescriptor<Macro>
com.atlassian.confluence.plugin.descriptor.XhtmlMacroModuleDescriptor
- All Implemented Interfaces:
- MacroMetadataSource, ModuleDescriptor<Macro>, Resourced, StateAware
public class XhtmlMacroModuleDescriptor
- extends AbstractModuleDescriptor<Macro>
- implements MacroMetadataSource
- Since:
- 4.0
Methods inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor |
assertModuleClassImplements, destroy, equals, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, hashCode, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, provideValidationRules, satisfiesMinJavaVersion, setPlugin, toString |
supportedDeviceTypes
protected Set<String> supportedDeviceTypes
XhtmlMacroModuleDescriptor
public XhtmlMacroModuleDescriptor(ModuleFactory moduleFactory,
MacroMetadataParser metadataParser)
enabled
public void enabled()
- Specified by:
enabled
in interface StateAware
- Overrides:
enabled
in class AbstractModuleDescriptor<Macro>
disabled
public void disabled()
- Specified by:
disabled
in interface StateAware
- Overrides:
disabled
in class AbstractModuleDescriptor<Macro>
init
public void init(@NotNull
Plugin plugin,
@NotNull
Element element)
throws PluginParseException
- Specified by:
init
in interface ModuleDescriptor<Macro>
- Overrides:
init
in class AbstractModuleDescriptor<Macro>
- Throws:
PluginParseException
getModule
public Macro getModule()
- Specified by:
getModule
in interface ModuleDescriptor<Macro>
- Specified by:
getModule
in class AbstractModuleDescriptor<Macro>
getMacroMetadata
public MacroMetadata getMacroMetadata()
- Specified by:
getMacroMetadata
in interface MacroMetadataSource
isOutputDeviceTypeSupported
public boolean isOutputDeviceTypeSupported(String deviceType)
- Check if the specified device type is supported. You should note that all
macros support the
ConversionContextOutputDeviceType.DESKTOP
type.
- Parameters:
deviceType
- the device type to check.
- Returns:
- true if the macro represented applies to the specified device type.
hasHelp
public boolean hasHelp()
- Returns true if the macro has help, otherwise false. Help can be provided
by defining a resource inside the macro descriptor in the plugin XML descriptor file. The
help resource has a type of "velocity" and a name of "help". It can have either a body or a
"location" attribute with a reference to a Velocity file within the plugin.
getHelpSection
public String getHelpSection()
- Returns the section of notation guide in which the macro help appears. Should be
one of the values defined in NotationHelpAction#SECTION_KEYS.
- Throws:
IllegalStateException
- if this is called when #hasHelp() is false
getHelpDescriptor
public ResourceDescriptor getHelpDescriptor()
- Returns the macro help descriptor, or null if there is no help.
The help is defined as a resource with type "velocity" and name "help" inside
the macro descriptor. The resource tag can have a location attribute, referring
to a file within the plugin, or a body.