niloc132 / gxt-driver

Other
5 stars 7 forks source link

Make the Tree and Item model classes extendable #15

Open PeterWippermann opened 8 years ago

PeterWippermann commented 8 years ago

I wanted to extend the org.senchalabs.gwt.gwtdriver.gxt.models.Tree model class, but there are several impediments. I'd propose the following changes:

niloc132 commented 8 years ago

Any ClientMethods subclass is effectively free to create (https://github.com/niloc132/gwt-driver/blob/master/src/main/java/org/senchalabs/gwt/gwtdriver/invoke/ClientMethodsFactory.java), so subclasses can build their own as you said. We've already talked about the inherent issues in subclassing a widget and its finder, so I'm assuming you are just .as()'ing them to your subclass.

Counter proposal for Tree.Item ctor: make it protected (so it can be subclassed), and make a factory method in Tree to create them, that way any instance that Tree itself makes can be controlled in your subclass.

(that is to say: "patches welcome")

PeterWippermann commented 8 years ago

:+1: