Assuming you want to replicate the HasEditorErrors behavior (otherwise, I 
don't see the point in having the decorator an Editor by itself), it'll 
depends whether you want to decorate a LeafValueEditor or an Editor with 
sub-editors, and/or an IsEditor.
We learned it the hard way this week, so better share our findings than let 
you drive nuts with something that works in some cases and not in others.

For a LeafValueEditor, make your decorator an IsEditor and HasEditorErrors, 
with the asEditor() method returning your wrapped LeafValueEditor. For an 
IsEditor<LeafValueEditor<?>>, you'd have to "unwrap" it (call 
asEditor) yourself (like ValueBoxEditorDecorator does), which presumes the 
editor isn't itself both an IsEditor and an Editor (HasEditorDelegate, 
HasEditorErrors, etc.). Being both IsEditor and Editor is IMO a bad 
practice, but sometimes you don't have the choice.

For a complex Editor (with sub-editors), do not implement IsEditor, but 
instead use a @Path("") sub-editor (typed either as your Editor type or 
IsEditor depending on what you need).

For the rest, you can basically copy from ValueBoxEditorDecorator.

HTH, ask if you need more info.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to