com.atlassian.confluence.plugin.descriptor
Class XhtmlMacroModuleDescriptor

java.lang.Object
  extended by com.atlassian.plugin.descriptors.AbstractModuleDescriptor<Macro>
      extended by com.atlassian.confluence.plugin.descriptor.XhtmlMacroModuleDescriptor
All Implemented Interfaces:
MacroMetadataSource, com.atlassian.plugin.ModuleDescriptor<Macro>, com.atlassian.plugin.Resourced, com.atlassian.plugin.StateAware

public class XhtmlMacroModuleDescriptor
extends com.atlassian.plugin.descriptors.AbstractModuleDescriptor<Macro>
implements MacroMetadataSource

Since:
4.0

Field Summary
protected  java.util.Set<java.lang.String> supportedDeviceTypes
           
 
Fields inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
key, moduleClass, moduleClassName, moduleFactory, name, plugin, resources, singleton
 
Constructor Summary
XhtmlMacroModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory, MacroMetadataParser metadataParser)
           
 
Method Summary
 void disabled()
           
 void enabled()
           
 com.atlassian.plugin.elements.ResourceDescriptor getHelpDescriptor()
          Returns the macro help descriptor, or null if there is no help.
 java.lang.String getHelpSection()
          Returns the section of notation guide in which the macro help appears.
 MacroMetadata getMacroMetadata()
           
 Macro getModule()
           
 boolean hasHelp()
          Returns true if the macro has help, otherwise false.
 void init(com.atlassian.plugin.Plugin plugin, org.dom4j.Element element)
           
 boolean isAlwaysShowConfig()
           
 boolean isOutputDeviceTypeSupported(java.lang.String deviceType)
          Check if the specified device type is supported.
 
Methods inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
assertModuleClassImplements, checkPermissions, destroy, destroy, equals, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getModuleClassName, getName, getParams, getPlugin, getPluginKey, getRequiredPermissions, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, hashCode, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, provideValidationRules, satisfiesMinJavaVersion, setPlugin, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

supportedDeviceTypes

protected java.util.Set<java.lang.String> supportedDeviceTypes
Constructor Detail

XhtmlMacroModuleDescriptor

public XhtmlMacroModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory,
                                  MacroMetadataParser metadataParser)
Method Detail

enabled

public void enabled()
Specified by:
enabled in interface com.atlassian.plugin.StateAware
Overrides:
enabled in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<Macro>

disabled

public void disabled()
Specified by:
disabled in interface com.atlassian.plugin.StateAware
Overrides:
disabled in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<Macro>

init

public void init(@NotNull
                 com.atlassian.plugin.Plugin plugin,
                 @NotNull
                 org.dom4j.Element element)
          throws com.atlassian.plugin.PluginParseException
Specified by:
init in interface com.atlassian.plugin.ModuleDescriptor<Macro>
Overrides:
init in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<Macro>
Throws:
com.atlassian.plugin.PluginParseException

getModule

public Macro getModule()
Specified by:
getModule in interface com.atlassian.plugin.ModuleDescriptor<Macro>
Specified by:
getModule in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<Macro>

getMacroMetadata

public MacroMetadata getMacroMetadata()
Specified by:
getMacroMetadata in interface MacroMetadataSource

isAlwaysShowConfig

public boolean isAlwaysShowConfig()

isOutputDeviceTypeSupported

public boolean isOutputDeviceTypeSupported(java.lang.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 java.lang.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:
java.lang.IllegalStateException - if this is called when #hasHelp() is false

getHelpDescriptor

public com.atlassian.plugin.elements.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.



Copyright © 2003-2014 Atlassian. All Rights Reserved.