Bug 463677 - [Properties View] Implement a way to easily substitute widgets (and other elements)
Summary: [Properties View] Implement a way to easily substitute widgets (and other ele...
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Views (show other bugs)
Version: 1.1.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Camille Letavernier CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 463308
  Show dependency tree
 
Reported: 2015-04-01 08:46 EDT by Camille Letavernier CLA
Modified: 2017-09-08 09:43 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Camille Letavernier CLA 2015-04-01 08:46:24 EDT
Currently, when we want to contribute a specific widget to replace a default one (e.g. RichText editor vs Text Editor, XText-based editor, ...), we have to either:

- Replace the widget code directly
- Create a new widget and substitute the properties view section

These options don't scale. It should be possible to substitute widgets directly (With different scopes: for all properties, e.g. replace all BooleanRadio with a BooleanCheckbox, or for a specific property, e.g. replace TextEditor with RichTextEditor for editing Comment#body).

The substitution should work form a separate plug-in, i.e. a plug-in B should be able to contribute the Widget/Model to substitute parts of plug-in A (The goal is to be able to optionally install some advanced editor, for example as part of an extra plug-in)
Comment 1 Camille Letavernier CLA 2015-04-08 13:22:16 EDT
Substitution should be possible at least for the following elements:

- Context: Disable/Replace an entire configuration (Similar to what 'prototype' does)
- (View)
- (Section)
- Widget: Replace an editor with another one (e.g. CommentBodyEditor with EPF RichText Body Editor, MultiReference with Table, ...)
- ModelElement/Factory: Replace some parts of the logic used to manipulate the Model (Label Providers, Content Providers, Observables...) without changing/duplicating the View/Section/Layout
Comment 2 Camille Letavernier CLA 2015-04-10 08:04:59 EDT
Widget substitution might be a little bit complex to implement, since everything is translated to XWT at customization time. The only way to do the substitution at runtime would be to post-process the XML before rendering

So maybe Section-level substitution would be sufficient (View substitution is already possible via Constraints overriding, although that's not so intuitive)