Skip to content

Add support for custom widgets for the form representation #1914

@sbegaudeau

Description

@sbegaudeau

The Form representation currently supports a fixed set of generic widgets.
Even if we enrich this set, it will never account for all the specific needs of concrete applications.
The Sirius Components framework should be open for custom applications to provide their own widgets.

If an application provides such a custom widget, its use both by the studio maker and by the end users should be indisguishable from the core widgets.

Core support

Make the core Form representation extensible with new widgets, independently of the View DSL.

  • Shape written, reviewed and merged
  • ADR written (will be reviewed and merged in the main PR along with the code)
  • Make the Form representation core extensible (backend)
  • Backend code for a basic Slider widget
  • Make FormEventFragments.ts extensible
  • Make PropertySection.tsx extensible
  • Fontend code for a basic Slider widget

Support in the View DSL

Make the View DSL itself and the conversion process (View -> core) extensible to new widgets.

  • Enable support for child creation extenders in the View DSL (Enable child creation extenders in the View DSL #1946)
  • Create slider.ecore which extends view.ecore with the Slider widget definition
  • Make ViewFormDescriptionConverter extensible to support new widgets
  • Implement the conversion logic between the view-based SliderDescription and the API-based one.
  • Create an example View definition which uses the new Slider widget and add tests for it

Support in the Form Description Editor

Allow the Form Description Editor to display and edit custom widgets as if they were "normal" widgets.

  • Make the backend extensible (FormDescriptionEditorGroupComponent)
  • Make the frontend extensible (WidgetOperations, FormDescriptionEditorRepresentation.*)
  • Test using the Slider widget

Finalization

Transverse tasks.

  • Document the steps needed to create a custom widget
  • Integrated tests updated

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions