Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 526081

Summary: Custom Widget Documentation is outdated
Product: [Modeling] Sirius Reporter: M V <mv>
Component: DocumentationAssignee: Laurent Fasani <laurent.fasani>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: laurent.fasani, maxime.porhel, pierre-charles.david, pierre.guilet
Version: 5.0.0Keywords: triaged
Target Milestone: 5.1.1   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/111805
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=c23c07f3bfd324828dc9e8426f63319461b7780d
https://git.eclipse.org/r/115291
https://git.eclipse.org/r/115849
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=5a5a7c4e5e9b2cb7282397c199c84036e474ad3a
Whiteboard:
Bug Depends on:    
Bug Blocks: 530732    

Description M V CLA 2017-10-16 08:50:22 EDT
The Code examples are outdated

https://www.eclipse.org/sirius/doc/developer/extensions-properties_provide_custom_widget_basic.html

e.g

[outdate]
public class TableLifecycleManager extends AbstractEEFWidgetLifecycleManager {
...

	private IConsumer<Object> newValueConsumer;
...
}

Correct
public class TableLifecycleManager extends AbstractEEFWidgetLifecycleManager {
...

	private Consumer<Object> newValueConsumer;
...
}
Comment 1 Maxime Porhel CLA 2017-10-17 10:34:51 EDT
Hi M V, 

Thank for the bug report, the doc should be corrected in 5.1.1. 

Regards
Comment 2 Eclipse Genie CLA 2017-11-17 10:16:33 EST
New Gerrit change created: https://git.eclipse.org/r/111805
Comment 4 Pierre-Charles David CLA 2017-12-20 03:13:12 EST
Fixed by c23c07f3bfd324828dc9e8426f63319461b7780d.

To validate:
* create a plug-in project with the proper dependencies (Sirius and EEF);
* create a class with the source code in the document (TableLifecycleManager extends AbstractEEFWidgetLifecycleManager);
* verify that it compiles without errors (ideally without warnings either).
Comment 5 Laurent Fasani CLA 2018-01-09 04:46:55 EST
being validated...
Comment 6 Laurent Fasani CLA 2018-01-09 05:53:35 EST
There are still compilation error

In TableLifecycleManager
* A contextAdapter field is needed. Its initialization should be done in constructor.
* Add setEnabled(boolean) unimplemented method


In TableController 
* java.util.function.Consumer should be used instead of IConsumer
* A contextAdapter field is needed. Its initialization should be done in constructor.
* adapt code because this.getCustomExpression return an Optional<String> and a String is needed
Comment 7 Laurent Fasani CLA 2018-01-09 06:11:37 EST
By the way there is probably the same kind of change in "Sirius Properties – Advanced Custom Widget"
Comment 8 Eclipse Genie CLA 2018-01-12 06:16:54 EST
New Gerrit change created: https://git.eclipse.org/r/115291
Comment 9 Eclipse Genie CLA 2018-01-23 04:54:00 EST
New Gerrit change created: https://git.eclipse.org/r/115849
Comment 11 Pierre-Charles David CLA 2018-01-26 04:17:33 EST
Fixed by 5a5a7c4e5e9b2cb7282397c199c84036e474ad3a.
Comment 12 Pierre-Charles David CLA 2018-02-01 03:25:43 EST
Available in Sirius 5.1.1. See https://wiki.eclipse.org/Sirius/5.1.1 for details.