Jonas Helming is co-lead for the EclipseSource team and the project lead of the Eclipse EMF Client Platform and the EMFStore project. He works as an Eclipse Consultant …
EMF Client Platform: Make It Happen! Day 3
June 27, 2013 | 2 min ReadThis part of the series describes how to add custom validation constraints to the UI of the EMF Client platform.
“Make It Happen” is an example application we are using to present the features of the EMF Client Platform. On day 0, we created a simple model containing Tasks and Users. With this model, the EMF Client Platform has already provided a fully functioning application including a model explorer, an editor and the ability to share and version model entities (day 1). On day 2, we adapted the look of the elements, added custom icons and adapted the label.
Every day, we will add a new customization to the example application. On day 3, we want to add a validation constraint to our EMF model, which checks whether the user input is correct.
Day 3: Add Custom Validation Constraints
The UI of the EMF Client Platform, i.e., the model explorer, and the editor are capable of validating EMF model constraints and displaying the result to the user. Some model constraints can already be displayed within the model itself and will be validated without any further adaptation. In the “Make It Happen” model, the attribute “eMails” of the element User specifies a lower bound of “1”, expressing that every user has to have at least one email address. This is already validated by the EMF Client Platform:
However, there are some constraints that cannot be specified directly in the model itself. This tutorial shows you how to implement custom validation rules that are validated by the EMF Client Platform.
Please use the links below to see all posts in this series: