javagwtcelllist

How is it possible to instantiate a CellList<String> object using a TextCell object as parameter for CellList<String> constructor?


This how the code looks like in the GWT Javadoc mini tutorial:

TextCell textCell = new TextCell();
CellList<String> cellList = new CellList<String>(textCell);

I ask this because I can’t see any relationship between TextCell and it relationship with the CellList constructor requirements, therefore, I cant see how textCell satisfies CelList requierments.

The CellList constructors are:

CellList(Cell<T> cell)
Construct a new CellList.
CellList(Cell<T> cell, CellList.Resources resources)
Construct a new CellList with the specified CellList.Resources.
CellList(Cell<T> cell, CellList.Resources resources, ProvidesKey<T> keyProvider)
Construct a new CellList with the specified CellList.Resources and key provider.
CellList(Cell<T> cell, ProvidesKey<T> keyProvider)
Construct a new CellList with the specified key provider.

My question aims to basically understand how this works, and if you guys can tell me which Java or OOP topic or something could explain this in detail.

Thank you.


Solution

  • TextCell simply implements Cell<String>: http://www.gwtproject.org/javadoc/latest/com/google/gwt/cell/client/TextCell.html