Alias Molecule

From oWiki

Jump to: navigation, search

Contents


Preference Dialog

File:Alias_pref.png

Attributes

type

string  ( r )
Type of this molecule, 'alias'.

pref.name

string  ( r )
The scriptable name for this molecule. This name can be set using rename method dynamically.

alias

string  ( r, w )
Get/Set the aliasing path.


Methods

rename(n)

n: string

Rename this molecule.

clone()

Return: a molecule

Create a clone of this molecule.

attach(droplet)

droplet: a droplet object (e.g. app.box.droplet)

Attach this molecule to a droplet.

detach()

Remove this molecule from its droplet.

deleteMod()

Delete this molecule.

serialize()

Return: string

Serialize this molecule into its JSON representation.

apply( params )

params: object

Execute the script associated with this alias.

Comments

Aliasing makes certain jobs much easier. For example, when you create a group of droplets that have the same behavior but different looks and feel, you can place a script molecule on one droplet and the rest with alias molecules pointing to the script molecule. When you update the script molecule, all the alias molecules are automatically updated as well.

Another useful scenario is to use aliasing to acquire different behavior for a droplet by pointing the alias molecule to different external script molecules during runtime.

Personal tools