Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

JS4EMF

Javascript for EMF

Javascript for EMF provides support for using Mozilla'a Javascript implementation (Rhino) for scripting EMF and using EMF objects in Javascript code. Besides Javascript's existing support for using EMF objects as native Java objects, there is EMF-specific support for

  • using Ecore attributes (EAttribute) and references (EReference) as Javascript properties, with the . and [] notations,
  • implementing Ecore operations (EOperation) with Javascript code
  • adding Javascript functions as methods to Ecore classes (EClass) and individual objects (EObject)
  • listening to change notifications and calling event-handling methods
  • databinding, by means of dependency recording

JS4EMF also supports using Javascript for implementing invariants, constraints, derived features and operation bodies, using the EMF delegates mechanism. To make using these features easier JS4EMF contributes several views.

JS4EMF wiki content

The JS4EMF wiki includes the following contents:

  • The User Guide describes how the various views are used.
  • The Developer Guide explains how EMF objects are mapped to the Javascript object model and how to use Javascript for EMF scripting.
  • The EMF Delegates explains how to use Javascript for in invariants, constraints, derived features and operation bodies, based on the EMF delegates mechanism.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.