0

If I define a custom cell extending AbstractCell how to I use my custom cell in a CellTable?

My custom cell is composed of two Labels and an Image and is populated by a Contact object that holds the values for the labels and image.

How do I define a Column that references my custom cell to add to my CellTable? Snippets from the code:

The abstract cell widget:

public class ContactCell extends AbstractCell<String> { ... }

The data class:

public class Contact  {
    String first;
    String last;
    String photo_url;
}

The code building the CellTable:

CellTable<Contact> results = getView().getContactsTable();
Column<Contact, SOMECLASSHERE> col 
    = new Column<Contact, SOMECLASSHERE>(new SOMECLASSHERE()) {
        @Override
        public SOMECLASSHERE getValue(Contact object) {
            // TODO Auto-generated method stub
            return WHAT?;
        }
    };
}

Is this a correct approach? And if so, how to I use my abstract cell?

Carl
  • 2,896
  • 2
  • 32
  • 50

1 Answers1

1

UiBinder always is an implementation detail, be it for a widget or a cell. Users of the class only see a widget or cell.

For instance, could you tell from their API that NativeHorizontalScrollbar, NotificationMode or ValueBoxEditorDecorator use UiBinder? Would it change anything if they were not?

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164