com.atlassian.plugin.web.descriptors
Class DefaultWebItemModuleDescriptor

java.lang.Object
  extended by com.atlassian.plugin.descriptors.AbstractModuleDescriptor<Void>
      extended by com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor
          extended by com.atlassian.plugin.web.descriptors.DefaultWebItemModuleDescriptor
All Implemented Interfaces:
ModuleDescriptor<Void>, Resourced, StateAware, ConditionalDescriptor, ContextAware, WebFragmentModuleDescriptor, WebItemModuleDescriptor, WeightedDescriptor

public class DefaultWebItemModuleDescriptor
extends AbstractWebFragmentModuleDescriptor
implements WebItemModuleDescriptor

Represents a pluggable link.


Field Summary
 
Fields inherited from class com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor
condition, contextProvider, element, label, params, tooltip, webInterfaceManager, weight
 
Fields inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
moduleClassName, moduleFactory, plugin, resources, singleton
 
Fields inherited from interface com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor
COMPOSITE_TYPE_AND, COMPOSITE_TYPE_OR
 
Constructor Summary
DefaultWebItemModuleDescriptor()
           
DefaultWebItemModuleDescriptor(WebInterfaceManager webInterfaceManager)
           
 
Method Summary
 void enabled()
          Enables the descriptor by loading the module class.
 WebIcon getIcon()
           
 WebLink getLink()
           
 Void getModule()
          The particular module object created by this plugin.
 String getSection()
           
 String getStyleClass()
          Returns the item style as a "class" String consisting of one or more style classes.
 void init(Plugin plugin, org.dom4j.Element element)
          Initialise a module given it's parent plugin and the XML element representing the module.
 
Methods inherited from class com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor
disabled, getCondition, getContextProvider, getTooltip, getWebLabel, getWebParams, getWeight, makeCondition, makeConditions, makeConditions, makeContextProvider, setWebInterfaceManager
 
Methods inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
assertModuleClassImplements, destroy, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, provideValidationRules, satisfiesMinJavaVersion, setPlugin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor
getCondition, getTooltip, getWebLabel, getWebParams, getWeight
 
Methods inherited from interface com.atlassian.plugin.ModuleDescriptor
destroy, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, isEnabledByDefault, isSystemModule, satisfiesMinJavaVersion
 
Methods inherited from interface com.atlassian.plugin.Resourced
getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation
 
Methods inherited from interface com.atlassian.plugin.StateAware
disabled
 
Methods inherited from interface com.atlassian.plugin.web.descriptors.ContextAware
getContextProvider
 

Constructor Detail

DefaultWebItemModuleDescriptor

public DefaultWebItemModuleDescriptor(WebInterfaceManager webInterfaceManager)

DefaultWebItemModuleDescriptor

public DefaultWebItemModuleDescriptor()
Method Detail

init

public void init(Plugin plugin,
                 org.dom4j.Element element)
          throws PluginParseException
Description copied from interface: ModuleDescriptor
Initialise a module given it's parent plugin and the XML element representing the module.

Since atlassian-plugins v2.2, you can no longer load classes from the plugin in this method, because the OSGi bundle that they will live in is not built yet. Load classes in the AbstractModuleDescriptor.enabled() method instead.

Specified by:
init in interface ModuleDescriptor<Void>
Overrides:
init in class AbstractWebFragmentModuleDescriptor
Parameters:
plugin - The plugin that the module belongs to. Must not be null.
element - XML element representing the module. Must not be null.
Throws:
PluginParseException - Can be thrown if an error occurs while parsing the XML element.

getSection

public String getSection()
Specified by:
getSection in interface WebItemModuleDescriptor

getLink

public WebLink getLink()
Specified by:
getLink in interface WebItemModuleDescriptor

getIcon

public WebIcon getIcon()
Specified by:
getIcon in interface WebItemModuleDescriptor

getStyleClass

public String getStyleClass()
Description copied from interface: WebItemModuleDescriptor
Returns the item style as a "class" String consisting of one or more style classes. The default value returned should be an empty String rather than null.

Where possible, use of this method is preferred over getIcon as it allows more flexibility for CSS-based web element styling and class-based JavaScript behaviour.

Specified by:
getStyleClass in interface WebItemModuleDescriptor
Returns:
space-separated list of style classes

enabled

public void enabled()
Description copied from class: AbstractModuleDescriptor
Enables the descriptor by loading the module class. Classes overriding this method MUST call super.enabled() before their own enabling code.

Specified by:
enabled in interface StateAware
Overrides:
enabled in class AbstractWebFragmentModuleDescriptor

getModule

public Void getModule()
Description copied from interface: ModuleDescriptor
The particular module object created by this plugin.

Specified by:
getModule in interface ModuleDescriptor<Void>
Specified by:
getModule in class AbstractModuleDescriptor<Void>
Returns:
The module object created by this plugin.
See Also:
ModuleDescriptor.getModuleClass()


Copyright © 2011 Atlassian. All Rights Reserved.