|
Re: Customize ChildDescriptors for TreeEditor [message #1795261 is a reply to message #1795251] |
Wed, 19 September 2018 11:33 |
|
Hi, Bo,
The EMF code generator supports a pattern that lets you customize the output of a generated method while still letting the generator update that method as the model changes.
If you rename any generated method with a Gen suffix, then the code generator will update that instead, so you can implement the original method yourself to delegate and filter the output. For example, in your case, you can do
/** @generated */
protected void collectNewChildDescriptorsGen(Collection<Object> newChildDescriptors, Object object) {
// ... as generated by EMF ...
}
// this will not be re-generated by EMF
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
// delegate to the generated implementation
collectNewChildDescriptors(newChildDescriptors, object);
// filter the result
newChildDescriptors.removeIf(this::isUnwantedChildDescriptor);
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.03700 seconds