9.8. Alternate way to construct an editor

In situations where you have a view that you don’t want to be an editor, but you want this class to be part of an editor structure, you can use the IsEditor type. This is useful, for example, if you want to build a composition of central source code logic that’s going to appear more than once. You could define a reusable editor, and by implementing the IsEditor interface, any object could participate in the same hierarchy as the reusable editor without your having to write code to adapt to the Editor framework, and you avoid duplication of code. In the following listing you can see a widget implementing the IsEditor interface.

Listing 9.14. View of type Composite participating in an editor hierarchy ...

Get GWT in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.