Skip to content

Instantly share code, notes, and snippets.

@slugmandrew
Created November 24, 2015 18:57
Show Gist options
  • Save slugmandrew/32d7ea2b6a39b57b313a to your computer and use it in GitHub Desktop.
Save slugmandrew/32d7ea2b6a39b57b313a to your computer and use it in GitHub Desktop.
GWT Custom CellList Resources
.cellListSelectedItem {
background: #f2f2f2;
color: inherit;
}
.cellListKeyboardSelectedItem {
background: #f2f2f2;
color: inherit;
}
package com.utilitiessavings.usavappv7.client.resources;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.user.cellview.client.CellList.Resources;
public interface MyCellListResources extends Resources
{
public static final MyCellListResources INSTANCE = GWT.create(MyCellListResources.class);
@Source(value = { CellList.Style.DEFAULT_CSS, "CellListStyle.css" })
CellList.Style cellListStyle();
}
@UiField(provided = true)
CellList<OfferDto> list;
private ListDataProvider<OfferDto> dataProvider = new ListDataProvider<>();
private MultiSelectionModel<OfferDto> selectionModel = new MultiSelectionModel<>(OfferDto.KEY_PROVIDER);
// snip
list = new CellList<>(cell, MyCellListResources.INSTANCE, OfferDto.KEY_PROVIDER);
list.setSelectionModel(selectionModel);
dataProvider.addDataDisplay(list);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler()
{
@Override
public void onSelectionChange(SelectionChangeEvent event)
{
setSelectedTariffs(getOffersSelected().size());
}
});
@slugmandrew
Copy link
Author

Here you can see the two instances of the same generated class name:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment