Bug 526081 - Custom Widget Documentation is outdated
Summary: Custom Widget Documentation is outdated
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Documentation (show other bugs)
Version: 5.0.0   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 5.1.1   Edit
Assignee: Laurent Fasani CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 530732
  Show dependency tree
 
Reported: 2017-10-16 08:50 EDT by M V CLA
Modified: 2018-02-05 08:27 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.