PERGOLA LOGO

Classes

The classes listed below are subclasses of pergola.Class. They include widgets and system components. Where specified, a class is further subclassed to some other class.

Prototype inheritance is true JavaScript prototype inheritance model, with no referencing or duplication(simple or recursive) or other alien technique.

All constructors have a prototype method named build (except for pergola.Undo and pergola.Key, whose initializer methods are named register, and pergola.Timer, where it is named initialize), allowing both method chaining and deferred construction. The latter allows predefining objects and their component objects, keeping a clean structure that gives at a glance control, and allows dynamic or conditional construction, together with the capability of self-referencing and of accessing the inherited properties and methods. Instantiation is therefore dissociated from physical construction. The build() method expects an object literal, referred to throughout the API reference as initialization object, where you can specify instance properties and methods, and prototype properties and methods to override.

A special instance property, owner, was introduced by Pergola to designate the owner object (typically, but not necessarily, the object requesting the instance) of a component object, enabling the latter to keep a reference to its hierarchical superior, skipping the labor of object scanning methods. Where the owner property is required, it is specified in the class's reference page, and if it is omitted in the initialization object the build method returns an alert; construction is aborted, but the instance is not destroyed.

The initial values of some prototype properties for each class are set in the pergola.presentationAttributes object, defined by the current skin function (located in the skin.js file). The classes fetch the initial values there.

For in-depth information in friendly language and code examples read the Classes section in the tutorial.

In the header section of each of the classes' pages, the mention “System events” specifies whether the class's instances can interact with –or their behavior can be affected by– the system, or system components (whether actively through the class's handleEvent() prototype method, or passively), and the mention “User events and functions” specifies if the class implements the User events and functions mechanism, which allows to specify one or more event types and/or callback function.

For classes that define it, the handleEvent() method is listed under the "Prototype" header, but not detailed. Where applicable it carries out system checks, and may activate or deactivate services, and in all cases it handles one or more event types registered on one or more elements, and invokes the relative callback functions. It also handles user events and functions where applies.