Class Index | File Index

Classes


Class metawidget.Pipeline

Convenience implementation for implementing pipelines (see http://metawidget.org/doc/reference/en/html/ch02.html).

Specifically, BasePipeline provides support for:


Defined in: metawidget.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
buildWidgets(inspectionResult, mw)
Build widgets from the given JSON inspection result.
 
configure(config)
Configures the pipeline using the given config object.
 
getWidgetProcessor(testInstanceOf)
Searches the pipeline's current list of WidgetProcessors and matches each against the given function
 
inspect(toInspect, type, names, mw)
Inspect the 'toInspect' according to its 'type' and 'names', and return the result as a JSON String.
 
layoutWidget(widget, elementName, attributes, container, mw)
Layout the given widget by delegating to the configured Layout.
Class Detail
metawidget.Pipeline(element)
Parameters:
element
Method Detail
buildWidgets(inspectionResult, mw)
Build widgets from the given JSON inspection result.

Note: the Pipeline expects the JSON to be passed in externally, rather than fetching it itself, because some JSON inspections may be asynchronous.

Parameters:
inspectionResult
array of metadata to base widgets on.
mw
Metawidget instance that will be passed down the pipeline (WidgetBuilders, WidgetProcessors etc). Expected to have 'toInspect', 'path' and 'readOnly'.

configure(config)
Configures the pipeline using the given config object.

This method is separate to the constructor, so that subclasses can set defaults. The following configuration properties are supported:

Parameters:
config
the config object to use. This can be an array, in which case multiple configs will be applied (in the order they appear in the array)

getWidgetProcessor(testInstanceOf)
Searches the pipeline's current list of WidgetProcessors and matches each against the given function
Parameters:
testInstanceOf
a function that accepts a WidgetProcessor and will perform an 'instanceof' test on it

inspect(toInspect, type, names, mw)
Inspect the 'toInspect' according to its 'type' and 'names', and return the result as a JSON String.

This method mirrors the Inspector interface. Internally it looks up the Inspector to use. It is a useful hook for subclasses wishing to inspect different Objects using our same Inspector.

In addition, this method runs the InspectionResultProcessors.

Parameters:
toInspect
type
names
mw

layoutWidget(widget, elementName, attributes, container, mw)
Layout the given widget by delegating to the configured Layout.

Subclasses can override this method to perform any post-processing of the widget, following layout. For pre-processing, subclasses should use a WidgetProcessor.

Parameters:
widget
elementName
attributes
container
mw

Documentation generated by JsDoc Toolkit 2.3.2 on Mon Dec 14 2015 20:12:11 GMT-0500 (EST)