| Package | de.mightypirates.megazine.interfaces |
| Interface | public interface IPluginManager |
| Implementors | PluginManager |
PluginManager class. Should be used in plugin
implementations to reduce size of the generated swf.
| Method | Defined by | ||
|---|---|---|---|
|
Returns the plugin with the given name.
| IPluginManager | ||
|
getPlugins():Vector
Returns a list of all loaded plugins.
| IPluginManager | ||
|
handleAttributes(element:*, type:Class, xml:XML):void
Handle attribute initialization of elements by plugins.
| IPluginManager | ||
|
isPluginLoaded(plugin:String):Boolean
Tells whether a plugin of the given is is registered (true) or not
(false).
| IPluginManager | ||
|
registerAttributeHandler(type:Class, attribute:String, plugin:IPlugin, priority:uint = 10):void
This function allows plugins to register themselves as attribute
handlers.
| IPluginManager | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when all plugins and possible dependant plugins are done loading. | IPluginManager | |||
| getPlugin | () | method |
public function getPlugin(plugin:String):IPlugin
Returns the plugin with the given name. Returns null if the
plugin is not loaded.
plugin:String — the name of the plugin to which to get a reference to.
|
IPlugin —
a reference to the plugin or null.
|
| getPlugins | () | method |
public function getPlugins():VectorReturns a list of all loaded plugins.
Returned are the references to the actual plugins, i.e. access the
elements using the IPlugin interface. E.g.
for each (var plugin:IPlugin in pluginManager.getPlugins());Returns
Vector |
| handleAttributes | () | method |
public function handleAttributes(element:*, type:Class, xml:XML):voidHandle attribute initialization of elements by plugins. This first checks what kind of element was given. If an illegal element was given (not one of HalfPage, Chapter or AbstractElement) and error is thrown. Else walks through all attributes in the given XML node, checking for plugins registered as handlers for the current attribute, and if some are found calls their handler function.
Parameterselement:* — the element to handle.
|
|
type:Class — the type for as which to handle the given element. This is
necessary, because plugins are mapped using interfaces of
the types they handle, so the actual type of the element
cannot be used directly.
|
|
xml:XML — the xml data for that element.
|
| isPluginLoaded | () | method |
public function isPluginLoaded(plugin:String):BooleanTells whether a plugin of the given is is registered (true) or not (false).
Parametersplugin:String — the plugin to check for.
|
Boolean — true if the plugin is loaded, else false.
|
| registerAttributeHandler | () | method |
public function registerAttributeHandler(type:Class, attribute:String, plugin:IPlugin, priority:uint = 10):voidThis function allows plugins to register themselves as attribute handlers.
This means that the plugin's handleAttribute function will be called whenever an element matching the element name given finishes loading and is getting initialized.
Parameterstype:Class — the type of the element for which to register.
|
|
attribute:String — the attribute name for which to register as a handler.
|
|
plugin:IPlugin — the plugin registering itself as a handler.
|
|
priority:uint (default = 10) — can be used to set a priority for this handler. The handlers
with a lower number will be treated first. The order of
handlers of the same priority cannot be guaranteed, however.
|
| complete | event |
flash.events.Event.COMPLETE
Dispatched when all plugins and possible dependant plugins are done loading.